Class Bio::KEGG::ORTHOLOGY
In: lib/bio/db/kegg/orthology.rb
Parent: KEGGDB

Methods

Constants

DELIMITER = RS = "\n///\n"
TAGSIZE = 12

Public Class methods

Reads a flat file format entry of the KO database.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 31
31:   def initialize(entry)
32:     super(entry, TAGSIZE)
33:   end

Public Instance methods

Returns an Array of a database name and entry IDs in DBLINKS field.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 71
71:   def dblinks
72:     unless @data['DBLINKS']
73:       @data['DBLINKS'] = lines_fetch('DBLINKS')
74:     end
75:     @data['DBLINKS']
76:   end

Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 79
79:   def dblinks_as_hash
80:     hash = {}
81:     dblinks.each do |line|
82:       name, *list = line.split(/\s+/)
83:       db = name.downcase.sub(/:/, '')
84:       hash[db] = list
85:     end
86:     return hash
87:   end

Returns DEFINITION field of the entry.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 51
51:   def definition
52:     field_fetch('DEFINITION')
53:   end

Returns ID of the entry.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 36
36:   def entry_id
37:     field_fetch('ENTRY')[/\S+/]
38:   end

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

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 90
90:   def genes
91:     unless @data['GENES']
92:       @data['GENES'] = lines_fetch('GENES')
93:     end
94:     @data['GENES']
95:   end

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

[Source]

     # File lib/bio/db/kegg/orthology.rb, line 98
 98:   def genes_as_hash
 99:     hash = {}
100:     genes.each do |line|
101:       name, *list = line.split(/\s+/)
102:       org = name.downcase.sub(/:/, '')
103:       genes = list.map {|x| x.sub(/\(.*\)/, '')}
104:       #names = list.map {|x| x.scan(/.*\((.*)\)/)}
105:       hash[org] = genes
106:     end
107:     return hash
108:   end

Returns CLASS field of the entry.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 56
56:   def keggclass
57:     field_fetch('CLASS')
58:   end

Returns an Array of biological classes in CLASS field.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 61
61:   def keggclasses
62:     keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/)
63:   end

Returns NAME field of the entry.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 41
41:   def name
42:     field_fetch('NAME')
43:   end

Returns an Array of names in NAME field.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 46
46:   def names
47:     name.split(', ')
48:   end

Returns an Array of KEGG/PATHWAY ID in CLASS field.

[Source]

    # File lib/bio/db/kegg/orthology.rb, line 66
66:   def pathways
67:     keggclass.scan(/\[PATH:(.*?)\]/).flatten
68:   end

[Validate]