class Bio::KEGG::COMPOUND

Description

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

References

Constants

DELIMITER
TAGSIZE

Public Class Methods

new(entry) click to toggle source

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


Arguments:

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

Returns

Bio::KEGG::COMPOUND object

Calls superclass method Bio::NCBIDB.new
# File lib/bio/db/kegg/compound.rb, line 45
def initialize(entry)
  super(entry, TAGSIZE)
end

Public Instance Methods

comment() click to toggle source

COMMENT

# File lib/bio/db/kegg/compound.rb, line 132
def comment
  field_fetch('COMMENT')
end
entry_id() click to toggle source

ENTRY

# File lib/bio/db/kegg/compound.rb, line 50
def entry_id
  field_fetch('ENTRY')[/\S+/]
end
enzymes() click to toggle source

ENZYME

# 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() click to toggle source

FORMULA

# File lib/bio/db/kegg/compound.rb, line 65
def formula
  field_fetch('FORMULA')
end
glycans() click to toggle source

GLYCAN

# 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() click to toggle source

ATOM, BOND

# File lib/bio/db/kegg/compound.rb, line 127
def kcf
  return "#{get('ATOM')}#{get('BOND')}"
end
mass() click to toggle source

MASS

# File lib/bio/db/kegg/compound.rb, line 70
def mass
  field_fetch('MASS').to_f
end
name() click to toggle source

The first name recorded in the NAME field.

# File lib/bio/db/kegg/compound.rb, line 60
def name
  names.first
end
names() click to toggle source

NAME

# File lib/bio/db/kegg/compound.rb, line 55
def names
  field_fetch('NAME').split(/\s*;\s*/)
end
pathways()
Alias for: pathways_as_hash
pathways_as_hash() click to toggle source

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

# File lib/bio/db/kegg/compound.rb, line 37
def pathways_as_hash; super; end
Also aliased as: pathways
pathways_as_strings() click to toggle source

PATHWAY

# File lib/bio/db/kegg/compound.rb, line 104
def pathways_as_strings
  lines_fetch('PATHWAY') 
end
reactions() click to toggle source

REACTION

# 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() click to toggle source

REMARK

# File lib/bio/db/kegg/compound.rb, line 75
def remark
  field_fetch('REMARK')
end
rpairs() click to toggle source

RPAIR

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