Class: Bio::PhyloXML::DomainArchitecture

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeDomainArchitecture

Returns a new instance of DomainArchitecture.



861
862
863
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 861

def initialize
  @domains = []
end

Instance Attribute Details

#domainsObject (readonly)

Array of ProteinDomain objects.



854
855
856
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 854

def domains
  @domains
end

#lengthObject

Integer. Total length of the protein



851
852
853
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 851

def length
  @length
end

Instance Method Details

#to_xmlObject

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



866
867
868
869
870
871
872
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 866

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