Class: Bio::KEGG::COMPOUND
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::COMPOUND
- Includes:
- Bio::KEGG::Common::DblinksAsHash, Bio::KEGG::Common::PathwaysAsHash
- 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
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary (collapse)
-
- (Object) comment
COMMENT.
- - (Object) dblinks_as_hash (also: #dblinks)
-
- (Object) dblinks_as_strings
DBLINKS.
-
- (Object) entry_id
ENTRY.
-
- (Object) enzymes
ENZYME.
-
- (Object) formula
FORMULA.
-
- (Object) glycans
GLYCAN.
-
- (COMPOUND) initialize(entry)
constructor
Creates a new Bio::KEGG::COMPOUND object.
-
- (Object) kcf
ATOM, BOND.
-
- (Object) mass
MASS.
-
- (Object) name
The first name recorded in the NAME field.
-
- (Object) names
NAME.
- - (Object) pathways_as_hash (also: #pathways)
-
- (Object) pathways_as_strings
PATHWAY.
-
- (Object) reactions
REACTION.
-
- (Object) remark
REMARK.
-
- (Object) rpairs
RPAIR.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
- (COMPOUND) initialize(entry)
Creates a new Bio::KEGG::COMPOUND object.
Arguments:
-
(required) entry: (String) single entry as a string
Returns |
Bio::KEGG::COMPOUND object |
45 46 47 |
# File 'lib/bio/db/kegg/compound.rb', line 45 def initialize(entry) super(entry, TAGSIZE) end |
Instance Method Details
- (Object) comment
COMMENT
132 133 134 |
# File 'lib/bio/db/kegg/compound.rb', line 132 def comment field_fetch('COMMENT') end |
- (Object) dblinks_as_hash Also known as: dblinks
32 |
# File 'lib/bio/db/kegg/compound.rb', line 32 def dblinks_as_hash; super; end |
- (Object) dblinks_as_strings
DBLINKS
122 123 124 |
# File 'lib/bio/db/kegg/compound.rb', line 122 def dblinks_as_strings lines_fetch('DBLINKS') end |
- (Object) entry_id
ENTRY
50 51 52 |
# File 'lib/bio/db/kegg/compound.rb', line 50 def entry_id field_fetch('ENTRY')[/\S+/] end |
- (Object) enzymes
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 |
- (Object) formula
FORMULA
65 66 67 |
# File 'lib/bio/db/kegg/compound.rb', line 65 def formula field_fetch('FORMULA') end |
- (Object) glycans
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 |
- (Object) kcf
ATOM, BOND
127 128 129 |
# File 'lib/bio/db/kegg/compound.rb', line 127 def kcf return "#{get('ATOM')}#{get('BOND')}" end |
- (Object) mass
MASS
70 71 72 |
# File 'lib/bio/db/kegg/compound.rb', line 70 def mass field_fetch('MASS').to_f end |
- (Object) name
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 |
- (Object) names
NAME
55 56 57 |
# File 'lib/bio/db/kegg/compound.rb', line 55 def names field_fetch('NAME').split(/\s*;\s*/) end |
- (Object) pathways_as_hash Also known as: pathways
37 |
# File 'lib/bio/db/kegg/compound.rb', line 37 def pathways_as_hash; super; end |
- (Object) pathways_as_strings
PATHWAY
104 105 106 |
# File 'lib/bio/db/kegg/compound.rb', line 104 def pathways_as_strings lines_fetch('PATHWAY') end |
- (Object) reactions
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 |
- (Object) remark
REMARK
75 76 77 |
# File 'lib/bio/db/kegg/compound.rb', line 75 def remark field_fetch('REMARK') end |
- (Object) rpairs
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 |