Class | Bio::PhyloXML::ProteinDomain |
In: |
lib/bio/db/phyloxml/phyloxml_elements.rb
|
Parent: | Object |
To represent an individual domain in a domain architecture. The name/unique identifier is described via the ‘id’ attribute.
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 890 890: def confidence=(str) 891: @confidence = str.to_f 892: end
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 882 882: def from=(str) 883: @from = str.to_i 884: end
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 886 886: def to=(str) 887: @to = str.to_i 888: end
Converts elements to xml representation. Called by PhyloXML::Writer class.
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 895 895: def to_xml 896: if @from == nil 897: raise "from attribute of ProteinDomain class is required." 898: elsif @to == nil 899: raise "to attribute of ProteinDomain class is required." 900: else 901: xml_node = LibXML::XML::Node.new('domain', @value) 902: xml_node["from"] = @from.to_s 903: xml_node["to"] = @to.to_s 904: xml_node["id"] = @id if @id != nil 905: xml_node["confidence"] = @confidence.to_s 906: 907: return xml_node 908: end 909: 910: end