Module: Bio::KEGG::Common::ModulesAsHash

Included in:
ORTHOLOGY, PATHWAY
Defined in:
lib/bio/db/kegg/common.rb

Overview

This module provides modules_as_hash method.

Bio::KEGG::* internal use only.

Instance Method Summary (collapse)

Instance Method Details

- (Object) modules_as_hash

Returns MODULE field as a Hash. Each key of the hash is KEGG MODULE ID, and each value is the name of the Pathway Module.


Returns

Hash



182
183
184
185
186
187
188
189
190
191
192
# File 'lib/bio/db/kegg/common.rb', line 182

def modules_as_hash
  unless defined? @modules_s_as_hash then
    hash = {}
    modules_as_strings.each do |line|
      entry_id, name = line.split(/\s+/, 2)
      hash[entry_id] = name
    end
    @modules_as_hash = hash
  end
  @modules_as_hash
end