CRN Modeling with MobsPy¶


The course contains material derived from the course Biological Circuit Design by Michael Elowitz and Justin Bois, 2020 at Caltech.

The original course material has been changed by Matthias Fuegger and Thomas Nowak.

This lecture covers:

Concepts

  • The MobsPy simulation framework
  • Stochastic simulation of CRNs
  • Deterministic simulation of CRNs
  • Noise in CRNs
  • Advantages of noise in applications

MobsPy¶

MobsPy is a Python-based language to specify, simulate, and analyze CRNs. It follows a modular, object-oriented, approach, where species are grouped into meta-species and reactions into meta-reactions. For an overview see the paper.

The Python library is available via github and on pypi.

In [ ]:
# install mobspy
%pip install mobspy

We start with a simple system of four species and reactions. The system does not yet make use of meta-species and meta-reactions. By changing the method in the code below, you can switch between a stochastic and a deterministic simulation.

In [ ]:
from mobspy import BaseSpecies, Simulation, Zero, u
import matplotlib.pyplot as plt

# Parameters
duration = 24 * u.hour
duplication_rate_const = 1/(40*u.min)
conjugation_rate_const = 10**-9 / u.min * u.ml
volume = 1 * u.ml
R0 = 1e4

# Species
A, B, R, E = BaseSpecies()
A(10 / u.ml)
B(10 / u.ml)
R(R0 / u.ml)

A + R >> 2*A [duplication_rate_const / R0]
B + R >> 2*B [duplication_rate_const / R0]
A + B >> A + E [conjugation_rate_const]
A + B >> B + E [conjugation_rate_const]

# simulate
S = Simulation(A | B | R | E)
S.volume = volume
S.save_data = False
S.method = 'stochastic'
# S.method = 'deterministic'
S.duration = duration
S.plot_data = False
S.run(step_size=1*u.min)

plt.plot(S.results["Time"][0], S.results["A"][0], label="A")
plt.plot(S.results["Time"][0], S.results["B"][0], label="B")
plt.plot(S.results["Time"][0], S.results["E"][0], label="E")
plt.legend()

# block
plt.yscale('log')
plt.show()

Note: the rest of this lecture is given on the blackboard.

Noise in genetic circuits¶

We are reading together the paper by Elowitz et al. about noise components in a single bacterial cell.

Advantages of noise¶

We are reading together the paper by Eldar and Elowitz about functional roles in genetic circuits.