-
Notifications
You must be signed in to change notification settings - Fork 50
Example 1: Simple cell growth
1. Open GUI
1.1) Start a Unix terminal. In Mac, you can find this at Applications>Utilities>Terminal
1.2) Run cellmodeller python GUI by entering the following in your terminal:
$ python ~/cellmodeller/Scripts/CellModellerGUI.py
... Now you should see cellmodeller GUI like this:
2. Load and run example1 model from GUI
2.1) On the GUI, click 'Load' button, go to 'Examples' folder inside cellmodeller main folder and open 'ex1_simpleGrowth.py'
... Now you should see a rod shape representing a cell in the middle of your GUI space:
2.2) On the GUI, click 'Run' button to start the simulation. To stop the simulation, you can simply close the GUI window.
... On the GUI when the simulation is running, you should see green cell(s) grows and divides into a colony. Note that you have to to hover your mouse cursor above the GUI to see the updated simulation result. Here is an example of a screen shot:
... In the terminal when the simulation is running, you should see line-by-line printed out simulation result. For each line, the three columns are time point in the simulation, the total number of cells, and the total number of contacts between cells.
... In the 'data' folder inside cellmodeller main folder, you should see a new folder name ex1_simpleGrowth-. Inside this folder you should see a series of *.pickle file which contain simulation output data from each different time pout.
3. Learn about the structure of a simple model.
... Open 'ex1_simpleGrowth.py' in a text editor (We use emacs here). You should see the python code inside 'ex1_simpleGrowth.py'. The code can be divided into the following components
...... a) Package import. The first several lines on the top are for importing relevant python packages for the simulation. We will explain how these packages work later.
...... b) Global variables. Here you will only see 'max_cells' which specifies the maximal number of simulated cells.
...... c) 'setup(sim)'. This part is to setup basic model parameters. For now, we will just look at the part that says 'sim.addCell' which would allow you specify the initial numbers of cell types and their locations. For this particular example, you should only see a single line
sim.addCell(cellType=0, pos = (0,0,0))
This means the model will start with only one cell of type 0 at the position (0,0,0).
...... d) 'init(cell)': this part specifies the size of initial cell(s) and cell growth rates. You should see two lines of codes here
cell.targetVol = 2.5 + random.uniform(0.0,0.5)
This means that initial cells should have average size = 2.5 with variability uniformly distributed from 0 to 0.5
cell.growthRate = 2.0
......says that cells should grow at the rate 2.0
...... e) 'numSignals()': this part specifies cell-cell signalling. We don't have this implemented in our simple cell growth simulation so this part is left empty. --what to this actually do?
...... f) 'numSpecies()': this part specifies intracellular gene network. We don't have this implemented in our simple cell growth simulation so this part is left empty. --what to this actually do?
...... g) 'update(cells)': This part iterates through each cell and flag cells that reach target size for division. It also handles color representation of each cell types displayed in the GUI.
...... h) 'divide(parent, d1, d2)': This part specifies the target cell size that would trigger cell division. --why there are two separated specification for d1 and d2? -- You should see
d1.targetVol = 2.5 + random.uniform(0.0,0.5)
d2.targetVol = 2.5 + random.uniform(0.0,0.5)
...... says that the averaged target size = 2.5 with variability uniformly distributed from 0 to 0.5
4. Experiment on different variants of the simple model through the following exercises:
... a) Simulate 2D growth pattern starting from two cells of different types
...... To do this, go to 'sim.addCell' part of 'setup(sim)' section. Change 'sim.addCell(cellType=0, pos = (0,0,0))' to
sim.addCell(cellType=0, pos = (-10,0,0))
sim.addCell(cellType=1, pos = (10,0,0))
......this will initiate the model with two different cell types located at (-10,0,0) and (10,0,0).
......save as 'ex1a_simpleGrowth2Types.py', start GUI, load and run
... b) Simulate 2D growth pattern with spherical cell
....... To do this, go to 'divide(parent, d1, d2)' part and change the target average cell size (i.e length) from 2.5 to a smaller number, say, 1. Save as 'ex1b_simpleGrowthRoundCell.py', start GUI, load and run