Class: Bio::PhyloXML::ProteinDomain
- Inherits:
-
Object
- Object
- Bio::PhyloXML::ProteinDomain
- Defined in:
- lib/bio-phyloxml/phyloxml_elements.rb
Overview
Description
To represent an individual domain in a domain architecture. The name/unique identifier is described via the ‘id’ attribute.
Instance Attribute Summary collapse
-
#confidence ⇒ Object
Float, for example to store E-values 4.7E-14.
-
#from ⇒ Object
Integer.
-
#id ⇒ Object
String.
-
#to ⇒ Object
Integer.
-
#value ⇒ Object
String.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts elements to xml representation.
Instance Attribute Details
#confidence ⇒ Object
Float, for example to store E-values 4.7E-14
870 871 872 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 870 def confidence @confidence end |
#from ⇒ Object
Integer. Beginning of the domain.
876 877 878 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 876 def from @from end |
#id ⇒ Object
String
873 874 875 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 873 def id @id end |
#to ⇒ Object
Integer. End of the domain.
879 880 881 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 879 def to @to end |
#value ⇒ Object
String
873 874 875 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 873 def value @value end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 897 def to_xml if @from == nil raise "from attribute of ProteinDomain class is required." elsif @to == nil raise "to attribute of ProteinDomain class is required." else xml_node = LibXML::XML::Node.new('domain', @value) xml_node["from"] = @from.to_s xml_node["to"] = @to.to_s xml_node["id"] = @id if (defined? @id) && @id xml_node["confidence"] = @confidence.to_s return xml_node end end |