Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

S7. Protein distributions from four reactions

What this chapter reproduces

An mRNA arrives at a constant rate, each mRNA translates proteins independently, and both species decay. How well does a negative-binomial law describe the protein count of these four reactions, and when does it fail? The chapter reconstructs Figure 1B–D of

Shahrezaei V., Swain P.S. (2008). Analytical distributions for stochastic gene expression. PNAS 105, 17256–17261. doi:10.1073/pnas.0803850105 (Equation 9 and Figure 1; author manuscript arXiv:0812.3344)

The paper publishes no data or code for Figure 1. Everything here is computed from the reactions; the only values taken from the paper are the 18 marker heights of Figure 1D, read from the figure image (reference-figure1d.csv, digitize.py). The paper’s authors did not write or review this chapter.

The result in three lines:

  • Two protein distributions with the same mean of 50 copies: one peaks at 47–48 copies, the other at zero and puts 5–8% of its mass above 150 copies. Four ensembles of 10,000 cells agree with the computed laws within a 99% simultaneous band.
  • The negative-binomial law of Equation 9 becomes exact as mRNA lifetimes shrink (γ large). At γ = 0.063 its Kullback–Leibler divergence from the reaction law is 0.22 nats for the narrow and 0.97 nats for the broad regime.
  • The published Figure 1D values are 1.45–1.52 times these numbers in both regimes. In bits (logarithm base 2) they agree within 0.024, about the reading error of the figure. The paper does not state the unit, and the review could not inspect the figure’s axis labels, so this is the likely cause, not a confirmed one.

The model

Time is measured in protein lifetimes, so the protein decay rate is one. The paper writes transcription rate v0, translation rate v1 per mRNA, and decay rates d0 (mRNA) and d1 (protein). It sets a = v0/d1, b = v1/d0 and γ = d0/d1.

ReactionPropensityMeaning
∅ → Matranscription, a mRNAs per protein lifetime
M → M + Pb·γ·Mtranslation, b proteins per mRNA lifetime on average
M → ∅γ·MmRNA decay
P → ∅Pprotein decay

The stationary protein law has mean a·b and Fano factor (variance over mean) 1 + b·γ/(1 + γ) for every γ. For γ → ∞, Equation 9 of the paper gives the negative-binomial law with shape a and success probability 1/(1 + b), which is SciPy’s nbinom(a, 1/(1 + b)). The paper gives no physical rate for Figure 1; the results here hold for any d1.

The two regimes are a = 20, b = 2.5 (narrow) and a = 0.5, b = 100 (broad). The caption of Figure 1 gives the mean mRNA number a/γ as 2 or 20 in panel B and 0.05 or 0.5 in panel C, which fits these a at γ = 10 and 1. The values of b and the use of the same a, b across the γ sweep of panel D come from the study plan; the caption does not state them.

A small model checks CRN-craft’s finite state projection (FSP). The printed number is the probability that neither an mRNA nor a protein is present after one protein lifetime.

import crn_craft as crn

model = crn.Model("two_stage")
model.add_species({"M": 0, "P": 0})
model.add_reaction(0.7, [], ["M"], name="transcription")
model.add_reaction(2.4, ["M"], ["M", "P"], name="translation")
model.add_reaction(2.0, ["M"], [], name="mrna_decay")
model.add_reaction(1.0, ["P"], [], name="protein_decay")
result = model.fsp(end=1.0, report_times=[1.0], bounds={"M": 5, "P": 8})
print(f"{result.metadata['snapshots'][0]['probabilities'][0]:.4f}")
0.6637

How the distributions are computed

