class Bio::PhyloXML::ProteinDomain

Description

To represent an individual domain in a domain architecture. The name/unique identifier is described via the ‘id’ attribute.

Attributes

confidence[R]

Float, for example to store E-values 4.7E-14

from[R]

Integer. Beginning of the domain.

id[RW]

String

to[R]

Integer. End of the domain.

value[RW]

String

Public Instance Methods

confidence=(str) click to toggle source

Float, for example to store E-values 4.7E-14

    # File lib/bio-phyloxml/phyloxml_elements.rb
892 def confidence=(str)
893   @confidence = str.to_f
894 end
from=(str) click to toggle source

Integer. Beginning of the domain.

    # File lib/bio-phyloxml/phyloxml_elements.rb
882 def from=(str)
883   @from = str.to_i
884 end
to=(str) click to toggle source

Integer. End of the domain.

    # File lib/bio-phyloxml/phyloxml_elements.rb
887 def to=(str)
888   @to = str.to_i
889 end
to_xml() click to toggle source

Converts elements to xml representation. Called by PhyloXML::Writer class.

    # File lib/bio-phyloxml/phyloxml_elements.rb
897 def to_xml
898   if @from == nil
899     raise "from attribute of ProteinDomain class is required."
900   elsif @to == nil
901     raise "to attribute of ProteinDomain class is required."
902   else
903     xml_node = LibXML::XML::Node.new('domain', @value)
904     xml_node["from"] = @from.to_s
905     xml_node["to"] = @to.to_s
906     xml_node["id"] = @id if (defined? @id) && @id
907     xml_node["confidence"] = @confidence.to_s
908 
909     return xml_node
910   end
911 
912 end