Class: Bio::KEGG::COMPOUND
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::COMPOUND
- Defined in:
- lib/bio/db/kegg/compound.rb
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#comment ⇒ Object
COMMENT.
-
#dblinks ⇒ Object
DBLINKS.
-
#entry_id ⇒ Object
ENTRY.
-
#enzymes ⇒ Object
ENZYME.
-
#formula ⇒ Object
FORMULA.
-
#glycans ⇒ Object
GLYCAN.
-
#initialize(entry) ⇒ COMPOUND
constructor
A new instance of COMPOUND.
-
#kcf ⇒ Object
ATOM, BOND.
-
#mass ⇒ Object
MASS.
- #name ⇒ Object
-
#names ⇒ Object
NAME.
-
#pathways ⇒ Object
PATHWAY.
-
#reactions ⇒ Object
REACTION.
-
#rpairs ⇒ Object
RPAIR.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
#initialize(entry) ⇒ COMPOUND
Returns a new instance of COMPOUND.
20 21 22 |
# File 'lib/bio/db/kegg/compound.rb', line 20 def initialize(entry) super(entry, TAGSIZE) end |
Instance Method Details
#comment ⇒ Object
COMMENT
101 102 103 |
# File 'lib/bio/db/kegg/compound.rb', line 101 def comment field_fetch('COMMENT') end |
#dblinks ⇒ Object
DBLINKS
91 92 93 |
# File 'lib/bio/db/kegg/compound.rb', line 91 def dblinks lines_fetch('DBLINKS') end |
#entry_id ⇒ Object
ENTRY
25 26 27 |
# File 'lib/bio/db/kegg/compound.rb', line 25 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes ⇒ Object
ENZYME
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/bio/db/kegg/compound.rb', line 78 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
39 40 41 |
# File 'lib/bio/db/kegg/compound.rb', line 39 def formula field_fetch('FORMULA') end |
#glycans ⇒ Object
GLYCAN
49 50 51 52 53 54 |
# File 'lib/bio/db/kegg/compound.rb', line 49 def glycans unless @data['GLYCAN'] @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/) end @data['GLYCAN'] end |
#kcf ⇒ Object
ATOM, BOND
96 97 98 |
# File 'lib/bio/db/kegg/compound.rb', line 96 def kcf return "#{get('ATOM')}#{get('BOND')}" end |
#mass ⇒ Object
MASS
44 45 46 |
# File 'lib/bio/db/kegg/compound.rb', line 44 def mass field_fetch('MASS').to_f end |
#name ⇒ Object
34 35 36 |
# File 'lib/bio/db/kegg/compound.rb', line 34 def name names.first end |
#names ⇒ Object
NAME
30 31 32 |
# File 'lib/bio/db/kegg/compound.rb', line 30 def names field_fetch('NAME').split(/\s*;\s*/) end |
#pathways ⇒ Object
PATHWAY
73 74 75 |
# File 'lib/bio/db/kegg/compound.rb', line 73 def pathways lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
57 58 59 60 61 62 |
# File 'lib/bio/db/kegg/compound.rb', line 57 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#rpairs ⇒ Object
RPAIR
65 66 67 68 69 70 |
# File 'lib/bio/db/kegg/compound.rb', line 65 def rpairs unless @data['RPAIR'] @data['RPAIR'] = fetch('RPAIR').split(/\s+/) end @data['RPAIR'] end |