module Bio::KEGG::Common::OrthologsAsHash

This module provides #orthologs_as_hash method.

Bio::KEGG::* internal use only.

Public Instance Methods

orthologs_as_hash() click to toggle source

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

# 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