Class: Bio::KEGG::REACTION
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::REACTION
- Includes:
- Common::OrthologsAsHash, Common::PathwaysAsHash
- Defined in:
- lib/bio/db/kegg/reaction.rb
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#definition ⇒ Object
Definition of the reaction, described in the DEFINITION line.
-
#entry_id ⇒ Object
ID of the entry, described in the ENTRY line.
-
#enzymes ⇒ Object
Enzymes described in the ENZYME line.
-
#equation ⇒ Object
Chemical equation, described in the EQUATION line.
-
#initialize(entry) ⇒ REACTION
constructor
Creates a new Bio::KEGG::REACTION object.
-
#name ⇒ Object
Name of the reaction, described in the NAME 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
Pathway information, described in the PATHWAY lines.
-
#rpairs_as_hash ⇒ Object
(also: #rpairs)
KEGG RPAIR (ReactantPair) information, described in the RPAIR lines.
-
#rpairs_as_strings ⇒ Object
KEGG RPAIR (ReactantPair) information, described in the RPAIR lines.
-
#rpairs_as_tokens ⇒ Object
Returns the content of the RPAIR entry as tokens (RPair signature, RPair ID, , RPair type).
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#definition ⇒ Object
Definition of the reaction, described in the DEFINITION line.
- Returns
-
String
59 60 61 |
# File 'lib/bio/db/kegg/reaction.rb', line 59 def definition field_fetch('DEFINITION') end |
#entry_id ⇒ Object
ID of the entry, described in the ENTRY line.
- Returns
-
String
45 46 47 |
# File 'lib/bio/db/kegg/reaction.rb', line 45 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes ⇒ Object
Enzymes described in the ENZYME line.
- Returns
-
Array containing String
117 118 119 120 121 122 |
# File 'lib/bio/db/kegg/reaction.rb', line 117 def enzymes unless @data['ENZYME'] @data['ENZYME'] = fetch('ENZYME').scan(/\S+/) end @data['ENZYME'] end |
#equation ⇒ Object
Chemical equation, described in the EQUATION line.
- Returns
-
String
66 67 68 |
# File 'lib/bio/db/kegg/reaction.rb', line 66 def equation field_fetch('EQUATION') end |
#name ⇒ Object
Name of the reaction, described in the NAME line.
- Returns
-
String
52 53 54 |
# File 'lib/bio/db/kegg/reaction.rb', line 52 def name field_fetch('NAME') end |
#orthologs_as_hash ⇒ Object Also known as: orthologs
Returns a Hash of the orthology ID and definition in ORTHOLOGY field.
30 |
# File 'lib/bio/db/kegg/reaction.rb', line 30 def orthologs_as_hash; super; end |
#orthologs_as_strings ⇒ Object
Orthologs described in the ORTHOLOGY lines.
- Returns
-
Array containing String
127 128 129 |
# File 'lib/bio/db/kegg/reaction.rb', line 127 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.
25 |
# File 'lib/bio/db/kegg/reaction.rb', line 25 def pathways_as_hash; super; end |
#pathways_as_strings ⇒ Object
Pathway information, described in the PATHWAY lines.
- Returns
-
Array containing String
110 111 112 |
# File 'lib/bio/db/kegg/reaction.rb', line 110 def pathways_as_strings lines_fetch('PATHWAY') end |
#rpairs_as_hash ⇒ Object Also known as: rpairs
KEGG RPAIR (ReactantPair) information, described in the RPAIR lines. Returns a hash of RPair IDs and [ name, type ] informations, for example,
{ "RP12733" => [ "C00022_C00900", "trans" ],
"RP05698" => [ "C00011_C00022", "leave" ],
"RP00440" => [ "C00022_C00900", "main" ]
}
- Returns
-
Hash
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/bio/db/kegg/reaction.rb', line 85 def rpairs_as_hash unless defined? @rpairs_as_hash rps = {} rpairs_as_strings.each do |line| namespace, entry_id, name, rptype = line.split(/\s+/) rps[entry_id] = [ name, rptype ] end @rpairs_as_hash = rps end @rpairs_as_hash end |
#rpairs_as_strings ⇒ Object
KEGG RPAIR (ReactantPair) information, described in the RPAIR lines.
- Returns
-
Array containing String
73 74 75 |
# File 'lib/bio/db/kegg/reaction.rb', line 73 def rpairs_as_strings lines_fetch('RPAIR') end |
#rpairs_as_tokens ⇒ Object
Returns the content of the RPAIR entry as tokens (RPair signature, RPair ID, , RPair type).
- Returns
-
Array containing String
103 104 105 |
# File 'lib/bio/db/kegg/reaction.rb', line 103 def rpairs_as_tokens fetch('RPAIR').split(/\s+/) end |