Example 2: Simple gene expression dynamics - cellmodeller/CellModeller GitHub Wiki

Overview

The models we will use in this example are:

  • 'ex2_constGene.py' for simulating a single gene, x0, constitutively expressing as the colony grows. We display the concentration of x0 in red. Therefore, in the GUI , you should see a growing colony starting from a black cell which gradually turns red over time:

 width 600

  • 'ex2a_dilution.py' for simulating the dilution of a protein x0, displayed again in red. In the GUI, you should see cells turn from bright red to dark over time:

 width 600

  • 'ex2b_diluteRepression.py' for simulating de-repression through dilution. For this example, we will have two species, x0 and x1. x0 represses the expression of x1. x0 starts with concentration 10 and is diluted out over time without additional production. x1 starts with concentration 0.

 width 600


Explanation

Below, we will show you how to create these files by modifying from our first example (ex1_simpleGrowth.py) and introduce you along the way to additional CellModeller functionalities.

1. Add an integrator to the simulator.

1.1) Import an integrator package by adding the following to the package import section of your model file. This integrator will enable the simulator to solve differential equations of chemical species inside the cells.

from CellModeller.Integration.CLEulerIntegrator import CLEulerIntegrator

1.2) Create an integrator object. Specifically, under 'setup(sim)' beneath 'biophys', add:

 integ = CLEulerIntegrator(sim, 1, max_cells)

Note that '1' input parameter is for the number of chemical species we simulate which is only one species in this example.

1.3) Include the integrator to the simulator. Specificlly, under 'setup(sim)' you should change 'sim.init' setup to:

sim.init(biophys, regul, None, integ)

2. Setup intracellular chemical reaction dynamics

2.1) Specify initial conditions. The model in this example only simulates one chemical species inside the cell with initial concentration = 0. To do this, add under 'init(cell)':

cell.species[:] = [0]

2.2) Specify differential equations. The model in this example has one chemical species called 'x0' being produced at a constant rate 'k1' = 1. To do this, add the following function to your model file:

def specRateCL():
  '''return 
  const float k1 = 1.f;
  float x0 = species[0];
  rates[0] = k1;'''

3. Specify the display of cell color

Recall in that in the first example (ex1_simpleGrowth.py) we specify the color of an individual cell by cell type. In this example, we will specify the color of an individual cell by its internal chemical concentration instead. The higher the concentration of 'x0', the more red the cell is. To do this, change 'cell.color' setup to the following:

cell.color = [0.1+cell.species[0]/20.0, 0.1, 0.1]

4. Save, open GUI, load and run

Now you should see a growing colony gradually turns red.

5. Experiment on different variants of the model through the following exercises.

a) dilution through cell division

For this example, the cell starts with x0 concentration = 10, instead of 0, and does produce x0. Thus, the level of x0 should be diluted out over time. Running this model to see a growing colony turns from red to black.

b) de-repression through dilution

For this example, we will have two species, x0 and x1. x0 represses the expression of x1. x0 starts with concentration 10 and is diluted out over time without addition production. x1 starts with concentration 0. To do this,

-In setup(sim), change input of CLEulerIntegrator to 2 as we will have two species now.

-In init(cell), set cell.species[:] = [10, 0] , i.e., x0 = 10 and x1 = 0

-In specRateCL(), change differential equations to the code below. Notice that x0 is not produced (rate[0] = k1 = 0) while x1 production is modelled as a Hill repression function with maximal production rate k2 = 1, x0 binding dissociation constant k3 = 2 and Hill coefficient = 2.

    '''return 
    const float k1 = 0.f;
    const float k2 = 1.f; 
    const float k3 = 2.f;
    float x0 = species[0];
    float x1 = species[1];
    rates[0] = k1;
    rates[1] = k2*k3*k3/(k3*k3 + x0*x0);'''

-Save, load and run this model to see red color gets diluted out and green color increases as the colony grows: