Class | Bio::PhyloXML::ProteinDomain
In: | lib/bio/db/phyloxml/phyloxml_elements.rb
Parent: | Object

## Description

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

### Methods

confidence= from= to= to_xml

### Attributes

confidence | [RW] | 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)

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 890
    890:       def confidence=(str)
    891:         @confidence = str.to_f
    892:       end

from=(str)

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 882
    882:       def from=(str)
    883:         @from = str.to_i
    884:       end

to=(str)

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 886
    886:       def to=(str)
    887:         @to = str.to_i
    888:       end

to_xml()

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

[Source]

         # 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

[Validate]