Class: Bio::KEGG::COMPOUND
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::COMPOUND
- Defined in:
- lib/bio/db/kegg/compound.rb
Overview
Description
Bio::KEGG::COMPOUND is a parser class for the KEGG COMPOUND database entry. KEGG COMPOUND is a chemical structure database.
References
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#comment ⇒ Object
COMMENT.
-
#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
DBLINKS.
-
#entry_id ⇒ Object
ENTRY.
-
#enzymes ⇒ Object
ENZYME.
-
#formula ⇒ Object
FORMULA.
-
#glycans ⇒ Object
GLYCAN.
-
#initialize(entry) ⇒ COMPOUND
constructor
Creates a new Bio::KEGG::COMPOUND object.
-
#kcf ⇒ Object
ATOM, BOND.
-
#mass ⇒ Object
MASS.
-
#name ⇒ Object
The first name recorded in the NAME field.
-
#names ⇒ Object
NAME.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Returns a Hash of the pathway ID and name in PATHWAY field.
-
#pathways_as_strings ⇒ Object
PATHWAY.
-
#reactions ⇒ Object
REACTION.
-
#remark ⇒ Object
REMARK.
-
#rpairs ⇒ Object
RPAIR.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#comment ⇒ Object
COMMENT
132 133 134 |
# File 'lib/bio/db/kegg/compound.rb', line 132 def comment field_fetch('COMMENT') 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/compound.rb', line 32 def dblinks_as_hash; super; end |
#dblinks_as_strings ⇒ Object
DBLINKS
122 123 124 |
# File 'lib/bio/db/kegg/compound.rb', line 122 def dblinks_as_strings lines_fetch('DBLINKS') end |
#entry_id ⇒ Object
ENTRY
50 51 52 |
# File 'lib/bio/db/kegg/compound.rb', line 50 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes ⇒ Object
ENZYME
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/bio/db/kegg/compound.rb', line 109 def enzymes unless @data['ENZYME'] field = fetch('ENZYME') if /\(/.match(field) # old version @data['ENZYME'] = field.scan(/\S+ \(\S+\)/) else @data['ENZYME'] = field.scan(/\S+/) end end @data['ENZYME'] end |
#formula ⇒ Object
FORMULA
65 66 67 |
# File 'lib/bio/db/kegg/compound.rb', line 65 def formula field_fetch('FORMULA') end |
#glycans ⇒ Object
GLYCAN
80 81 82 83 84 85 |
# File 'lib/bio/db/kegg/compound.rb', line 80 def glycans unless @data['GLYCAN'] @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/) end @data['GLYCAN'] end |
#kcf ⇒ Object
ATOM, BOND
127 128 129 |
# File 'lib/bio/db/kegg/compound.rb', line 127 def kcf return "#{get('ATOM')}#{get('BOND')}" end |
#mass ⇒ Object
MASS
70 71 72 |
# File 'lib/bio/db/kegg/compound.rb', line 70 def mass field_fetch('MASS').to_f end |
#name ⇒ Object
The first name recorded in the NAME field.
60 61 62 |
# File 'lib/bio/db/kegg/compound.rb', line 60 def name names.first end |
#names ⇒ Object
NAME
55 56 57 |
# File 'lib/bio/db/kegg/compound.rb', line 55 def names field_fetch('NAME').split(/\s*;\s*/) 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/compound.rb', line 37 def pathways_as_hash; super; end |
#pathways_as_strings ⇒ Object
PATHWAY
104 105 106 |
# File 'lib/bio/db/kegg/compound.rb', line 104 def pathways_as_strings lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
88 89 90 91 92 93 |
# File 'lib/bio/db/kegg/compound.rb', line 88 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#remark ⇒ Object
REMARK
75 76 77 |
# File 'lib/bio/db/kegg/compound.rb', line 75 def remark field_fetch('REMARK') end |
#rpairs ⇒ Object
RPAIR
96 97 98 99 100 101 |
# File 'lib/bio/db/kegg/compound.rb', line 96 def rpairs unless @data['RPAIR'] @data['RPAIR'] = fetch('RPAIR').split(/\s+/) end @data['RPAIR'] end |