Class: Bio::KEGG::DRUG

Inherits:
Bio::KEGGDB show all
Includes:
Common::DblinksAsHash, Common::PathwaysAsHash
Defined in:
lib/bio/db/kegg/drug.rb

Overview

Description

Bio::KEGG::DRUG is a parser class for the KEGG DRUG database entry. KEGG DRUG is a drug information database.

References

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

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


Arguments:

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

Returns

Bio::KEGG::DRUG object



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

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

Instance Method Details

#activityObject

Biological or chemical activity described in the ACTIVITY line.


Returns

String



87
88
89
# File 'lib/bio/db/kegg/drug.rb', line 87

def activity
  field_fetch('ACTIVITY')
end

#commentObject

COMMENT lines.


Returns

String



123
124
125
# File 'lib/bio/db/kegg/drug.rb', line 123

def comment
  field_fetch('COMMENT')
end

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



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

def dblinks_as_hash; super; end

List of database names and IDs, described in the DBLINKS lines.


Returns

Array containing String objects



109
110
111
# File 'lib/bio/db/kegg/drug.rb', line 109

def dblinks_as_strings
  lines_fetch('DBLINKS')
end

#entry_idObject

ID of the entry, described in the ENTRY line.


Returns

String



52
53
54
# File 'lib/bio/db/kegg/drug.rb', line 52

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

#formulaObject

Chemical formula described in the FORMULA line.


Returns

String



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

def formula
  field_fetch('FORMULA')
end

#kcfObject

ATOM, BOND lines.


Returns

String



116
117
118
# File 'lib/bio/db/kegg/drug.rb', line 116

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

#massObject

Molecular weight described in the MASS line.


Returns

Float



80
81
82
# File 'lib/bio/db/kegg/drug.rb', line 80

def mass
  field_fetch('MASS').to_f
end

#nameObject

The first name recorded in the NAME field.


Returns

String



66
67
68
# File 'lib/bio/db/kegg/drug.rb', line 66

def name
  names.first
end

#namesObject

Names described in the NAME line.


Returns

Array containing String objects



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

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

#pathways_as_hashObject Also known as: pathways

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



37
# File 'lib/bio/db/kegg/drug.rb', line 37

def pathways_as_hash; super; end

#pathways_as_stringsObject

List of KEGG Pathway IDs with short descriptions, described in the PATHWAY lines.


Returns

Array containing String objects



102
103
104
# File 'lib/bio/db/kegg/drug.rb', line 102

def pathways_as_strings
  lines_fetch('PATHWAY') 
end

#productsObject

Product names described in the PRODUCTS lines.


Returns

Array containing String objects



130
131
132
# File 'lib/bio/db/kegg/drug.rb', line 130

def products
  lines_fetch('PRODUCTS')
end

#remarkObject

REMARK lines.


Returns

String



94
95
96
# File 'lib/bio/db/kegg/drug.rb', line 94

def remark
  field_fetch('REMARK')
end