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[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)
click to toggle source
# File lib/bio/phyloxml/elements.rb, line 882 def confidence=(str) @confidence = str.to_f end
from=(str)
click to toggle source
# File lib/bio/phyloxml/elements.rb, line 874 def from=(str) @from = str.to_i end
to=(str)
click to toggle source
# File lib/bio/phyloxml/elements.rb, line 878 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/phyloxml/elements.rb, line 887 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 @id != nil xml_node["confidence"] = @confidence.to_s return xml_node end end