Three independent calculations are compared.

  1. Native FSP. On the small model above it agrees with SciPy’s matrix exponential of the same truncated generator to 1.9e-13 in every state probability. On the narrow regime at γ = 1 and three protein lifetimes (box M ≤ 50, P ≤ 106), its protein marginal differs from the generating function below by 5.1e-8 in the cumulative distribution function (CDF), with 7.3e-8 probability leaving the box. The sweep needs 32 lifetimes of the slower species (below). With this box the native solver still runs to 6 protein lifetimes but stops before 12 with CRN-E070, because it caps a projection at 200,000,000 work units. FSP is therefore not used for the sweep.
  2. Generating function (production). mRNAs arrive as a Poisson process. An mRNA of age s that is still alive has left a Poisson number of surviving proteins; one that died has left a Poisson number that decays further. Integrating over arrival times and lifetimes gives the probability generating function of the protein count at time T from zero counts. It is inverted on 2,048 or 4,096 roots of unity. T is 32 lifetimes of the slower species: 507 protein lifetimes at γ = 0.063. Doubling T changes no CDF by more than 1.4e-12; doubling the support and refining the quadrature by no more than 1.1e-7. The mass above 2,047 copies is at most 2.5e-13.
  3. Stationary master equation (review). review.py solves the truncated joint master equation for its stationary vector with a sparse LU factorization. It shares no code with the production solver. At all 20 parameter rows the two agree within 1.5e-12 in divergence, and within 2.4e-10 in the CDF of the four tabulated cases. Both reproduce the exact mean and Fano factor within 1.1e-9 (relative). stationary_check.py solves the same 20 rows with CRN-craft’s stationary_fsp (closed classes and a sparse LU in the native engine) and agrees with this solver within 1e-13 in the CDF.

Exact stochastic simulation (Gillespie’s direct method) gives 10,000 independent cells per Figure 1B–C case, each started from zero and read once at time T.

The protocol

The targets in manifest.json were fixed before the runs: numerical tail below 1e-6, CDF change below 0.001 when T doubles, mean and Fano factor within 1% of the exact values. The four simulated CDFs are compared with the computed laws by the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality, two-sided, at 99% simultaneous over the four panels: sqrt(ln(2·4/0.01)/(2·10,000)) = 0.0183. The divergence convention was fixed as the reaction law relative to the negative-binomial law, counts 0–150 and one bin above 150. The review’s convention tests and their decision rules were declared before the review run (see the limits below).

Two distributions with mean 50

Two protein count distributions with mean 50

Lines: computed laws. Dots: every fifth count of the 10,000 simulated cells.

a, bγMean mRNA a/γMost likely countP(0)Mass above 150: reaction law / NB / sampleSample CDF gapDKW bound
20, 2.5120480.00000.0000 / 0.0000 / 0.00000.00620.0183
20, 2.5102470.00000.0000 / 0.0000 / 0.00000.01070.0183
0.5, 10010.500.07490.0491 / 0.0833 / 0.04860.00590.0183
0.5, 100100.0500.09710.0830 / 0.0833 / 0.07990.00660.0183

All four sample gaps lie inside the bound: numerical agreement. The broad regime puts 5–8% of the cells beyond the plotted axis; a fit or a divergence that drops them misses that mass.

Approximation error across lifetime ratios

Approximation error across lifetime ratios

Solid lines: the divergence of the exact reaction law from Equation 9, in bits. Dashed lines: the same divergence estimated from 10,000 draws of the reaction law (mean of 20 repeats, ± standard deviation in the table), which is what a divergence from a simulated histogram measures. Open circles: the digitized paper values; their reading error is 0.017.

γa=20: publisheda=20: bitsa=20: bits, 10,000 drawsa=0.5: publisheda=0.5: bitsa=0.5: bits, 10,000 draws
0.06310.3270.3190.324 ± 0.0061.4171.4001.409 ± 0.009
0.1260.2690.2680.275 ± 0.0080.9780.9610.975 ± 0.011
0.2510.2030.1980.203 ± 0.0060.5510.5380.549 ± 0.009
0.5010.1280.1220.125 ± 0.0050.2400.2280.237 ± 0.006
10.0580.0600.067 ± 0.0050.0910.0700.081 ± 0.005
20.0120.0240.031 ± 0.0020.0370.0140.024 ± 0.002
3.980.0000.0080.015 ± 0.0010.0170.0030.014 ± 0.002
7.940.0000.0020.010 ± 0.0010.0040.0010.012 ± 0.001
15.80.0000.0010.008 ± 0.0010.0040.0000.011 ± 0.001

