Class: Bio::KEGG::MODULE

Inherits:
Bio::KEGGDB show all
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

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

Instance Method Summary (collapse)

Methods inherited from DB

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

Constructor Details

- (MODULE) initialize(entry)

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


Arguments:

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

Returns

Bio::KEGG::MODULE object



41
42
43
# File 'lib/bio/db/kegg/module.rb', line 41

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

Instance Method Details

- (Object) compounds_as_hash Also known as: compounds

Compounds described in the COMPOUND lines.


Returns

Hash of compound ID and its definition



147
148
149
150
151
152
# File 'lib/bio/db/kegg/module.rb', line 147

def compounds_as_hash
  unless @compounds_as_hash
    @compounds_as_hash = strings_as_hash(compounds_as_strings)
  end
  @compounds_as_hash
end

- (Object) compounds_as_strings

Compounds described in the COMPOUND lines.


Returns

Array containing String



140
141
142
# File 'lib/bio/db/kegg/module.rb', line 140

def compounds_as_strings
  lines_fetch('COMPOUND')
end

- (Object) definition

Definition of the module, described in the DEFINITION line.


Returns

String



62
63
64
# File 'lib/bio/db/kegg/module.rb', line 62

def definition
  field_fetch('DEFINITION')
end

- (Object) entry_id

Return the ID, described in the ENTRY line.


Returns

String



48
49
50
# File 'lib/bio/db/kegg/module.rb', line 48

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

- (Object) keggclass

Name of the KEGG class, described in the CLASS line.


Returns

String



69
70
71
# File 'lib/bio/db/kegg/module.rb', line 69

def keggclass
  field_fetch('CLASS')
end

- (Object) name

Name of the module, described in the NAME line.


Returns

String



55
56
57
# File 'lib/bio/db/kegg/module.rb', line 55

def name
  field_fetch('NAME')
end

- (Object) orthologs_as_array

All KO IDs in the ORTHOLOGY lines.


Returns

Array of orthology IDs



113
114
115
# File 'lib/bio/db/kegg/module.rb', line 113

def orthologs_as_array
  orthologs_as_hash.keys.map{|x| x.split(/\+|\-|,/)}.flatten.sort.uniq
end

- (Object) orthologs_as_hash Also known as: orthologs

Orthologs described in the ORTHOLOGY lines.


Returns

Hash of orthology ID and its definition



102
103
104
105
106
107
# File 'lib/bio/db/kegg/module.rb', line 102

def orthologs_as_hash
  unless @orthologs_as_hash
    @orthologs_as_hash = strings_as_hash(orthologs_as_strings)
  end
  @orthologs_as_hash
end

- (Object) orthologs_as_strings

Orthologs described in the ORTHOLOGY lines.


Returns

Array containing String



95
96
97
# File 'lib/bio/db/kegg/module.rb', line 95

def orthologs_as_strings
  lines_fetch('ORTHOLOGY')
end

- (Object) pathways_as_hash Also known as: pathways

Pathways described in the PATHWAY lines.


Returns

Hash of pathway ID and its definition



83
84
85
86
87
88
# File 'lib/bio/db/kegg/module.rb', line 83

def pathways_as_hash
  unless @pathways_as_hash
    @pathways_as_hash = strings_as_hash(pathways_as_strings)
  end
  @pathways_as_hash
end

- (Object) pathways_as_strings

Pathways described in the PATHWAY lines.


Returns

Array containing String



76
77
78
# File 'lib/bio/db/kegg/module.rb', line 76

def pathways_as_strings
  lines_fetch('PATHWAY')
end

- (Object) reactions_as_hash Also known as: reactions

Reactions described in the REACTION lines.


Returns

Hash of reaction ID and its definition



128
129
130
131
132
133
# File 'lib/bio/db/kegg/module.rb', line 128

def reactions_as_hash
  unless @reactions_as_hash
    @reactions_as_hash = strings_as_hash(reactions_as_strings)
  end
  @reactions_as_hash
end

- (Object) reactions_as_strings

Reactions described in the REACTION lines.


Returns

Array containing String



121
122
123
# File 'lib/bio/db/kegg/module.rb', line 121

def reactions_as_strings
  lines_fetch('REACTION')
end