Bibliography:
- D. T. Gillespie, Exact Stochastic Simulation of Coupled Chemical Reactions, The Journal of Physical Chemistry, Vol. 81, No. 25, 1977.
- L. A. Segel, M. Slemrod, The quasi-steady-state assumption: a case study in perturbation, SIAM Rev. 1989; 31(3):446-477.
- J. Borghans, R. de Boer, L. Segel, Extending the quasi-steady state approximation by changing variables, Bull. Math. Biol. 58 (1996) 43-63.
- R. A. Copeland, ENZYMES: A Practical Introduction to Structure, Mechanism, and Data Analysis, second edition, Wiley-VCH, 2000.
- A. R. Tzafriri, Michaelis-Menten kinetics at high enzyme concentrations, Bull. Math. Biol. 2003; 65(6):1111-1129.
- D. T. Gillespie, Stochastic Simulation of Chemical Kinetics, Annu. Rev. Phys. Chem. 2007, 58:35-55.
- M. G. Pedersen, A. M. Bersani, E. Bersani, G. Cortese, The total quasi-steady-state approximation for complex enzyme reactions, Mathematics and Computers in Simulation 79 (2008) 1010-1019.
- Y. Cao, D. C. Samuels, Discrete Stochastic Simulation Methods for Chemically Reacting Systems, Methods Enzymol. 2009; 454: 115-140.
- K. R. Sanft, D. T. Gillespie, L. R. Petzold, Legitimacy of the stochastic Michaelis-Menten approximation, IET Syst. Biol., 2011, Vol. 5, Iss. 1, pp. 58-69.
- V. Sunkara, On the Properties of the Reaction Counts Chemical Master Equation, Entropy 2019, 21(6), 607.
- J. K. Kim, J. J. Tyson, Misuse of the Michaelis-Menten rate law for protein interaction networks and its remedy, PLoS Computational Biology 16(10), 2020.
- T.-H. Ahn, Y. Cao, L. T. Watson, Stochastic Simulation Algorithms for Chemical Reactions, Virginia Polytechnic Institute and State University, Blacksburg, Virginia.
The provided code consists of both Python and C++ scripts designed to facilitate the exploration of enzyme-substrate reactions. The Python scripts offer an intuitive Graphical User Interface (GUI), enabling users to analyze simulation results across diverse mathematical models. To run the Python scripts successfully, ffmpeg must be installed, as it is required for generating animations. Key functionalities of the Python scripts include extracting user-supplied parameters, such as total enzyme and substrate counts, and rate constants. Users can input these parameters through a user-friendly interface and initiate the simulation by clicking the "Run Simulation" button. The simulation itself is conducted using the Gillespie algorithm or by integrating the Chemical Master Equation (CME) for precise formulations. Additionally, the scripts support the quasi-steady-state approximation (QSSA) and the total quasi-steady-state approximation (tQSSA) for faster simulations. Post-simulation, the collected data is presented in various formats, including the variation of population numbers/concentrations over time or concerning the variation of a specific parameter. The outputs also encompass probabilities of a given state, statistical averages, standard deviations, probability densities for completion times, and probability densities for steady-state phosphorylated substrate count. The outputs are generated for both the CME and Gillespie simulation methods, providing users with a comprehensive understanding of the enzyme-substrate reactions under different mathematical models.
The repository is composed of the following:
GUIs
: directory containing the GUIs to investigate different types of chemical reactions and containing theSimulatior-Outputs
subfolder, where all simulation results are saved automatically. The outputs are named after the values set to perform the simulation - e.g. E100-S10 stands for 100 molecules of enzyme E vs 10 molecules of substrate S.SimulationFunctionsOnly.py file
: file containing the functions required to run the simulation for the deterministic solution of the system.Stochastic chemical kinetics
: repository containing all files required to perform stochastic simulations.
Note that for the deterministic case the system is solved directly by running the GUI for the selected reaction, whereas for the stochastic case specific C++ custom modules are required and need to be integrated into the GUI files - see the Stochastic chemical kinetics section for further detail. A PDF file explaining the project, with more thorough theoretical underpinnings, some pertinent outputs, and their interpretation, is also available in the repository.
- NumPy for numerical operations
- SciPy for numerical integration (odeint, which uses LSODA from the Fortran library Odepack, an implementation of a method by Petzold) and steady-state computation using a root-finding algorithm (fsolve, which uses HYBRD and HYBRJ implmentations from the Fortran library Minpack of the Powell’s hybrid method).
- Matplotlib for visualization of graphs and animations
- Tkinter for GUI elements, like buttons and text fields
- Custom modules "gillespie" and "cme" written in C++ and made available as Python libraries thanks to Pybind11.
Stochastic chemical kinetics using Gillespie algorithm (also stochastic simulation algorithm or SSA) and chemical master equation (CME), with application to enzyme kinetics.
This part of code is written as a library in C++20 with Python bindings using Pybind11. The repository is structured in the following way:
experiments
: directory containing example code using the library and experiments for University projects.include/sck
: directory containing the C++ header files to include in implementation files.cme.hpp
: it includes classes for generic CME equation integration and applications to enzyme kinetics.gillespie.hpp
: it includes classes for generic Gillespie algorithm and applications to enzyme kinetics.runge_kutta.hpp
: explicit Runge-Kutta methods used for integration of the CME equation.tensor.hpp
: classes, aliases and data structures for vectors, matrices and tensors with some helper functions.
pybind
: directory containing C++ implementation files that binds the code inside theinclude
directory. It also contains the Windows dynamic-link libraries which can be directly imported in Python scripts (on Linux, you will need to recompile them).cme_pybind.cpp
: Python bindings for CME.gillespie_pybind.cpp
: Python bindings for Gillespie algorithm.runge_kutta_pybind.cpp
: Python bindings for Runge-Kutta methods.
tests
: Tests that verify the correctness of the current implementation.
The C++ header files have no dependencies other than a C++20-complying compiler. To compile the Python bindings, Pybind11 must be installed on the current machine. For more information on how to compile these bindings, see the individual files inside the pybind
folder. Rename the library paths accordingly, if needed.
The resulting Python library will require NumPy 1.7.0 or any later version.
The chemical master equation (CME) is given by
where
Sunkara (2019) found an equivalent formulation of the CME, where the probability of certain species counts
where
Note that this map is not in general bijective. Given a solution to the reaction count CME
where
Both these formulations can be casted into a system of ordinary differential equations with many different variables depending on the maximum allowed population numbers or reaction numbers. For small enough systems, these equations can be simply solved using a standard integration method, for example a Runge-Kutta method. However, we are quickly caught by the curse of dimensionality for systems with many chemical species: a lot of computer memory may be required to perform a simulation.
An alternative way to solve the CME is through a Monte-Carlo method, i.e., performing several stochastic realizations, and then calculating the relevant statistics. Gillespie (1977) found such algorithm, which is based on the reaction probability density function:
where
while
and, finally, carry out the reaction by replacing
Note that, since we require a large amount of realizations to obtain statistically significant results, stochastic simulation algorithm can be slower than direct integration of the CME for systems with few chemical species or small populations. In practice, this algorithm is useful when solving the CME directly would be prohibitively expensive in terms of required memory or computational time.
A single-substrate enzyme-catalyzed reaction can be described by the following chain of reactions
which correspond, due to the mass action law, to the following system of ordinary differential equations (ODEs):
where
The number of independent variables can be further reduced to one using approximations.
The quasi-steady state approximation (QSSA, or sQSSA, meaning standard QSSA) is obtained under the assumption that
from which we obtain a closed expression for the enzyme-substrate complex concentration
where
which is the Michaelis-Menten rate law. Segel and Slemrod (1989) showed that this approximation is valid for
Introduced by Borghans et al. (1996), this approximation is analogous to QSSA, with the difference that we perform a change of variable before applying the condition
Following the same steps as before, we obtain the following expression for
From the validity condition given by Tzafriri (2003), one can show that this approximation is reasonably accurate even in the worst case, so the range of validity is much wider for tQSSA than standard QSSA. Substituting in the products rate equation, we obtain
which can also be rewritten so that it is more computationally stable for small values of
Note that
The propensity functions for a single-substrate enzyme-catalyzed reaction are associated to each reaction channel:
So, the three propensity functions are given by
where
where
Remembering that we have only two independent variables thanks to the conservation of
where
where
This can be viewed as having only one monomolecular reaction described by
The Goldbeter-Koshland (GK) switch consists of a substrate-product pair
These reactions are commonly used to describe phosphorylation and dephosphorylation processes, where
Like for the single-substrate case, we have conserved quantities: the total substrate concentration
The QSSA can be obtained by assuming
from which we obtain
where
Substituting into the equation for
Note that
Then, applying the quasi-steady state condition as before, we obtain the following expression for the phosphorylated substrate concentration:
Note that
Choosing the coordinates
For stochastic tQSSA, we have only two reactions corresponding to
for which the propensity functions are given by
with only one independent variable since