Class: Bio::KEGG::MODULE
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::MODULE
- Includes:
- Common::StringsAsHash
- Defined in:
- lib/bio/db/kegg/module.rb
Overview
Description
Bio::KEGG::MODULE is a parser class for the KEGG MODULE database entry.
References
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#compounds_as_hash ⇒ Object
(also: #compounds)
Compounds described in the COMPOUND lines.
-
#compounds_as_strings ⇒ Object
Compounds described in the COMPOUND lines.
-
#definition ⇒ Object
Definition of the module, described in the DEFINITION line.
-
#entry_id ⇒ Object
Return the ID, described in the ENTRY line.
-
#initialize(entry) ⇒ MODULE
constructor
Creates a new Bio::KEGG::MODULE object.
-
#keggclass ⇒ Object
Name of the KEGG class, described in the CLASS line.
-
#name ⇒ Object
Name of the module, described in the NAME line.
-
#orthologs_as_array ⇒ Object
All KO IDs in the ORTHOLOGY lines.
-
#orthologs_as_hash ⇒ Object
(also: #orthologs)
Orthologs described in the ORTHOLOGY lines.
-
#orthologs_as_strings ⇒ Object
Orthologs described in the ORTHOLOGY lines.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Pathways described in the PATHWAY lines.
-
#pathways_as_strings ⇒ Object
Pathways described in the PATHWAY lines.
-
#reactions_as_hash ⇒ Object
(also: #reactions)
Reactions described in the REACTION lines.
-
#reactions_as_strings ⇒ Object
Reactions described in the REACTION lines.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#compounds_as_hash ⇒ Object Also known as: compounds
Compounds described in the COMPOUND lines.
- Returns
-
Hash of compound ID and its definition
146 147 148 149 150 151 |
# File 'lib/bio/db/kegg/module.rb', line 146 def compounds_as_hash unless (defined? @compounds_as_hash) && @compounds_as_hash @compounds_as_hash = strings_as_hash(compounds_as_strings) end @compounds_as_hash end |
#compounds_as_strings ⇒ Object
Compounds described in the COMPOUND lines.
- Returns
-
Array containing String
139 140 141 |
# File 'lib/bio/db/kegg/module.rb', line 139 def compounds_as_strings lines_fetch('COMPOUND') end |
#definition ⇒ Object
Definition of the module, described in the DEFINITION line.
- Returns
-
String
61 62 63 |
# File 'lib/bio/db/kegg/module.rb', line 61 def definition field_fetch('DEFINITION') end |
#entry_id ⇒ Object
Return the ID, described in the ENTRY line.
- Returns
-
String
47 48 49 |
# File 'lib/bio/db/kegg/module.rb', line 47 def entry_id field_fetch('ENTRY')[/\S+/] end |
#keggclass ⇒ Object
Name of the KEGG class, described in the CLASS line.
- Returns
-
String
68 69 70 |
# File 'lib/bio/db/kegg/module.rb', line 68 def keggclass field_fetch('CLASS') end |
#name ⇒ Object
Name of the module, described in the NAME line.
- Returns
-
String
54 55 56 |
# File 'lib/bio/db/kegg/module.rb', line 54 def name field_fetch('NAME') end |
#orthologs_as_array ⇒ Object
All KO IDs in the ORTHOLOGY lines.
- Returns
-
Array of orthology IDs
112 113 114 |
# File 'lib/bio/db/kegg/module.rb', line 112 def orthologs_as_array orthologs_as_hash.keys.map{|x| x.split(/\+|\-|,/)}.flatten.sort.uniq end |
#orthologs_as_hash ⇒ Object Also known as: orthologs
Orthologs described in the ORTHOLOGY lines.
- Returns
-
Hash of orthology ID and its definition
101 102 103 104 105 106 |
# File 'lib/bio/db/kegg/module.rb', line 101 def orthologs_as_hash unless (defined? @orthologs_as_hash) && @orthologs_as_hash @orthologs_as_hash = strings_as_hash(orthologs_as_strings) end @orthologs_as_hash end |
#orthologs_as_strings ⇒ Object
Orthologs described in the ORTHOLOGY lines.
- Returns
-
Array containing String
94 95 96 |
# File 'lib/bio/db/kegg/module.rb', line 94 def orthologs_as_strings lines_fetch('ORTHOLOGY') end |
#pathways_as_hash ⇒ Object Also known as: pathways
Pathways described in the PATHWAY lines.
- Returns
-
Hash of pathway ID and its definition
82 83 84 85 86 87 |
# File 'lib/bio/db/kegg/module.rb', line 82 def pathways_as_hash unless (defined? @pathways_as_hash) && @pathways_as_hash @pathways_as_hash = strings_as_hash(pathways_as_strings) end @pathways_as_hash end |
#pathways_as_strings ⇒ Object
Pathways described in the PATHWAY lines.
- Returns
-
Array containing String
75 76 77 |
# File 'lib/bio/db/kegg/module.rb', line 75 def pathways_as_strings lines_fetch('PATHWAY') end |
#reactions_as_hash ⇒ Object Also known as: reactions
Reactions described in the REACTION lines.
- Returns
-
Hash of reaction ID and its definition
127 128 129 130 131 132 |
# File 'lib/bio/db/kegg/module.rb', line 127 def reactions_as_hash unless (defined? @reactions_as_hash) && @reactions_as_hash @reactions_as_hash = strings_as_hash(reactions_as_strings) end @reactions_as_hash end |
#reactions_as_strings ⇒ Object
Reactions described in the REACTION lines.
- Returns
-
Array containing String
120 121 122 |
# File 'lib/bio/db/kegg/module.rb', line 120 def reactions_as_strings lines_fetch('REACTION') end |