Supplementary data
Analysis and modeling of the inverted bioconvection in Chlamydomonas reinhardtii: Emergence of plumes from the layer of accumulated cells
Naoki Sato, Kaoru Sato, and Masakazu Toyoshima
Contents
Supplementary Document S1. Simulation of plume formation
Supplementary Document S1: Simulation of plume formation
Note that Cell2 is in Mode 1, and Cell3 is in Mode 2. Scripts for CompuCell3D follow.
1. Software: CompuCell3D version 3.7.4
2. Simulation in 2D square lattice (800 px × 800 px) with x axis directing to the right and y axis directing to the top.
3. Two types of cells: Cell2 and Cell3. Cell volume = 25, cell surface = 20, Neighboring order = 4.
4. Cell2 emerges in the emerging region Em(x = odd number, 790 ≦ y ≦ 795) every 100 frames with the probability at 0.5.
5. Direction of the movement of Cell2 is determined every 10 frames with a vector pointing to the random point on the half circle below it. The force is 100 (internally defined unit) irrespective of the direction.
6. The cells accumulate at the bottom of the space with time.
7. If a Cell2 becomes the neighbor of n Cell2, then it becomes Cell3 with the probability p. At the same time, all neighboring Cell2 also become Cell3 with the probability at 0.5. The formation of Cell3 normally occurs within the cell layer at the bottom.
8. Direction of the movement of Cell3: the x component of the movement is determined randomly within [-50, 50] every 10 frames, whereas the y component is kept at 100 (upward).
9. Although Cell3 can move independently, the neighboring relationship with other Cell3 may be kept for some duration within the crowded cell layer.
10. If a Cell3 loses all neighbors, it becomes Cell2 which begins to move downward.
11. If a Cell3 attains the region above y ≧ 790, it disappears.
12. A repulsive force at 30 is acting between two Cell2. A weak attractive force at 10 is acting between two Cell3 or between a Cell3 and a Cell2.
13. The simulation is run with varying p and n.
The actual scripts for the simulation are shown on the following pages.
Chlamy.py
import sys
from os import environ
from os import getcwd
import string
sys.path.append(environ["PYTHON_MODULE_PATH"])
import CompuCellSetup
sim,simthread = CompuCellSetup.getCoreSimulationObjects()
# add extra attributes here
CompuCellSetup.initializeSimulationObjects(sim,simthread)
# Definitions of additional Python-managed fields go here
#Add Python steppables here
steppableRegistry=CompuCellSetup.getSteppableRegistry()
from ChlamySteppables import ChlamySteppable
steppableInstance=ChlamySteppable(sim,_frequency=10)
steppableRegistry.registerSteppable(steppableInstance)
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
Chlamy.xml
<CompuCell3D Revision="20150808" Version="3.7.4">
<Potts>
<!-- Basic properties of CPM (GGH) algorithm -->
<Dimensions x="800" y="800" z="1"/>
<Temperature>15.0</Temperature>
<NeighborOrder>4</NeighborOrder>
</Potts>
<Plugin Name="NeighborTracker"/>
<Plugin Name="ExternalPotential"/>
<Plugin Name="CenterOfMass"/>
<Plugin Name="PixelTracker"/>
<Plugin Name="Volume">
<TargetVolume>25</TargetVolume>
<LambdaVolume>60</LambdaVolume>
</Plugin>
<Plugin Name="Surface">
<TargetSurface>20</TargetSurface>
<LambdaSurface>2</LambdaSurface>
</Plugin>
<Plugin Name="CellType">
<!-- Listing all cell types in the simulation -->
<CellType TypeId="0" TypeName="Medium"/>
<CellType TypeId="1" TypeName="Cell1"/>
<CellType TypeId="2" TypeName="Cell2"/>
<CellType TypeId="3" TypeName="Cell3"/>
</Plugin>
<Plugin Name="Contact">
<Energy Type1="Medium" Type2="Medium">8</Energy>
<Energy Type1="Medium" Type2="Cell1" >8</Energy>
<Energy Type1="Medium" Type2="Cell2" >8</Energy>
<Energy Type1="Medium" Type2="Cell3" >8</Energy>
<Energy Type1="Cell1" Type2="Cell1" >50</Energy>
<Energy Type1="Cell1" Type2="Cell2" >0</Energy>
<Energy Type1="Cell1" Type2="Cell3" >0</Energy>
<Energy Type1="Cell2" Type2="Cell2" >30</Energy>
<Energy Type1="Cell2" Type2="Cell3" >-10</Energy>
<Energy Type1="Cell3" Type2="Cell3" >-10</Energy>
<NeighborOrder>2</NeighborOrder>
</Plugin>
</CompuCell3D>
ChlamySteppables.py
from PySteppables import *
import CompuCell
import sys
from random import uniform
from math import *
#List of conditions
p = [0.005,0.005,0.005,0.005,0.005,0.005,0.005,0.005]
n = [ 6, 6, 6, 6, 6, 6, 6, 6]
#Number of steps for each simulation
s = 80000
#Total steps
S = len(p)*s
class ChlamySteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=10):
SteppableBasePy.__init__(self,_simulator,_frequency)
def start(self):
# any code in the start function runs before MCS=0
self.changeNumberOfWorkNodes(8)
self.setMaxMCS(S+1)
def step(self,mcs):
#type here the code that will run every _frequency MCS
#when all simulations end
if mcs==S:
self.cellField[200:600,200:600,0] = self.newCell(self.CELL1)
#for normal steps
else:
#Reset screen for each start of simulation
if mcs%s==0:
for cell in self.cellList:
self.deleteCell(cell)
#Create Cells
if mcs%100==0:
for i in range(self.dim.x):
if uniform(0.0,1.0)<0.5:
self.cellField[i*10:i*10+5,self.dim.y-10:self.dim.y-5,0] = self.newCell(self.CELL2)
#Set speed of cells
for cell in self.cellList:
if cell.type==self.CELL2:
theta=uniform(0.0,1.0)*pi
cell.lambdaVecX=cos(theta)*100
cell.lambdaVecY=sin(theta)*100
elif cell.type==self.CELL3:
cell.lambdaVecX=100*uniform(-0.5,0.5)
cell.lambdaVecY=-100
#Cell2 to Cell3
for cell in self.cellListByType(self.CELL2):
counter=0
for neighbor , commonSurfaceArea in self.getCellNeighborDataList(cell):
counter+=1
if counter == n[int(mcs/s)]:
if uniform(0.0,1.0) < p[int(mcs/s)]:
cell.type=self.CELL3
for neighbor , commonSurfaceArea in self.getCellNeighborDataList(cell):
if neighbor and self.attemptFetchingCellById(neighbor.id).type==self.CELL2:
if uniform(0.0,1.0)<0.50:
self.attemptFetchingCellById(neighbor.id).type=self.CELL3
break
#Cell3 to Cell2
for cell in self.cellListByType(self.CELL3):
if cell.yCOM>self.dim.y-10:
self.deleteCell(cell)
else:
for neighbor , commonSurfaceArea in self.getCellNeighborDataList(cell):
if neighbor and self.attemptFetchingCellById(neighbor.id).type==3:
break
else:
cell.type=self.CELL2
def finish(self):
# Finish Function gets called after the last MCS
pass
Chlamy.cc3d
<Simulation version="3.6.2">
<XMLScript Type="XMLScript">Simulation/Chlamy.xml</XMLScript>
<PythonScript Type="PythonScript">Simulation/Chlamy.py</PythonScript>
<Resource Type="Python">Simulation/ChlamySteppables.py</Resource>
</Simulation>
1