Module: Bio::KEGG::Common::OrthologsAsHash

Included in:
ENZYME, GENES, GLYCAN, PATHWAY, REACTION
Defined in:
lib/bio/db/kegg/common.rb

Overview

This module provides orthologs_as_hash method.

Bio::KEGG::* internal use only.

Instance Method Summary collapse

Instance Method Details

#orthologs_as_hashObject

Returns a Hash of the orthology ID and definition in ORTHOLOGY field.



136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/bio/db/kegg/common.rb', line 136

def orthologs_as_hash
  unless defined? @orthologs_as_hash
    kos = {}
    orthologs_as_strings.each do |line|
      ko = line.sub(/\AKO\:\s+/, '')
      entry_id, definition = ko.split(/\s+/, 2)
      kos[entry_id] = definition
    end
    @orthologs_as_hash = kos
  end
  @orthologs_as_hash
end