biocrnpyler.mechanisms.OneStepPathway

class biocrnpyler.mechanisms.OneStepPathway(name='one_step_pathway', mechanism_type='metabolic_pathway')[source]

Bases: Mechanism

Simple one-step metabolic pathway mechanism.

A ‘metabolic_pathway’ mechanism that models the conversion of precursor metabolites to product metabolites in a single irreversible step. This mechanism can represent metabolic reactions, spontaneous conversions, or simplified enzymatic pathways where enzyme dynamics are not explicitly modeled.

The pathway reaction can be any of the following forms:

  • Precursors \(\rightarrow\) Products (standard conversion)

  • \(\rightarrow\) Products (creation from nothing)

  • Precursors \(\rightarrow\) (degradation to nothing)

where precursors and products can be single species or lists of species.

Parameters:
  • name (str, default 'one_step_pathway') – Name identifier for this mechanism instance.

  • mechanism_type (str, default 'metabolic_pathway') – Type classification of this mechanism.

Attributes:
  • name (str) – Name of the mechanism instance.

  • mechanism_type (str) – Type classification (‘metabolic_pathway’).

See also

BasicCatalysis

Enzymatic catalysis with explicit enzyme.

BasicProduction

Catalytic production mechanism.

Mechanism

Base class for all mechanisms.

Notes

This mechanism generates a single irreversible mass-action reaction with rate constant ‘k’. It provides flexibility to model various types of metabolic processes:

  • Standard conversion: Multiple precursors convert to multiple products

  • Creation: Products appear spontaneously (precursor=None)

  • Degradation: Precursors disappear (product=None)

The mechanism does not explicitly model enzymes or intermediate complexes, making it suitable for:

  • Lumped metabolic pathways

  • Spontaneous chemical reactions

  • Simplified models where enzyme dynamics are negligible

  • Material flow in metabolic networks

  • Constitutive processes

Common applications include:

  • Metabolic flux balance models

  • Simplified biosynthetic pathways

  • Nutrient uptake and consumption

  • Waste product formation

  • Simple chemical transformations

Required parameters for this mechanism:

  • ‘k’ : Forward rate constant for the conversion

The mechanism supports arbitrary stoichiometries through the use of lists for precursors and products. Stoichiometry is determined by the number of times a species appears in the list.

Examples

Model a simple metabolic conversion:

>>> g6p = bcp.Metabolite('g6p', precursors=['glucose'], products=[])
>>> mixture = bcp.Mixture(
...     components=[g6p],
...     mechanisms={'metabolic_pathway': bcp.OneStepPathway()},
...     parameters={'k': 0.1}
... )
>>> mixture.compile_crn()

Model constitutive metabolite production:

>>> metabolite = bcp.Metabolite(
...     'metabolite', precursors=[None], products=[])
>>> mixture = bcp.Mixture(
...     components=[metabolite],
...     mechanisms={'metabolic_pathway': bcp.OneStepPathway()},
...     parameters={'k': 1.0}
... )
>>> mixture.compile_crn()

Model metabolite degradation:

>>> waste = bcp.Metabolite(
...     'waste_product', precursors=[], products=[None])
>>> mixture = bcp.Mixture(
...     components=[waste],
...     mechanisms={'metabolic_pathway': bcp.OneStepPathway()},
...     parameters={'k': 0.2}
... )
>>> mixture.compile_crn()

Methods

update_reactions

Generate metabolic pathway reactions.

update_species

Generate species list for metabolic pathway.

update_reactions(precursor, product, component=None, part_id=None, k=None, **kwargs)[source]

Generate metabolic pathway reactions.

Creates a single irreversible mass-action reaction for the metabolic conversion of precursors to products.

Parameters:
  • precursor (Species, list of Species, or None) – Precursor species or list of precursor species. If None, the reaction represents creation (no inputs).

  • product (Species, list of Species, or None) – Product species or list of product species. If None, the reaction represents degradation (no outputs).

  • component (Component, optional) – Component containing parameter values. Required if k is not provided directly.

  • part_id (str, optional) – Identifier for parameter lookup. If None, defaults to using component’s parameter lookup without specific part_id.

  • k (Parameter or float, optional) – Forward rate constant for the pathway. If None, retrieved from component parameters.

  • **kwargs – Additional keyword arguments (unused).

Returns:

List containing a single irreversible mass-action reaction: precursors \(\rightarrow\) products.

Return type:

list of Reaction

Raises:

ValueError – If component is None and k is not provided.

Notes

The reaction follows mass-action kinetics with rate constant ‘k’. The mechanism supports three modes:

  • Standard: precursors \(\rightarrow\) products

  • Creation: [] \(\rightarrow\) products (when precursor is None)

  • Degradation: precursors \(\rightarrow\) [] (when product is None)

Multiple species of the same type in the precursor or product list determine the stoichiometry of that species in the reaction.

update_species(precursor, product, **kwargs)[source]

Generate species list for metabolic pathway.

Collects all species involved in the pathway (precursors and products) into a single list.

Parameters:
  • precursor (Species, list of Species, or None) – Precursor species or list of precursor species. If None, the pathway represents creation from nothing.

  • product (Species, list of Species, or None) – Product species or list of product species. If None, the pathway represents degradation to nothing.

  • **kwargs – Additional keyword arguments (unused).

Returns:

Combined list of all precursor and product species. Returns empty list if both are None.

Return type:

list of Species

Notes

This method simply aggregates the input species without creating new species or complexes. The species should already exist in the system before this mechanism is applied.