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

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

Instance Method Summary (collapse)

Methods inherited from DB

#exists?, #fetch, #get, open, #tags

Constructor Details

- (DRUG) initialize(entry)

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

- (Object) activity

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

- (Object) comment

COMMENT lines.


Returns

String



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

def comment
  field_fetch('COMMENT')
end


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

- (Object) entry_id

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

- (Object) formula

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

- (Object) kcf

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

- (Object) mass

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

- (Object) name

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

- (Object) names

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

- (Object) pathways_as_hash Also known as: pathways



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

def pathways_as_hash; super; end

- (Object) pathways_as_strings

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

- (Object) products

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

- (Object) remark

REMARK lines.


Returns

String



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

def remark
  field_fetch('REMARK')
end