Class: Bio::PhyloXML::Accession

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/phyloxml/elements.rb

Overview

Description

Element Accession is used to capture the local part in a sequence identifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sourceObject

String. Source of the accession id. Example: “UniProtKB”



642
643
644
# File 'lib/bio/phyloxml/elements.rb', line 642

def source
  @source
end

#valueObject

String. Value of the accession id. Example: “P17304”



645
646
647
# File 'lib/bio/phyloxml/elements.rb', line 645

def value
  @value
end

Instance Method Details

#to_xmlObject

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



648
649
650
651
652
653
# File 'lib/bio/phyloxml/elements.rb', line 648

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