The paper says only that it plots “the Kullback–Leibler divergence between the analytical and simulated protein distributions”. Direction, binning, tail handling, logarithm base and sample size are open. The review computed each choice at all 18 digitized points:

ConventionPublished / candidate, 8 values ≥ 0.1Largest gap, 18 values
Reaction law vs NB, nats, 0–150 + tail (shipped)1.45–1.520.447
Reversed direction, nats0.52–1.451.296
No tail bin, nats1.28–1.520.447
0–150 renormalized, nats1.45–1.850.534
All counts, nats1.42–1.520.447
Tail bin above 100, nats1.45–1.890.458
Tail bin above 300, nats1.42–1.520.447
Bins of width 5, nats1.47–1.570.451
Shipped convention in bits1.00–1.050.024
Bits, 1,000 simulated draws0.70–0.950.118
Bits, 10,000 simulated draws0.98–1.020.018

Reversing the direction or changing the bins changes the ratio from point to point, so neither explains a common factor. The ratio in nats is nearly constant at 1.47, close to 1/ln 2 = 1.443, and the bits convention matches every point within 1.5 reading errors. Estimating the divergence from 10,000 simulated cells adds a small positive bias. That bias also explains why the published broad-regime values stay above zero at γ = 4–16, where the exact divergence is below 0.003 bits.

One alternative remains open: if the figure’s top tick were 1.0 instead of the 1.5 used in digitize.py, the published values would shrink by 1.5 and agree with nats within 0.026. The review could not see the figure image to rule this out. The result is therefore labeled unresolved between logarithm base and axis calibration, with bits the better fit. The paper’s statement that the two laws become almost indistinguishable for γ above 1 is reproduced.

Reconstruction choices

ChoiceValue herePaperMeasured effect
b in both regimes, same a, b along the γ sweep2.5 and 100, fixednot stated in the textnot testable without the figure
Divergence directionreaction law relative to NBnot statedreversing: ratio 0.52–1.45 instead of 1.45–1.52
Logarithm basenats in divergence.csv, bits in the figurenot statedfactor 1.443
Bins and tail0–150 and one tail binnot statednarrow: at most 4% (width-5 bins); broad: 9–13% at γ ≤ 0.13, up to a factor 3 at γ ≥ 2
Reference lawexact stationary lawfinite simulation+0.003 to +0.014 bits at 10,000 cells
Initial state of simulated cellszero counts, read at Tnot statedCDF change below 1.4e-12 when T doubles
γ grid0.3-decade steps, 10^-1.2 to 10^1.2read from figurenone

Limits

  • The figure image was not available to the review: the arXiv PDF could not be downloaded and the text versions carry no image. Axis calibration, the values of b and the marker assignment in digitize.py are unchecked.
  • The digitized values have a reading error of 0.017 in the plotted unit; zero readings at large γ only mean “below about 0.02”.
  • The simulated checks cover the four Figure 1B–C cases; the sweep rows rely on the two solvers and the moment identities.
  • The paper’s simulation sample size is unknown; the 10,000-cell bias column shows its size for one choice.

Running the example

SizeWhat it doesCost
--size quicksmall FSP and matrix-exponential check, 1,000 cells2 s
--size draftthe four Figure 1B–C cases with 10,000 cells each30 s
--size fullall 20 rows of the sweep and the four ensembles90 s
review.pystationary master equation and the convention table90 s

study.py --figures docs/guide/img/two_stage_expression redraws both figures from the stored results. The draft size uses other seeds than the full run, so its sample gaps differ. Example and result files

Exercises

  1. Compute the stationary Fano factor at γ = 1 for both regimes from the formula and check it against divergence.csv.
  2. Put the tail bin above count 50 (binned(pmf, 50) in review.py) and recompute the broad regime. Which γ changes most, and why?
  3. Draw 1,000 instead of 10,000 cells. How large does the bias of the divergence become at γ = 16?

What carries over to tutorial O3

The two regimes have the same mean and very different shapes, so a fit to means alone cannot tell them apart. A distribution comparison has to fix its direction, binning, tail handling, unit and sample size before the fit, because each choice changes the number. Tutorial O3 fits the mean and the count distribution of a real experiment.