Class: Bio::PhyloXML::Accession
- Defined in:
- lib/bio/db/phyloxml/phyloxml_elements.rb
Overview
Description
Element Accession is used to capture the local part in a sequence identifier.
Instance Attribute Summary collapse
-
#source ⇒ Object
String.
-
#value ⇒ Object
String.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts elements to xml representation.
Instance Attribute Details
#source ⇒ Object
String. Source of the accession id. Example: “UniProtKB”
659 660 661 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 659 def source @source end |
#value ⇒ Object
String. Value of the accession id. Example: “P17304”
662 663 664 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 662 def value @value end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
665 666 667 668 669 670 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 665 def to_xml raise "Source attribute is required for Accession object." if @source == nil accession = LibXML::XML::Node.new('accession', @value) accession['source'] = @source return accession end |