Method: Bio::KEGG::ORTHOLOGY#genes_as_hash
- Defined in:
- lib/bio/db/kegg/orthology.rb
#genes_as_hash ⇒ Object
Returns a Hash of the organism ID and an Array of entry IDs in GENES field.
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/bio/db/kegg/orthology.rb', line 98 def genes_as_hash hash = {} genes.each do |line| name, *list = line.split(/\s+/) org = name.downcase.sub(/:/, '') genes = list.map {|x| x.sub(/\(.*\)/, '')} #names = list.map {|x| x.scan(/.*\((.*)\)/)} hash[org] = genes end return hash end |