Class: Bio::KEGG::ORTHOLOGY
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::ORTHOLOGY
- Includes:
- Common::DblinksAsHash, Common::GenesAsHash, Common::ModulesAsHash, Common::PathwaysAsHash, Common::References
- Defined in:
- lib/bio/db/kegg/orthology.rb
Overview
Description
KO (KEGG Orthology) entry parser.
References
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#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
Returns an Array of a database name and entry IDs in DBLINKS field.
-
#definition ⇒ Object
Returns DEFINITION field of the entry.
-
#entry_id ⇒ Object
Returns ID of the entry.
-
#genes_as_hash ⇒ Object
(also: #genes)
Returns a Hash of the organism ID and an Array of entry IDs in GENES field.
-
#genes_as_strings ⇒ Object
Returns an Array of the organism ID and entry IDs in GENES field.
-
#initialize(entry) ⇒ ORTHOLOGY
constructor
Reads a flat file format entry of the KO database.
-
#keggclass ⇒ Object
Returns CLASS field of the entry.
-
#keggclasses ⇒ Object
Returns an Array of biological classes in CLASS field.
-
#modules_as_hash ⇒ Object
(also: #modules)
Returns MODULE field as a Hash.
-
#modules_as_strings ⇒ Object
Returns MODULE field of the entry.
-
#name ⇒ Object
Returns NAME field of the entry.
-
#names ⇒ Object
Returns an Array of names in NAME field.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Returns a Hash of the pathway ID and name in PATHWAY field.
-
#pathways_as_strings ⇒ Object
Pathways described in the PATHWAY field.
-
#pathways_in_keggclass ⇒ Object
OBSOLETE Do not use this method.
-
#references ⇒ Object
REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#dblinks_as_hash ⇒ Object Also known as: dblinks
Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.
33 |
# File 'lib/bio/db/kegg/orthology.rb', line 33 def dblinks_as_hash; super; end |
#dblinks_as_strings ⇒ Object
Returns an Array of a database name and entry IDs in DBLINKS field.
121 122 123 |
# File 'lib/bio/db/kegg/orthology.rb', line 121 def dblinks_as_strings lines_fetch('DBLINKS') end |
#definition ⇒ Object
Returns DEFINITION field of the entry.
83 84 85 |
# File 'lib/bio/db/kegg/orthology.rb', line 83 def definition field_fetch('DEFINITION') end |
#entry_id ⇒ Object
Returns ID of the entry.
68 69 70 |
# File 'lib/bio/db/kegg/orthology.rb', line 68 def entry_id field_fetch('ENTRY')[/\S+/] end |
#genes_as_hash ⇒ Object Also known as: genes
Returns a Hash of the organism ID and an Array of entry IDs in GENES field.
38 |
# File 'lib/bio/db/kegg/orthology.rb', line 38 def genes_as_hash; super; end |
#genes_as_strings ⇒ Object
Returns an Array of the organism ID and entry IDs in GENES field.
126 127 128 |
# File 'lib/bio/db/kegg/orthology.rb', line 126 def genes_as_strings lines_fetch('GENES') end |
#keggclass ⇒ Object
Returns CLASS field of the entry.
88 89 90 |
# File 'lib/bio/db/kegg/orthology.rb', line 88 def keggclass field_fetch('CLASS') end |
#keggclasses ⇒ Object
Returns an Array of biological classes in CLASS field.
93 94 95 |
# File 'lib/bio/db/kegg/orthology.rb', line 93 def keggclasses keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/) end |
#modules_as_hash ⇒ Object Also known as: modules
Returns MODULE field as a Hash. Each key of the hash is KEGG MODULE ID, and each value is the name of the Pathway Module.
- Returns
-
Hash
52 |
# File 'lib/bio/db/kegg/orthology.rb', line 52 def modules_as_hash; super; end |
#modules_as_strings ⇒ Object
Returns MODULE field of the entry.
- Returns
-
Array containing String objects
116 117 118 |
# File 'lib/bio/db/kegg/orthology.rb', line 116 def modules_as_strings lines_fetch('MODULE') end |
#name ⇒ Object
Returns NAME field of the entry.
73 74 75 |
# File 'lib/bio/db/kegg/orthology.rb', line 73 def name field_fetch('NAME') end |
#names ⇒ Object
Returns an Array of names in NAME field.
78 79 80 |
# File 'lib/bio/db/kegg/orthology.rb', line 78 def names name.split(', ') end |
#pathways_as_hash ⇒ Object Also known as: pathways
Returns a Hash of the pathway ID and name in PATHWAY field.
43 |
# File 'lib/bio/db/kegg/orthology.rb', line 43 def pathways_as_hash; super; end |
#pathways_as_strings ⇒ Object
Pathways described in the PATHWAY field.
- Returns
-
Array containing String
100 101 102 |
# File 'lib/bio/db/kegg/orthology.rb', line 100 def pathways_as_strings lines_fetch('PATHWAY') end |
#pathways_in_keggclass ⇒ Object
OBSOLETE Do not use this method. Because KEGG ORTHOLOGY format is changed and PATHWAY field is added, older “pathways” method is renamed and remain only for compatibility.
Returns an Array of KEGG/PATHWAY ID in CLASS field.
109 110 111 |
# File 'lib/bio/db/kegg/orthology.rb', line 109 def pathways_in_keggclass keggclass.scan(/\[PATH:(.*?)\]/).flatten end |
#references ⇒ Object
REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.
- Returns
-
an Array containing Bio::Reference objects
60 |
# File 'lib/bio/db/kegg/orthology.rb', line 60 def references; super; end |