Class: Bio::KEGG::REACTION

Inherits:
Bio::KEGGDB show all
Includes:
Common::OrthologsAsHash, Common::PathwaysAsHash
Defined in:
lib/bio/db/kegg/reaction.rb

Constant Summary

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

Instance Method Summary (collapse)

Methods inherited from DB

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

Constructor Details

- (REACTION) initialize(entry)

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


Arguments:

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

Returns

Bio::KEGG::REACTION object



38
39
40
# File 'lib/bio/db/kegg/reaction.rb', line 38

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

Instance Method Details

- (Object) definition

Definition of the reaction, described in the DEFINITION line.


Returns

String



59
60
61
# File 'lib/bio/db/kegg/reaction.rb', line 59

def definition
  field_fetch('DEFINITION')
end

- (Object) entry_id

ID of the entry, described in the ENTRY line.


Returns

String



45
46
47
# File 'lib/bio/db/kegg/reaction.rb', line 45

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

- (Object) enzymes

Enzymes described in the ENZYME line.


Returns

Array containing String



117
118
119
120
121
122
# File 'lib/bio/db/kegg/reaction.rb', line 117

def enzymes
  unless @data['ENZYME']
    @data['ENZYME'] = fetch('ENZYME').scan(/\S+/)
  end
  @data['ENZYME']
end

- (Object) equation

Chemical equation, described in the EQUATION line.


Returns

String



66
67
68
# File 'lib/bio/db/kegg/reaction.rb', line 66

def equation
  field_fetch('EQUATION')
end

- (Object) name

Name of the reaction, described in the NAME line.


Returns

String



52
53
54
# File 'lib/bio/db/kegg/reaction.rb', line 52

def name
  field_fetch('NAME')
end

- (Object) orthologs_as_hash Also known as: orthologs



30
# File 'lib/bio/db/kegg/reaction.rb', line 30

def orthologs_as_hash; super; end

- (Object) orthologs_as_strings

Orthologs described in the ORTHOLOGY lines.


Returns

Array containing String



127
128
129
# File 'lib/bio/db/kegg/reaction.rb', line 127

def orthologs_as_strings
  lines_fetch('ORTHOLOGY')
end

- (Object) pathways_as_hash Also known as: pathways



25
# File 'lib/bio/db/kegg/reaction.rb', line 25

def pathways_as_hash; super; end

- (Object) pathways_as_strings

Pathway information, described in the PATHWAY lines.


Returns

Array containing String



110
111
112
# File 'lib/bio/db/kegg/reaction.rb', line 110

def pathways_as_strings
  lines_fetch('PATHWAY')
end

- (Object) rpairs_as_hash Also known as: rpairs

KEGG RPAIR (ReactantPair) information, described in the RPAIR lines. Returns a hash of RPair IDs and [ name, type ] informations, for example,

{ "RP12733" => [ "C00022_C00900", "trans" ],
  "RP05698" => [ "C00011_C00022", "leave" ],
  "RP00440" => [ "C00022_C00900", "main" ]
}

Returns

Hash



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/bio/db/kegg/reaction.rb', line 85

def rpairs_as_hash
  unless defined? @rpairs_as_hash
    rps = {}
    rpairs_as_strings.each do |line|
      _, entry_id, name, rptype = line.split(/\s+/)
      rps[entry_id] = [ name, rptype ]
    end
    @rpairs_as_hash = rps
  end
  @rpairs_as_hash
end

- (Object) rpairs_as_strings

KEGG RPAIR (ReactantPair) information, described in the RPAIR lines.


Returns

Array containing String



73
74
75
# File 'lib/bio/db/kegg/reaction.rb', line 73

def rpairs_as_strings
  lines_fetch('RPAIR')
end

- (Object) rpairs_as_tokens

Returns the content of the RPAIR entry as tokens (RPair signature, RPair ID, , RPair type).


Returns

Array containing String



103
104
105
# File 'lib/bio/db/kegg/reaction.rb', line 103

def rpairs_as_tokens
  fetch('RPAIR').split(/\s+/)
end