Class: Bio::KEGG::PATHWAY
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::PATHWAY
- Includes:
- Common::DblinksAsHash, Common::DiseasesAsHash, Common::ModulesAsHash, Common::OrthologsAsHash, Common::PathwaysAsHash, Common::References, Common::StringsAsHash
- Defined in:
- lib/bio/db/kegg/pathway.rb
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
-
#compounds_as_hash ⇒ Object
(also: #compounds)
Compounds described in the COMPOUND lines.
-
#compounds_as_strings ⇒ Object
Compounds described in the COMPOUND lines.
-
#dblinks_as_hash ⇒ Object
(also: #dblinks)
Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.
-
#dblinks_as_strings ⇒ Object
Returns an Array of a database name and entry IDs in DBLINKS field.
-
#description ⇒ Object
(also: #definition)
Description of the pathway, described in the DESCRIPTION line.
-
#diseases_as_hash ⇒ Object
(also: #diseases)
Returns a Hash of the disease ID and its definition.
-
#diseases_as_strings ⇒ Object
Disease described in the DISEASE lines.
-
#entry_id ⇒ Object
Return the ID of the pathway, described in the ENTRY line.
-
#enzymes_as_strings ⇒ Object
(also: #enzymes)
Enzymes described in the ENZYME lines.
-
#genes_as_hash ⇒ Object
(also: #genes)
Genes described in the GENE lines.
-
#genes_as_strings ⇒ Object
Genes described in the GENE lines.
-
#initialize(entry) ⇒ PATHWAY
constructor
Creates a new Bio::KEGG::PATHWAY object.
-
#keggclass ⇒ Object
Return the name of the KEGG class, described in the CLASS line.
-
#ko_pathway ⇒ Object
KO pathway described in the KO_PATHWAY line.
-
#modules_as_hash ⇒ Object
(also: #modules)
Returns MODULE field as a Hash.
-
#modules_as_strings ⇒ Object
Returns MODULE field of the entry.
-
#name ⇒ Object
Name of the pathway, described in the NAME line.
-
#organism ⇒ Object
Organism described in the ORGANISM line.
-
#orthologs_as_hash ⇒ Object
(also: #orthologs)
Returns a Hash of the orthology ID and definition in ORTHOLOGY field.
-
#orthologs_as_strings ⇒ Object
Orthologs described in the ORTHOLOGY lines.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Returns a Hash of the pathway ID and name in PATHWAY field.
-
#pathways_as_strings ⇒ Object
Pathways described in the PATHWAY_MAP lines.
-
#reactions_as_hash ⇒ Object
(also: #reactions)
Reactions described in the REACTION lines.
-
#reactions_as_strings ⇒ Object
Reactions described in the REACTION lines.
-
#references ⇒ Object
REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.
-
#rel_pathways_as_hash ⇒ Object
(also: #rel_pathways)
Returns REL_PATHWAY field as a Hash.
-
#rel_pathways_as_strings ⇒ Object
Returns REL_PATHWAY field of the entry.
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
76 77 78 |
# File 'lib/bio/db/kegg/pathway.rb', line 76 def initialize(entry) super(entry, TAGSIZE) end |
Instance Method Details
#compounds_as_hash ⇒ Object Also known as: compounds
Compounds described in the COMPOUND lines.
- Returns
-
Hash of compound ID and its definition
205 206 207 208 209 210 |
# File 'lib/bio/db/kegg/pathway.rb', line 205 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_strings ⇒ Object
Compounds described in the COMPOUND lines.
- Returns
-
Array containing String
198 199 200 |
# File 'lib/bio/db/kegg/pathway.rb', line 198 def compounds_as_strings lines_fetch('COMPOUND') end |
#dblinks_as_hash ⇒ Object Also known as: dblinks
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 |
#dblinks_as_strings ⇒ Object
Returns an Array of a database name and entry IDs in DBLINKS field.
- Returns
-
Array containing String
133 134 135 |
# File 'lib/bio/db/kegg/pathway.rb', line 133 def dblinks_as_strings lines_fetch('DBLINKS') end |
#description ⇒ Object Also known as: definition
Description of the pathway, described in the DESCRIPTION line.
- Returns
-
String
97 98 99 |
# File 'lib/bio/db/kegg/pathway.rb', line 97 def description field_fetch('DESCRIPTION') end |
#diseases_as_hash ⇒ Object Also known as: diseases
Returns a Hash of the disease ID and its definition
47 |
# File 'lib/bio/db/kegg/pathway.rb', line 47 def diseases_as_hash; super; end |
#diseases_as_strings ⇒ Object
Disease described in the DISEASE lines.
- Returns
-
Array containing String
126 127 128 |
# File 'lib/bio/db/kegg/pathway.rb', line 126 def diseases_as_strings lines_fetch('DISEASE') end |
#entry_id ⇒ Object
Return the ID of the pathway, described in the ENTRY line.
- Returns
-
String
83 84 85 |
# File 'lib/bio/db/kegg/pathway.rb', line 83 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes_as_strings ⇒ Object Also known as: enzymes
Enzymes described in the ENZYME lines.
- Returns
-
Array containing String
172 173 174 |
# File 'lib/bio/db/kegg/pathway.rb', line 172 def enzymes_as_strings lines_fetch('ENZYME') end |
#genes_as_hash ⇒ Object Also known as: genes
Genes described in the GENE lines.
- Returns
-
Hash of gene ID and its definition
161 162 163 164 165 166 |
# File 'lib/bio/db/kegg/pathway.rb', line 161 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_strings ⇒ Object
Genes described in the GENE lines.
- Returns
-
Array containing String
154 155 156 |
# File 'lib/bio/db/kegg/pathway.rb', line 154 def genes_as_strings lines_fetch('GENE') end |
#keggclass ⇒ Object
Return the name of the KEGG class, described in the CLASS line.
- Returns
-
String
105 106 107 |
# File 'lib/bio/db/kegg/pathway.rb', line 105 def keggclass field_fetch('CLASS') end |
#ko_pathway ⇒ Object
KO pathway described in the KO_PATHWAY line.
- Returns
-
String
240 241 242 |
# File 'lib/bio/db/kegg/pathway.rb', line 240 def ko_pathway field_fetch('KO_PATHWAY') end |
#modules_as_hash ⇒ Object 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
63 |
# File 'lib/bio/db/kegg/pathway.rb', line 63 def modules_as_hash; super; end |
#modules_as_strings ⇒ Object
Returns MODULE field of the entry.
- Returns
-
Array containing String objects
119 120 121 |
# File 'lib/bio/db/kegg/pathway.rb', line 119 def modules_as_strings lines_fetch('MODULE') end |
#name ⇒ Object
Name of the pathway, described in the NAME line.
- Returns
-
String
90 91 92 |
# File 'lib/bio/db/kegg/pathway.rb', line 90 def name field_fetch('NAME') end |
#organism ⇒ Object
Organism described in the ORGANISM line.
- Returns
-
String
147 148 149 |
# File 'lib/bio/db/kegg/pathway.rb', line 147 def organism field_fetch('ORGANISM') end |
#orthologs_as_hash ⇒ Object 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_strings ⇒ Object
Orthologs described in the ORTHOLOGY lines.
- Returns
-
Array containing String
140 141 142 |
# File 'lib/bio/db/kegg/pathway.rb', line 140 def orthologs_as_strings lines_fetch('ORTHOLOGY') end |
#pathways_as_hash ⇒ Object 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_strings ⇒ Object
Pathways described in the PATHWAY_MAP lines.
- Returns
-
Array containing String
112 113 114 |
# File 'lib/bio/db/kegg/pathway.rb', line 112 def pathways_as_strings lines_fetch('PATHWAY_MAP') end |
#reactions_as_hash ⇒ Object Also known as: reactions
Reactions described in the REACTION lines.
- Returns
-
Hash of reaction ID and its definition
187 188 189 190 191 192 |
# File 'lib/bio/db/kegg/pathway.rb', line 187 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_strings ⇒ Object
Reactions described in the REACTION lines.
- Returns
-
Array containing String
180 181 182 |
# File 'lib/bio/db/kegg/pathway.rb', line 180 def reactions_as_strings lines_fetch('REACTION') end |
#references ⇒ Object
REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.
- Returns
-
an Array containing Bio::Reference objects
55 |
# File 'lib/bio/db/kegg/pathway.rb', line 55 def references; super; end |
#rel_pathways_as_hash ⇒ Object 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
224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/bio/db/kegg/pathway.rb', line 224 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_strings ⇒ Object
Returns REL_PATHWAY field of the entry.
- Returns
-
Array containing String objects
216 217 218 |
# File 'lib/bio/db/kegg/pathway.rb', line 216 def rel_pathways_as_strings lines_fetch('REL_PATHWAY') end |