A differentiable Gillespie algorithm for simulating chemical kinetics, parameter estimation, and designing synthetic biological circuits

  1. Krishna Rijal  Is a corresponding author
  2. Pankaj Mehta
  1. Department of Physics, Boston University, United States
10 figures and 1 additional file

Figures

Comparison between the exact Gillespie algorithm and the differentiable Gillespie algorithm (DGA) for simulating chemical kinetics.

(a) Example of kinetics with N=3 reactions with rates ri(i=1,2,3). (b) Illustration of the DGA’s approximations: replacing the non-differentiable Heaviside and Kronecker delta functions with smooth sigmoid and Gaussian functions, respectively. (c) Flow chart comparing exact and differentiable Gillespie simulations.

Flow chart of the parameter optimization process using the differentiable Gillespie algorithm (DGA).

The process begins by initializing the parameters θ=θ0. Simulations are then run using the DGA to obtain statistics {Si(θ)} like moments. These statistics are used to compute the loss L({Si}), and the gradient of the loss L is obtained. Finally, parameters are updated using the ADAM optimizer, and the process iterates to minimize the loss.

Two-state gene regulation architecture.

(a) Schematic of gene regulatory circuit for transcriptional repression. RNA polymerase (RNAP) binds to the promoter region to initiate transcription at a rate r, leading to the synthesis of mRNA molecules (red curvy lines). mRNA is degraded at a rate γ. A repressor protein can bind to the operator site, with association and dissociation rates konR and koffR, respectively. (b) Experimental data from Phillips et al., 2019, showing the relationship between the mean mRNA level and the Fano factor for two different promoter constructs: lacUD5 (green squares) and 5DL1 (red squares).

Accuracy of the differentiable Gillespie algorithm (DGA) in simulating the two-state promoter architecture in Figure 3a.

Comparison between the DGA and exact simulations for (a) steady-state mRNA distribution, (b) moments of the steady-state mRNA distribution, and (d) the probability for the promoter to be in the ‘ON’ or ‘OFF’ state. (c) Ratio of the Jensen–Shannon divergence JSD(pDGA||pexactss) between the differentiable Gillespie probability distribution function (PDF) pDGA and the exact steady-state PDF pexactss, and the Shannon entropy H(pexactss) of the exact steady-state PDF. In all of the plots, 2000 trajectories are used. The simulation time used in panels (a), (b), and (d) is marked by blue ‘x’. Parameter values: konR=0.5, koffR=1.0, r=10, γ=1, 1/a=200, and 1/b=20.

Gradient-based learning via differentiable Gillespie algorithm (DGA) is applied to the synthetic data for the gene expression model in Figure 3a.

Parameters koffR are fixed at 1, with 1/a=200 and 1/b=20 for a simulation time of 10. (a) Scatter plot of true versus inferred parameters (k^onR and r^) with γ constant. Error bars are 95% confidence intervals (CIs). Panel (b) plots the logarithm of the loss function near a learned parameter set (shown in red circles in (a)), showing insensitivity regions. Panel (c) compares true and predicted mRNA mean and standard deviation with 95% CIs.

Gradient-based learning via differentiable Gillespie algorithm (DGA) is applied to the synthetic data for the gene expression model in Figure 3a.

Parameters koffR are fixed at 1, with 1/a=200 and 1/b=20 for a simulation time of 10. (a) Scatter plot of true versus inferred parameters (k^onR, r^, and γ). Error bars are 95% confidence intervals (CIs). Panel (b) plots the logarithm of the loss function near a learned parameter set (shown in red circles in (a)), showing insensitivity regions. Panel (c) compares true and predicted mRNA mean and standard deviation with 95% CIs.

Fitting of experimental data from Jones et al., 2014 using the differentiable Gillespie algorithm (DGA).

(a) Comparison between theoretical predictions from the DGA (solid curves) and experimental values of mean and the Fano factor for the steady-state mRNA levels are represented by square markers, along with the error bars, for two different promoters, lacUD5 and 5DL1. Solid curves are generated by using DGA to estimate r^, γ^, and {k^onR} and using this as input to exact analytical formulas. (b) Comparison between the inferred values of r^γ^ using DGA with experimentally measured values of this parameter from Jones et al., 2014. (c) Inferred k^onR values as a function of the mean mRNA level.

Design of the four-state promoter architecture using the differentiable Gillespie algorithm (DGA).

(a) Schematic of four-state promoter model. (b) Target input–output relationships (solid curves) and learned input–output relationships (blue dots) between activator concentration [c] and average mRNA production rate. (c) Parameters learned by DGA for the two responses in (b). (d) The sharpness of the response dr¯d[c][c], and the energy dissipated per unit time for two responses in (b). (e) Logarithm of the loss function for the learned parameter set for Response-2, revealing directions (or curves) of insensitivity in the model’s parameter space. The red circles are the learned parameter values.

Appendix 1—figure 1
In panels (a) and (b), we plot the ratio of the Jensen–Shannon divergence JSD(pDGA||pexactss) between the differentiable Gillespie PDF pDGA and the exact steady-state PDF pexactss, and the Shannon entropy H(pexactss) of the exact steady-state PDF, as a function of the two sharpness parameters 1/a and 1/b.

In panel (a), 1/b=20; in panel (b), 1/a=200. The simulation time is set to 10. In panels (c) and (d), for these same values, we show the gradient Lr of the loss function L with respect to the parameter r near the true parameter values. In all the plots, the values of the rates are: konR=0.5, koffR=1, r=10, and γ=1. 5000 trajectories are used to obtain the PDFs, while 200 trajectories are used to obtain the gradients.

Appendix 3—figure 1
Error bars estimation for asymmetric loss function.

Additional files

Download links

A two-part list of links to download the article, or parts of the article, in various formats.

Downloads (link to download the article as PDF)

Open citations (links to open the citations from this article in various online reference manager services)

Cite this article (links to download the citations from this article in formats compatible with various reference manager tools)

  1. Krishna Rijal
  2. Pankaj Mehta
(2025)
A differentiable Gillespie algorithm for simulating chemical kinetics, parameter estimation, and designing synthetic biological circuits
eLife 14:RP103877.
https://doi.org/10.7554/eLife.103877.3