Class: Bio::KEGG::DRUG

Inherits:
Bio::KEGGDB show all
Defined in:
lib/bio/db/kegg/drug.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) ⇒ DRUG

Returns a new instance of DRUG.



20
21
22
# File 'lib/bio/db/kegg/drug.rb', line 20

def initialize(entry)
  super(entry, TAGSIZE)
end

Instance Method Details

#activityObject

ACTIVITY



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

def activity
  field_fetch('ACTIVITY')
end

#commentObject

COMMENT



59
60
61
# File 'lib/bio/db/kegg/drug.rb', line 59

def comment
  field_fetch('COMMENT')
end

DBLINKS



69
70
71
# File 'lib/bio/db/kegg/drug.rb', line 69

def dblinks
  lines_fetch('DBLINKS')
end

#entry_idObject

ENTRY



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

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

#formulaObject

FORMULA



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

def formula
  field_fetch('FORMULA')
end

#kcfObject

ATOM, BOND



74
75
76
# File 'lib/bio/db/kegg/drug.rb', line 74

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

#massObject

MASS



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

def mass
  field_fetch('MASS').to_f
end

#nameObject



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

def name
  names.first
end

#namesObject

NAME



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

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

#pathwaysObject

PATHWAY



64
65
66
# File 'lib/bio/db/kegg/drug.rb', line 64

def pathways
  lines_fetch('DBLINKS')
end

#remarkObject

REMARK



54
55
56
# File 'lib/bio/db/kegg/drug.rb', line 54

def remark
  field_fetch('REMARK')
end