Class: Bio::PhyloXML::DomainArchitecture
- Inherits:
-
Object
- Object
- Bio::PhyloXML::DomainArchitecture
- Defined in:
- lib/bio/db/phyloxml/phyloxml_elements.rb
Overview
Description
This is used describe the domain architecture of a protein. Attribute 'length' is the total length of the protein
Instance Attribute Summary (collapse)
-
- (Object) domains
readonly
Array of ProteinDomain objects.
-
- (Object) length
Integer.
Instance Method Summary (collapse)
-
- (DomainArchitecture) initialize
constructor
A new instance of DomainArchitecture.
-
- (Object) to_xml
Converts elements to xml representation.
Constructor Details
- (DomainArchitecture) initialize
A new instance of DomainArchitecture
851 852 853 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 851 def initialize @domains = [] end |
Instance Attribute Details
- (Object) domains (readonly)
Array of ProteinDomain objects.
845 846 847 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 845 def domains @domains end |
- (Object) length
Integer. Total length of the protein
842 843 844 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 842 def length @length end |
Instance Method Details
- (Object) to_xml
Converts elements to xml representation. Called by PhyloXML::Writer class.
856 857 858 859 860 861 862 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 856 def to_xml xml_node = LibXML::XML::Node.new('domain_architecture') PhyloXML::Writer.generate_xml(xml_node, self,[ [:attr, 'length'], [:objarr, 'domain', 'domains']]) return xml_node end |