Class: Bio::KEGG::REACTION

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

Constant Summary collapse

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

Instance Method Summary collapse

Methods inherited from DB

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

Constructor Details

#initialize(entry) ⇒ REACTION

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

#definitionObject

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

#entry_idObject

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

#enzymesObject

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

#equationObject

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

#nameObject

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

#orthologs_as_hashObject Also known as: orthologs

Returns a Hash of the orthology ID and definition in ORTHOLOGY field.



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

def orthologs_as_hash; super; end

#orthologs_as_stringsObject

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

#pathways_as_hashObject Also known as: pathways

Returns a Hash of the pathway ID and name in PATHWAY field.



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

def pathways_as_hash; super; end

#pathways_as_stringsObject

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

#rpairs_as_hashObject 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|
      namespace, entry_id, name, rptype = line.split(/\s+/)
      rps[entry_id] = [ name, rptype ]
    end
    @rpairs_as_hash = rps
  end
  @rpairs_as_hash
end

#rpairs_as_stringsObject

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

#rpairs_as_tokensObject

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