class Bio::PhyloXML::Annotation

Description

The annotation of a molecular sequence. It is recommended to annotate by using the optional 'ref' attribute (some examples of acceptable values for the ref attribute: 'GO:0008270', 'KEGG:Tetrachloroethene degradation',

'EC:1.1.1.1').

Attributes

confidence[RW]

Confidence object. Type and value of support for a annotation.

desc[RW]

String. Free text description.

evidence[RW]

String. evidence for a annotation as free text (e.g. 'experimental')

properties[RW]

Array of Property objects. Allows for further, typed and referenced annotations from external resources

ref[RW]

String. For example, 'GO:0008270', 'KEGG:Tetrachloroethene degradation', 'EC:1.1.1.1'

source[RW]
type[RW]

String. Type of the annotation.

uri[RW]

Uri object.

Public Class Methods

new() click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 724
def initialize
  #@todo add unit test for this, since didn't break anything when changed from property to properties
  @properties = []
end

Public Instance Methods

to_xml() click to toggle source

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

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 730
def to_xml
  annot = LibXML::XML::Node.new('annotation')
  annot["ref"] = @ref if (defined? @ref) && @ref
  PhyloXML::Writer.generate_xml(annot, self, [[:simple, 'desc', (defined? @desc) ? @desc : nil],
    [:complex, 'confidence', (defined? @confidence) ? @confidence : nil],
    [:objarr, 'property', 'properties'],
    [:complex, 'uri', (defined? @uri) ? @uri : nil]])
  return annot
end