Class | Bio::KEGG::COMPOUND
In: | lib/bio/db/kegg/compound.rb
Parent: | KEGGDB

## Description

Bio::KEGG::COMPOUND is a parser class for the KEGG COMPOUND database entry. KEGG COMPOUND is a chemical structure database.

## References

- www.genome.jp/kegg/compound/

### Methods

comment dblinks dblinks_as_hash dblinks_as_strings entry_id enzymes formula glycans kcf mass name names new pathways pathways_as_hash pathways_as_strings reactions remark rpairs

### Included Modules

Common::DblinksAsHash Common::PathwaysAsHash

### Constants

DELIMITER | = | RS = "\n///\n"
TAGSIZE | = | 12

### Public Class methods

new(entry)

Creates a new Bio::KEGG::COMPOUND object.

Arguments:

- (required) entry: (String) single entry as a string

Returns: | Bio::KEGG::COMPOUND object

[Source]

        # File lib/bio/db/kegg/compound.rb, line 45
    45:   def initialize(entry)
    46:     super(entry, TAGSIZE)
    47:   end

### Public Instance methods

comment()

COMMENT

[Source]

         # File lib/bio/db/kegg/compound.rb, line 132
    132:   def comment
    133:     field_fetch('COMMENT')
    134:   end

dblinks()

Alias for dblinks_as_hash

dblinks_as_hash()

Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.

[Source]

        # File lib/bio/db/kegg/compound.rb, line 32
    32:   def dblinks_as_hash; super; end

dblinks_as_strings()

DBLINKS

[Source]

         # File lib/bio/db/kegg/compound.rb, line 122
    122:   def dblinks_as_strings
    123:     lines_fetch('DBLINKS')
    124:   end

entry_id()

ENTRY

[Source]

        # File lib/bio/db/kegg/compound.rb, line 50
    50:   def entry_id
    51:     field_fetch('ENTRY')[/\S+/]
    52:   end

enzymes()

ENZYME

[Source]

         # File lib/bio/db/kegg/compound.rb, line 109
    109:   def enzymes
    110:     unless @data['ENZYME']
    111:       field = fetch('ENZYME')
    112:       if /\(/.match(field)      # old version
    113:         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
    114:       else
    115:         @data['ENZYME'] = field.scan(/\S+/)
    116:       end
    117:     end
    118:     @data['ENZYME']
    119:   end

formula()

FORMULA

[Source]

        # File lib/bio/db/kegg/compound.rb, line 65
    65:   def formula
    66:     field_fetch('FORMULA')
    67:   end

glycans()

GLYCAN

[Source]

        # File lib/bio/db/kegg/compound.rb, line 80
    80:   def glycans
    81:     unless @data['GLYCAN']
    82:       @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/)
    83:     end
    84:     @data['GLYCAN']
    85:   end

kcf()

ATOM, BOND

[Source]

         # File lib/bio/db/kegg/compound.rb, line 127
    127:   def kcf
    128:     return "#{get('ATOM')}#{get('BOND')}"
    129:   end

mass()

MASS

[Source]

        # File lib/bio/db/kegg/compound.rb, line 70
    70:   def mass
    71:     field_fetch('MASS').to_f
    72:   end

name()

The first name recorded in the NAME field.

[Source]

        # File lib/bio/db/kegg/compound.rb, line 60
    60:   def name
    61:     names.first
    62:   end

names()

NAME

[Source]

        # File lib/bio/db/kegg/compound.rb, line 55
    55:   def names
    56:     field_fetch('NAME').split(/\s*;\s*/)
    57:   end

pathways()

Alias for pathways_as_hash

pathways_as_hash()

Returns a Hash of the pathway ID and name in PATHWAY field.

[Source]

        # File lib/bio/db/kegg/compound.rb, line 37
    37:   def pathways_as_hash; super; end

pathways_as_strings()

PATHWAY

[Source]

         # File lib/bio/db/kegg/compound.rb, line 104
    104:   def pathways_as_strings
    105:     lines_fetch('PATHWAY')
    106:   end

reactions()

REACTION

[Source]

        # File lib/bio/db/kegg/compound.rb, line 88
    88:   def reactions
    89:     unless @data['REACTION']
    90:       @data['REACTION'] = fetch('REACTION').split(/\s+/)
    91:     end
    92:     @data['REACTION']
    93:   end

remark()

REMARK

[Source]

        # File lib/bio/db/kegg/compound.rb, line 75
    75:   def remark
    76:     field_fetch('REMARK')
    77:   end

rpairs()

RPAIR

[Source]

         # File lib/bio/db/kegg/compound.rb, line 96
     96:   def rpairs
     97:     unless @data['RPAIR']
     98:       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
     99:     end
    100:     @data['RPAIR']
    101:   end

[Validate]