Class: Bio::KEGG::PATHWAY

Overview

Description

Bio::KEGG::PATHWAY is a parser class for the KEGG PATHWAY database entry.

References

Constant Summary collapse

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

Instance Method Summary collapse

Methods inherited from DB

#exists?, #fetch, #get, open, #tags

Constructor Details

#initialize(entry) ⇒ PATHWAY

Creates a new Bio::KEGG::PATHWAY object.


Arguments:

  • (required) entry: (String) single entry as a string

Returns

Bio::KEGG::PATHWAY object



71
72
73
# File 'lib/bio/db/kegg/pathway.rb', line 71

def initialize(entry)
  super(entry, TAGSIZE)
end

Instance Method Details

#compounds_as_hashObject Also known as: compounds

Compounds described in the COMPOUND lines.


Returns

Hash of compound ID and its definition



211
212
213
214
215
216
# File 'lib/bio/db/kegg/pathway.rb', line 211

def compounds_as_hash
  unless (defined? @compounds_as_hash) && @compounds_as_hash
    @compounds_as_hash = strings_as_hash(compounds_as_strings)
  end
  @compounds_as_hash
end

#compounds_as_stringsObject

Compounds described in the COMPOUND lines.


Returns

Array containing String



204
205
206
# File 'lib/bio/db/kegg/pathway.rb', line 204

def compounds_as_strings
  lines_fetch('COMPOUND')
end

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



32
# File 'lib/bio/db/kegg/pathway.rb', line 32

def dblinks_as_hash; super; end

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


Returns

Array containing String



139
140
141
# File 'lib/bio/db/kegg/pathway.rb', line 139

def dblinks_as_strings
  lines_fetch('DBLINKS')
end

#descriptionObject Also known as: definition

Description of the pathway, described in the DESCRIPTION line.


Returns

String



92
93
94
# File 'lib/bio/db/kegg/pathway.rb', line 92

def description
  field_fetch('DESCRIPTION')
end

#diseases_as_hashObject Also known as: diseases

Diseases described in the DISEASE lines.


Returns

Hash of disease ID and its definition



128
129
130
131
132
133
# File 'lib/bio/db/kegg/pathway.rb', line 128

def diseases_as_hash
  unless (defined? @diseases_as_hash) && @diseases_as_hash
    @diseases_as_hash = strings_as_hash(diseases_as_strings)
  end
  @diseases_as_hash
end

#diseases_as_stringsObject

Disease described in the DISEASE lines.


Returns

Array containing String



121
122
123
# File 'lib/bio/db/kegg/pathway.rb', line 121

def diseases_as_strings
  lines_fetch('DISEASE')
end

#entry_idObject

Return the ID of the pathway, described in the ENTRY line.


Returns

String



78
79
80
# File 'lib/bio/db/kegg/pathway.rb', line 78

def entry_id
  field_fetch('ENTRY')[/\S+/]
end

#enzymes_as_stringsObject Also known as: enzymes

Enzymes described in the ENZYME lines.


Returns

Array containing String



178
179
180
# File 'lib/bio/db/kegg/pathway.rb', line 178

def enzymes_as_strings
  lines_fetch('ENZYME')
end

#genes_as_hashObject Also known as: genes

Genes described in the GENE lines.


Returns

Hash of gene ID and its definition



167
168
169
170
171
172
# File 'lib/bio/db/kegg/pathway.rb', line 167

def genes_as_hash
  unless (defined? @genes_as_hash) && @genes_as_hash
    @genes_as_hash = strings_as_hash(genes_as_strings)
  end
  @genes_as_hash
end

#genes_as_stringsObject

Genes described in the GENE lines.


Returns

Array containing String



160
161
162
# File 'lib/bio/db/kegg/pathway.rb', line 160

def genes_as_strings
  lines_fetch('GENE')
end

#keggclassObject

Return the name of the KEGG class, described in the CLASS line.


Returns

String



100
101
102
# File 'lib/bio/db/kegg/pathway.rb', line 100

def keggclass
  field_fetch('CLASS')
end

#ko_pathwayObject

KO pathway described in the KO_PATHWAY line.


Returns

String



246
247
248
# File 'lib/bio/db/kegg/pathway.rb', line 246

def ko_pathway
  field_fetch('KO_PATHWAY')
end

#modules_as_hashObject Also known as: modules

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



58
# File 'lib/bio/db/kegg/pathway.rb', line 58

def modules_as_hash; super; end

#modules_as_stringsObject

Returns MODULE field of the entry.


Returns

Array containing String objects



114
115
116
# File 'lib/bio/db/kegg/pathway.rb', line 114

def modules_as_strings
  lines_fetch('MODULE')
end

#nameObject

Name of the pathway, described in the NAME line.


Returns

String



85
86
87
# File 'lib/bio/db/kegg/pathway.rb', line 85

def name
  field_fetch('NAME')
end

#organismObject

Organism described in the ORGANISM line.


Returns

String



153
154
155
# File 'lib/bio/db/kegg/pathway.rb', line 153

def organism
  field_fetch('ORGANISM')
end

#orthologs_as_hashObject Also known as: orthologs

Returns a Hash of the orthology ID and definition in ORTHOLOGY field.



42
# File 'lib/bio/db/kegg/pathway.rb', line 42

def orthologs_as_hash; super; end

#orthologs_as_stringsObject

Orthologs described in the ORTHOLOGY lines.


Returns

Array containing String



146
147
148
# File 'lib/bio/db/kegg/pathway.rb', line 146

def orthologs_as_strings
  lines_fetch('ORTHOLOGY')
end

#pathways_as_hashObject Also known as: pathways

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



37
# File 'lib/bio/db/kegg/pathway.rb', line 37

def pathways_as_hash; super; end

#pathways_as_stringsObject

Pathways described in the PATHWAY_MAP lines.


Returns

Array containing String



107
108
109
# File 'lib/bio/db/kegg/pathway.rb', line 107

def pathways_as_strings
  lines_fetch('PATHWAY_MAP')
end

#reactions_as_hashObject Also known as: reactions

Reactions described in the REACTION lines.


Returns

Hash of reaction ID and its definition



193
194
195
196
197
198
# File 'lib/bio/db/kegg/pathway.rb', line 193

def reactions_as_hash
  unless (defined? @reactions_as_hash) && @reactions_as_hash
    @reactions_as_hash = strings_as_hash(reactions_as_strings)
  end
  @reactions_as_hash
end

#reactions_as_stringsObject

Reactions described in the REACTION lines.


Returns

Array containing String



186
187
188
# File 'lib/bio/db/kegg/pathway.rb', line 186

def reactions_as_strings
  lines_fetch('REACTION')
end

#referencesObject

REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.


Returns

an Array containing Bio::Reference objects



50
# File 'lib/bio/db/kegg/pathway.rb', line 50

def references; super; end

#rel_pathways_as_hashObject Also known as: rel_pathways

Returns REL_PATHWAY field as a Hash. Each key of the hash is Pathway ID, and each value is the name of the pathway.


Returns

Hash



230
231
232
233
234
235
236
237
238
239
240
# File 'lib/bio/db/kegg/pathway.rb', line 230

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

#rel_pathways_as_stringsObject

Returns REL_PATHWAY field of the entry.


Returns

Array containing String objects



222
223
224
# File 'lib/bio/db/kegg/pathway.rb', line 222

def rel_pathways_as_strings
  lines_fetch('REL_PATHWAY')
end