biocrnpyler.Reaction
- class biocrnpyler.Reaction(inputs: List[Species] | List[WeightedSpecies], outputs: List[Species] | List[WeightedSpecies], propensity_type: Propensity)[source]
An abstract representation of a chemical reaction in a CRN.
A reaction has the form: .. math:
\sum_i n_i I_i --> \sum_i m_i O_i @ rate = k where n_i is the count of the ith input, I_i, and m_i is the count of the ith output, O_i.
If the reaction is reversible, the reverse reaction is also included: .. math:
\sum_i m_i O_i --> \sum_i n_i I_i @ rate = k_rev
- __init__(inputs: List[Species] | List[WeightedSpecies], outputs: List[Species] | List[WeightedSpecies], propensity_type: Propensity)[source]
Methods
__init__(inputs, outputs, propensity_type)from_massaction(inputs, outputs, k_forward)Initialize a Reaction object with mass action kinetics.
pretty_print([show_rates, show_material, ...])replace_species(species, new_species)Replaces species with new_species in the reaction.
Attributes
inputsis_reversibleoutputspropensity_typereturns a list of species in the reactions collected from the inputs and outputs and the propensity (e.g. Hill kinetics has species in it).
- classmethod from_massaction(inputs: List[Species] | List[WeightedSpecies], outputs: List[Species] | List[WeightedSpecies], k_forward: float, k_reverse: float = None)[source]
Initialize a Reaction object with mass action kinetics.
- Parameters:
inputs
outputs
k_forward
k_reverse
- Returns:
Reaction object