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.
-
#remark ⇒ Object
REMARK.
-
#rpairs ⇒ Object
RPAIR.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#comment ⇒ Object
COMMENT
106 107 108 |
# File 'lib/bio/db/kegg/compound.rb', line 106 def comment field_fetch('COMMENT') end |
#dblinks ⇒ Object
DBLINKS
96 97 98 |
# File 'lib/bio/db/kegg/compound.rb', line 96 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
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/bio/db/kegg/compound.rb', line 83 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
54 55 56 57 58 59 |
# File 'lib/bio/db/kegg/compound.rb', line 54 def glycans unless @data['GLYCAN'] @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/) end @data['GLYCAN'] end |
#kcf ⇒ Object
ATOM, BOND
101 102 103 |
# File 'lib/bio/db/kegg/compound.rb', line 101 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
78 79 80 |
# File 'lib/bio/db/kegg/compound.rb', line 78 def pathways lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
62 63 64 65 66 67 |
# File 'lib/bio/db/kegg/compound.rb', line 62 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#remark ⇒ Object
REMARK
49 50 51 |
# File 'lib/bio/db/kegg/compound.rb', line 49 def remark field_fetch('REMARK') end |
#rpairs ⇒ Object
RPAIR
70 71 72 73 74 75 |
# File 'lib/bio/db/kegg/compound.rb', line 70 def rpairs unless @data['RPAIR'] @data['RPAIR'] = fetch('RPAIR').split(/\s+/) end @data['RPAIR'] end |