Class: Bio::KEGG::COMPOUND

Inherits:
Bio::KEGGDB show all
Defined in:
lib/bio/db/kegg/compound.rb

Constant Summary collapse

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

Instance Method Summary collapse

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

#commentObject

COMMENT



106
107
108
# File 'lib/bio/db/kegg/compound.rb', line 106

def comment
  field_fetch('COMMENT')
end

DBLINKS



96
97
98
# File 'lib/bio/db/kegg/compound.rb', line 96

def dblinks
  lines_fetch('DBLINKS')
end

#entry_idObject

ENTRY



25
26
27
# File 'lib/bio/db/kegg/compound.rb', line 25

def entry_id
  field_fetch('ENTRY')[/\S+/]
end

#enzymesObject

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

#formulaObject

FORMULA



39
40
41
# File 'lib/bio/db/kegg/compound.rb', line 39

def formula
  field_fetch('FORMULA')
end

#glycansObject

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

#kcfObject

ATOM, BOND



101
102
103
# File 'lib/bio/db/kegg/compound.rb', line 101

def kcf
  return "#{get('ATOM')}#{get('BOND')}"
end

#massObject

MASS



44
45
46
# File 'lib/bio/db/kegg/compound.rb', line 44

def mass
  field_fetch('MASS').to_f
end

#nameObject



34
35
36
# File 'lib/bio/db/kegg/compound.rb', line 34

def name
  names.first
end

#namesObject

NAME



30
31
32
# File 'lib/bio/db/kegg/compound.rb', line 30

def names
  field_fetch('NAME').split(/\s*;\s*/)
end

#pathwaysObject

PATHWAY



78
79
80
# File 'lib/bio/db/kegg/compound.rb', line 78

def pathways
  lines_fetch('PATHWAY') 
end

#reactionsObject

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

#remarkObject

REMARK



49
50
51
# File 'lib/bio/db/kegg/compound.rb', line 49

def remark
  field_fetch('REMARK')
end

#rpairsObject

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