biocrnpyler.core.reaction

Classes

Reaction(inputs, outputs, propensity_type)

An abstract representation of a chemical reaction in a CRN.

class biocrnpyler.core.reaction.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
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

replace_species(species: Species, new_species: Species)[source]

Replaces species with new_species in the reaction.

Parameters:
  • species – species to be replaced

  • new_species – the new species the old species is replaced with

Returns:

a new Reaction instance

property species: List[Species]

returns a list of species in the reactions collected from the inputs and outputs and the propensity (e.g. Hill kinetics has species in it).

Returns:

list of species in the reactions