class Bio::PhyloXML::Taxonomy
Attributes
pattern = [a-zA-Z0-9_]{2,10} Can refer to any code/abbreviation/mnemonic, such as Bsu for Bacillus subtilis.
An array of strings
Used to link other elements to a taxonomy (on the xml-level)
value comes from list: domain kingdom, subkingdom, branch, infrakingdom, superphylum, phylum, subphylum, infraphylum, microphylum, superdivision, division, subdivision, infradivision, superclass, class, subclass, infraclass, superlegion, legion, sublegion, infralegion, supercohort, cohort, subcohort, infracohort, superorder, order, suborder, superfamily, family, subfamily, supertribe, tribe, subtribe, infratribe, genus, subgenus, superspecies, species, subspecies, variety, subvariety, form, subform, cultivar, unknown, other
String.
An array of strings. Holds synonyms for scientific names or common names.
String. Unique identifier of a taxon.
Uri
object
Public Class Methods
creates a new Bio::PhyloXML::Taxonomy
object.
# File lib/bio-phyloxml/phyloxml_elements.rb 56 def initialize 57 @common_names = [] 58 @synonyms = [] 59 60 # below attributes may be PhyloXML specific. 61 @other = [] 62 end
Public Instance Methods
Converts elements to xml representation. Called by PhyloXML::Writer
class.
# File lib/bio-phyloxml/phyloxml_elements.rb 80 def to_xml 81 taxonomy = LibXML::XML::Node.new('taxonomy') 82 taxonomy["type"] = @type if (defined? @type) && @type 83 taxonomy["id_source"] = @id_source if (defined? @id_source) && @id_source 84 85 PhyloXML::Writer.generate_xml(taxonomy, self, [[:complex, 'id', (defined? @taxonomy_id) ? @taxonomy_id : nil], 86 [:pattern, 'code', (defined? @code) ? @code : nil, Regexp.new("^[a-zA-Z0-9_]{2,10}$")], 87 [:simple, 'scientific_name', (defined? @scientific_name) ? @scientific_name : nil], 88 [:simple, 'authority', (defined? @authority) ? @authority : nil], 89 [:simplearr, 'common_name', (defined? @common_names) ? @common_names : nil], 90 [:simplearr, 'synonym', (defined? @synonyms) ? @synonyms : nil], 91 [:simple, 'rank', (defined? @rank) ? @rank : nil], 92 [:complex, 'uri',(defined? @uri) ? @uri : nil]]) 93 #@todo anything else 94 95 96 return taxonomy 97 end