Class: Bio::PhyloXML::Annotation
- Inherits:
-
Object
- Object
- Bio::PhyloXML::Annotation
- Defined in:
- lib/bio-phyloxml/phyloxml_elements.rb
Overview
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').
Instance Attribute Summary collapse
-
#confidence ⇒ Object
Confidence object.
-
#desc ⇒ Object
String.
-
#evidence ⇒ Object
String.
-
#properties ⇒ Object
Array of Property objects.
-
#ref ⇒ Object
String.
-
#source ⇒ Object
String.
-
#type ⇒ Object
String.
-
#uri ⇒ Object
Uri object.
Instance Method Summary collapse
-
#initialize ⇒ Annotation
constructor
A new instance of Annotation.
-
#to_xml ⇒ Object
Converts elements to xml representation.
Constructor Details
#initialize ⇒ Annotation
Returns a new instance of Annotation.
713 714 715 716 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 713 def initialize #@todo add unit test for this, since didn't break anything when changed from property to properties @properties = [] end |
Instance Attribute Details
#confidence ⇒ Object
Confidence object. Type and value of support for a annotation.
706 707 708 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 706 def confidence @confidence end |
#desc ⇒ Object
String. Free text description.
704 705 706 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 704 def desc @desc end |
#evidence ⇒ Object
String. evidence for a annotation as free text (e.g. ‘experimental’)
700 701 702 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 700 def evidence @evidence end |
#properties ⇒ Object
Array of Property objects. Allows for further, typed and referenced annotations from external resources
709 710 711 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 709 def properties @properties end |
#ref ⇒ Object
String. For example, ‘GO:0008270’, ‘KEGG:Tetrachloroethene degradation’, ‘EC:1.1.1.1’
696 697 698 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 696 def ref @ref end |
#source ⇒ Object
String
698 699 700 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 698 def source @source end |
#type ⇒ Object
String. Type of the annotation.
702 703 704 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 702 def type @type end |
#uri ⇒ Object
Uri object.
711 712 713 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 711 def uri @uri end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
719 720 721 722 723 724 725 726 727 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 719 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 |