module Bio::KEGG::Common::PathwaysAsHash

The module providing #pathways_as_hash method.

Bio::KEGG::* internal use only.

Public Instance Methods

pathways_as_hash() click to toggle source

Returns a Hash of the pathway ID and name in PATHWAY field.

# File lib/bio/db/kegg/common.rb, line 116
def pathways_as_hash
  unless defined? @pathways_as_hash then
    hash = {}
    pathways_as_strings.each do |line|
      line = line.sub(/\APATH\:\s+/, '')
      entry_id, name = line.split(/\s+/, 2)
      hash[entry_id] = name
    end
    @pathways_as_hash = hash
  end
  @pathways_as_hash
end