Class: GO::Annotation
- Extended by:
- GermDefault
- Defined in:
- lib/go.rb
Defined Under Namespace
Classes: AnnotationLine
Constant Summary
Constants included from GermDefault
Instance Attribute Summary
Attributes inherited from HashTable
Instance Method Summary collapse
- #gene_annotations(gene) ⇒ Object
-
#initialize(file = nil, opts = {}) ⇒ Annotation
constructor
A new instance of Annotation.
- #ontology ⇒ Object
Methods included from GermDefault
cache, cache_load, default, has_default, method_missing
Methods inherited from HashTable
#<<, #[], #concat, #each, #formatted_header, header_off, header_on, #idx, #idx_keys, #inspect, line_class, line_type, #output, #preamble, #sample, #select!, #sort_by!, #sum, #update_index, #use_header?, use_header?, #wrap
Methods included from HashTableAux
Methods included from Printer
Constructor Details
#initialize(file = nil, opts = {}) ⇒ Annotation
Returns a new instance of Annotation.
136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/go.rb', line 136 def initialize file=nil, opts={} opts = opts.merge :header => [ :db, :db_object_id, :db_object_symbol, :qualifier, :go_id, :db_reference, :evidence_code, :with, :aspect, :db_object_name, :synonym, :db_object_type, :taxon, :date, :assigned_by, :annotation_extension, :gene_product_form_id ], :skip_header => true, :comment => "!", :ontology => GO::Ontology.default super file, opts @annos = {} end |
Instance Method Details
#gene_annotations(gene) ⇒ Object
157 158 159 160 161 |
# File 'lib/go.rb', line 157 def gene_annotations gene @annos[gene] ||= select do |g| g.db_object_symbol == gene end end |
#ontology ⇒ Object
149 150 151 |
# File 'lib/go.rb', line 149 def ontology @ontology ||= @opts[:ontology] end |