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]
to[R]

Integer. End of the domain.

value[RW]

Public Instance Methods

confidence=(str) click to toggle source

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

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 903
def confidence=(str)
  @confidence = str.to_f
end
from=(str) click to toggle source

Integer. Beginning of the domain.

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 893
def from=(str)
  @from = str.to_i
end
to=(str) click to toggle source

Integer. End of the domain.

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 898
def to=(str)
  @to = str.to_i
end
to_xml() click to toggle source

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

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 908
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