Class: Bio::KEGG::DRUG
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::DRUG
- 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
-
#activity ⇒ Object
Biological or chemical activity described in the ACTIVITY line.
-
#comment ⇒ Object
COMMENT lines.
-
#dblinks_as_hash ⇒ Object
(also: #dblinks)
Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.
-
#dblinks_as_strings ⇒ Object
List of database names and IDs, described in the DBLINKS lines.
-
#entry_id ⇒ Object
ID of the entry, described in the ENTRY line.
-
#formula ⇒ Object
Chemical formula described in the FORMULA line.
-
#initialize(entry) ⇒ DRUG
constructor
Creates a new Bio::KEGG::DRUG object.
-
#kcf ⇒ Object
ATOM, BOND lines.
-
#mass ⇒ Object
Molecular weight described in the MASS line.
-
#name ⇒ Object
The first name recorded in the NAME field.
-
#names ⇒ Object
Names described in the NAME line.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Returns a Hash of the pathway ID and name in PATHWAY field.
-
#pathways_as_strings ⇒ Object
List of KEGG Pathway IDs with short descriptions, described in the PATHWAY lines.
-
#products ⇒ Object
Product names described in the PRODUCTS lines.
-
#remark ⇒ Object
REMARK lines.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#activity ⇒ Object
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 |
#comment ⇒ Object
COMMENT lines.
- Returns
-
String
123 124 125 |
# File 'lib/bio/db/kegg/drug.rb', line 123 def comment field_fetch('COMMENT') end |
#dblinks_as_hash ⇒ Object Also known as: dblinks
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 |
#dblinks_as_strings ⇒ Object
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_id ⇒ Object
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 |
#formula ⇒ Object
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 |
#kcf ⇒ Object
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 |
#mass ⇒ Object
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 |
#name ⇒ Object
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 |
#names ⇒ Object
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_hash ⇒ Object 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_strings ⇒ Object
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 |
#products ⇒ Object
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 |
#remark ⇒ Object
REMARK lines.
- Returns
-
String
94 95 96 |
# File 'lib/bio/db/kegg/drug.rb', line 94 def remark field_fetch('REMARK') end |