biocrnpyler.mechanisms.Simple_Diffusion
- class biocrnpyler.mechanisms.Simple_Diffusion(name='simple_diffusion', mechanism_type='diffusion', **kwargs)[source]
Bases:
MechanismPassive diffusion mechanism for substrate transport across membranes.
A ‘diffusion’ mechanism that models simple passive diffusion of substrates through a membrane without requiring membrane proteins or energy. The transport is bidirectional and follows Fick’s law of diffusion with equal forward and reverse rate constants.
The reaction follows the schema:
\[{\text{substrate}} \rightleftharpoons {\text{product}} \]where substrate and product represent the same species on opposite sides of the membrane.
- Parameters:
name (
str, default'simple_diffusion') – Name identifier for this mechanism instance.mechanism_type (
str, default'diffusion') – Type classification of this mechanism.
- Attributes:
name (
str) – Name of the mechanism instance.mechanism_type (
str) – Type classification (‘diffusion’).
See also
Simple_TransportPassive transport through membrane channels.
Facilitated_Transport_MMFacilitated diffusion with carriers.
MechanismBase class for all mechanisms.
Notes
Simple diffusion models the movement of small, lipophilic molecules across lipid bilayers without the assistance of membrane proteins. This process is driven purely by concentration gradients and does not require cellular energy.
Common examples include:
Diffusion of gases (O2, CO2) across cell membranes
Transport of small nonpolar molecules
Movement of lipid-soluble substances
The mechanism generates a single reversible mass-action reaction with equal forward and reverse rate constants, reflecting the thermodynamic equilibrium of passive diffusion.
Required parameters for this mechanism:
‘k_diff’ : Diffusion rate constant (same for both directions)
Examples
Model oxygen diffusion across a membrane:
>>> O2 = bcp.DiffusibleMolecule('O2') >>> mechanism = bcp.Simple_Diffusion() >>> mixture = bcp.Mixture( ... components=[O2], ... mechanisms={'diffusion': mechanism}, ... parameters={'k_diff': 0.1} ... ) >>> mixture.compile_crn()
Methods
Generate reactions for simple diffusion.
Generate species for simple diffusion.
- update_reactions(substrate, product, component=None, part_id=None, k_diff=None, **kwargs)[source]
Generate reactions for simple diffusion.
Creates a single reversible mass-action reaction representing passive diffusion across a membrane with equal forward and reverse rate constants.
- Parameters:
substrate (
Species) – The substrate species on one side of the membrane.product (
Species) – The product species on the other side of the membrane.component (
Component, optional) – Component containing parameter values. Required if k_diff is not provided directly.part_id (
str, optional) – Identifier for parameter lookup. If None and component is provided, defaults to component.name.k_diff (
Parameterorfloat, optional) – Diffusion rate constant. If None, retrieved from component parameters. Used as both forward and reverse rate constant.**kwargs – Additional keyword arguments (unused).
- Returns:
List containing a single reversible mass-action reaction for diffusion.
- Return type:
listofReaction- Raises:
ValueError – If component is None and k_diff is not provided.
Notes
The reaction has equal forward and reverse rate constants, reflecting the thermodynamic equilibrium of passive diffusion:
\[{\text{substrate}} \rightleftharpoons {\text{product}} ({\text{rates}}\mathord{:} {\text{k_diff}}, {\text{k_diff}}) \]
- update_species(substrate, product, **kwargs)[source]
Generate species for simple diffusion.
Returns the substrate and product species involved in the diffusion reaction.
- Parameters:
substrate (
Species) – The substrate species on one side of the membrane (typically the intracellular side).product (
Species) – The product species on the other side of the membrane (typically the extracellular side). Usually the same molecular species as substrate but in a different compartment.**kwargs – Additional keyword arguments (unused).
- Returns:
List containing [substrate, product].
- Return type:
listofSpecies