Class Reaction
Abstraction for a biochemical transformation.
This class represents a (potentially reversible) biochemical
transformation of the type:
a S1 + b S2 + ... --> c P1 + d P2 + ...
where
- a, b, c, d ... are positive numeric stochiometric coefficients,
- S1, S2, ... are substrates
- P1, P2, ... are products
A Reaction should be viewed as the net result of one or more individual
reaction steps, where each step is potentially facilitated by a different
catalyst. Support for 'Reaction algebra' will be added at some point in
the future.
Attributes:
reactants -- map of involved species to their stochiometric coefficients:
reactants[S] = stochiometric constant for S
catalysts -- list of tuples of catalysts required for this reaction
reversible -- true iff reaction is reversible
data -- reference to arbitrary additional data
Invariants:
for all S in reactants.keys(): reactants[S] != 0
for all C in catalysts.keys(): catalysts[C] != 0
Method Summary |
|
__init__ (self,
reactants,
catalysts,
reversible,
data)
Initializes a new Reaction object. |
|
__eq__ (self,
r)
Returns true iff self is equal to r. |
|
__hash__ (self)
Returns a hashcode for self. |
|
__ne__ (self,
r)
Returns true iff self is not equal to r. |
|
__repr__ (self)
Returns a debugging string representation of self. |
|
__str__ (self)
Returns a string representation of self. |
|
reverse (self)
Returns a new Reaction that is the reverse of self. |
|
species (self)
Returns a list of all Species involved in self. |
__init__(self,
reactants={},
catalysts=[],
reversible=0,
data=None)
(Constructor)
Initializes a new Reaction object.
-
|
__eq__(self,
r)
(Equality operator)
Returns true iff self is equal to r.
-
|
__hash__(self)
(Hashing function)
Returns a hashcode for self.
-
|
__ne__(self,
r)
Returns true iff self is not equal to r.
-
|
__repr__(self)
(Representation operator)
Returns a debugging string representation of self.
-
|
__str__(self)
(Informal representation operator)
Returns a string representation of self.
-
|
reverse(self)
Returns a new Reaction that is the reverse of self.
-
|
species(self)
Returns a list of all Species involved in self.
-
|