Class | Bio::KEGG::MODULE
In: | lib/bio/db/kegg/module.rb
Parent: | KEGGDB

## Description

Bio::KEGG::MODULE is a parser class for the KEGG MODULE database entry.

## References

- www.kegg.jp/kegg-bin/get_htext?ko00002.keg
- ftp.genome.jp/pub/kegg/pathway/module

### Methods

compounds compounds_as_hash compounds_as_strings definition entry_id keggclass name new orthologs orthologs_as_array orthologs_as_hash orthologs_as_strings pathways pathways_as_hash pathways_as_strings reactions reactions_as_hash reactions_as_strings

### Included Modules

Common::StringsAsHash

### Constants

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

### Public Class methods

new(entry)

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

Arguments:

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

Returns: | Bio::KEGG::MODULE object

[Source]

        # File lib/bio/db/kegg/module.rb, line 41
    41:   def initialize(entry)
    42:     super(entry, TAGSIZE)
    43:   end

### Public Instance methods

compounds()

Alias for compounds_as_hash

compounds_as_hash()

Compounds described in the COMPOUND lines.

Returns: | Hash of compound ID and its definition

[Source]

         # File lib/bio/db/kegg/module.rb, line 147
    147:   def compounds_as_hash
    148:     unless @compounds_as_hash
    149:       @compounds_as_hash = strings_as_hash(compounds_as_strings)
    150:     end
    151:     @compounds_as_hash
    152:   end

compounds_as_strings()

Compounds described in the COMPOUND lines.

Returns: | Array containing String

[Source]

         # File lib/bio/db/kegg/module.rb, line 140
    140:   def compounds_as_strings
    141:     lines_fetch('COMPOUND')
    142:   end

definition()

Definition of the module, described in the DEFINITION line.

Returns: | String

[Source]

        # File lib/bio/db/kegg/module.rb, line 62
    62:   def definition
    63:     field_fetch('DEFINITION')
    64:   end

entry_id()

Return the ID, described in the ENTRY line.

Returns: | String

[Source]

        # File lib/bio/db/kegg/module.rb, line 48
    48:   def entry_id
    49:     field_fetch('ENTRY')[/\S+/]
    50:   end

keggclass()

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

Returns: | String

[Source]

        # File lib/bio/db/kegg/module.rb, line 69
    69:   def keggclass
    70:     field_fetch('CLASS')
    71:   end

name()

Name of the module, described in the NAME line.

Returns: | String

[Source]

        # File lib/bio/db/kegg/module.rb, line 55
    55:   def name
    56:     field_fetch('NAME')
    57:   end

orthologs()

Alias for orthologs_as_hash

orthologs_as_array()

All KO IDs in the ORTHOLOGY lines.

Returns: | Array of orthology IDs

[Source]

         # File lib/bio/db/kegg/module.rb, line 113
    113:   def orthologs_as_array
    114:     orthologs_as_hash.keys.map{|x| x.split(/\+|\-|,/)}.flatten.sort.uniq
    115:   end

orthologs_as_hash()

Orthologs described in the ORTHOLOGY lines.

Returns: | Hash of orthology ID and its definition

[Source]

         # File lib/bio/db/kegg/module.rb, line 102
    102:   def orthologs_as_hash
    103:     unless @orthologs_as_hash
    104:       @orthologs_as_hash = strings_as_hash(orthologs_as_strings)
    105:     end
    106:     @orthologs_as_hash
    107:   end

orthologs_as_strings()

Orthologs described in the ORTHOLOGY lines.

Returns: | Array containing String

[Source]

        # File lib/bio/db/kegg/module.rb, line 95
    95:   def orthologs_as_strings
    96:     lines_fetch('ORTHOLOGY')
    97:   end

pathways()

Alias for pathways_as_hash

pathways_as_hash()

Pathways described in the PATHWAY lines.

Returns: | Hash of pathway ID and its definition

[Source]

        # File lib/bio/db/kegg/module.rb, line 83
    83:   def pathways_as_hash
    84:     unless @pathways_as_hash
    85:       @pathways_as_hash = strings_as_hash(pathways_as_strings)
    86:     end
    87:     @pathways_as_hash
    88:   end

pathways_as_strings()

Pathways described in the PATHWAY lines.

Returns: | Array containing String

[Source]

        # File lib/bio/db/kegg/module.rb, line 76
    76:   def pathways_as_strings
    77:     lines_fetch('PATHWAY')
    78:   end

reactions()

Alias for reactions_as_hash

reactions_as_hash()

Reactions described in the REACTION lines.

Returns: | Hash of reaction ID and its definition

[Source]

         # File lib/bio/db/kegg/module.rb, line 128
    128:   def reactions_as_hash
    129:     unless @reactions_as_hash
    130:       @reactions_as_hash = strings_as_hash(reactions_as_strings)
    131:     end
    132:     @reactions_as_hash
    133:   end

reactions_as_strings()

Reactions described in the REACTION lines.

Returns: | Array containing String

[Source]

         # File lib/bio/db/kegg/module.rb, line 121
    121:   def reactions_as_strings
    122:     lines_fetch('REACTION')
    123:   end

[Validate]