Module Bio::KEGG::Common::GenesAsHash
In: lib/bio/db/kegg/common.rb

This module provides genes_as_hash method.

Bio::KEGG::* internal use only.

Methods

Public Instance methods

Returns a Hash of the organism ID and an Array of entry IDs in GENES field.

[Source]

     # File lib/bio/db/kegg/common.rb, line 93
 93:       def genes_as_hash
 94:         unless defined? @genes_as_hash
 95:           hash = {}
 96:           genes_as_strings.each do |line|
 97:             name, *list = line.split(/\s+/)
 98:             org = name.downcase.sub(/:/, '')
 99:             genes = list.map {|x| x.sub(/\(.*\)/, '')}
100:             #names = list.map {|x| x.scan(/.*\((.*)\)/)}
101:             hash[org] = genes
102:           end
103:           @genes_as_hash = hash
104:         end
105:         @genes_as_hash
106:       end

[Validate]