-
Notifications
You must be signed in to change notification settings - Fork 50
Example 4: cell cell communication in a chamber
The model in this example is 'ex4_simpleCellCellSignaling.py'. This model simulates a communication between two cell types in the same chamber. Cell type-0 expresses RFP and a signalling molecule x0 constitutively. Cell type-1 has a GFP gene inducible by x0. The simulation output should look like the following:
Below, we will show you how to create this file yourself by modifying from the third example (ex3_simpleSignal.py). There won't be any new functionality introduced here but we will show how to build upon ex3 a slightly more complicated multicellular behaviour.
1. Set up the integrator
Since we have three chemical species (x0, RFP and GFP), you have to change the input for chemical species number of CLCrankNicIntegrator to 3.
integ = CLCrankNicIntegrator(sim, 1, 3, max_cells, sig, boundcond='reflect'
2. Add the initial two cells
Here, we will have cell type 0 and type 1 locating 20 unit away from each other. To do this, under 'setup(sim)' , change the part we add cells to:
sim.addCell(cellType=0, pos=(-10.0,0,0))
sim.addCell(cellType=1, pos=(10.0,0,0))
3. Specify initial concentration of chemical species
Under 'init(cell)', change the initial value of cell.species[:] to [0, 0, 0] . This three tuples are for three intracellular chemical species x0, RFP and GFP all starting at 0 concentration.
cell.species[:] = [0, 0, 0]
4. Specify differential equations for the dynamics of intracellular chemical species.
Note that here we use if/else as we need to specify differential equations for the two cell type differently. There are three intracellular chemical species we simulate here: x0, RFP and GFP. x0 diffuse in/out of both cell types but is only produced in cell type-0. RFP is constitutively produced for cell type alone; GFP can be induced by x0 to expressed from cell type-1.
To implement this, change the content of 'specRateCL()' to
return '''
const float D1 = 0.1f;
const float k1 = 1.f;
const float k2 = 1.f;
const float k3 = 1.f;
const float k4 = 5e-5;
float x0 = species[0];
float x0_sig = signals[0];
float RFP = species[1];
float GFP = species[2];
if (cellType==0){
rates[0] = k1 + D1*(x0_sig-x0)*area/gridVolume;
rates[1] = k2;
rates[2] = 0;
} else {
rates[0] = D1*(x0_sig-x0)*area/gridVolume;
rates[1] = 0;
rates[2] = k3*x0*x0/(k4 + x0*x0);
}
'''
5. Specify the displayed of cell color
Here we would like to display cell colors according to their levels of RFP and GFP instead of their x0 level. Under 'update(cells)', change 'cell.color' to
cell.color = [0.1+cell.species[1]/20.0, 0.1+cell.species[2]/20.0, 0.1]
6. Save, open GUI, load and run
... Now you should see in the chamber a growling red colony on the left and black colony on the right. The red colony secretes red signal which gradually turn cells on the left side of the black colony into green.