On this wiki page we describe in detail the code that is used to run this example from the paper.
The simulation is a node-based off-lattice simulation. In other words, cells are represented by points
in space (nodes) and are allowed to move without being confined to certain lattice sites.
This example is somewhat unusual, in that we enforce a boundary condition that limits the cells'
movement to a 2D surface in 3D space.
We show use of CellKillers - both random and acting on a plane at the top of the villus.
We also show the use of lineage tracking, and cell-signalling leading to Delta-Notch patterning.
This example uses some source files that can be found in the Plos2013/src folder.
Remember to run with build=GccOptNative for speed.
e.g.
The easiest way to visualize this simulation is with Paraview, as follows. After opening Paraview,
load the file results.pvd, then click “Apply” in the object inspector panel. As this simulation
uses a NodeBasedCellPopulation, you must use glyphs to visualize cells: click the button marked
“Glyph” in the toolbar of common filters; specify cells to be displayed as spheres; then click “Apply”.
The first thing to do is to include the necessary header files.
These methods are cxx-test instructions running before and after each test below.
They are just here to report the time the test took.
The following code is the test itself, we use the scons / cxx-test framework to run simulations, as it
provides a handy way to do all the necessary linking and library building.
First we set up some numbers that will define the crypt and villus geometry
We then create a couple of cells at the base of each crypt.
(we put two cells in each crypt to set off delta-notch patterning)
We then convert this list of nodes to a NodesOnlyMesh,
which doesn’t do very much apart from keep track of the nodes.
Next we have to create the cells that will be associated with these nodes.
So we make an empty vector in which to store the cells and then loop over
each node, adding cells as we go.
This cell cycle model carries a Delta-Notch signalling model,
and also a simple rule about division based on extracellular Wnt concentration.
We choose to initialise the Delta and Notch concentrations to random levels in each cell
We then create a cell with a mutation state (Wild Type in this case), a cell cycle model and an srn model
We now create a cell population, which keeps track of a mesh and cells and the association between them.
In this case we need a NodeBasedCellPopulation in three dimensions.
We limit the absolute movement that cells can make to cause error messages if numerics become unstable
We then instruct the cell population to output some useful information for plotting in VTK format in e.g. paraview
We now set up our cell-based simulation class.
We limit the output to every 120 time steps (1 hour) to reduce output file sizes
We now create a modifier, which updates the delta and notch levels on each timestep.
We now create a force law and pass it to the simulation
We use linear springs between cells up to a maximum of 1.5 (‘relaxed’ cell diameters) apart, and add this to the simulation class.
The most complex part of this problem definition is that of the boundary condition that limits
cell locations to a 2D surface in 3D space. This has been defined in a separate class
MultipleCryptGeometryBoundaryCondition which can be found in this project’s src folder.
We now create an instance of a Wnt concentration.
We then set an end time and run the simulation
These methods provide some reports of how much computation time is spent in which parts of the code.
These would be done automatically at the beginning and end of the test, but we are interrupting mid-way through here.
Having run the simulation to a roughly steady-state, and filled the villus with cells,
we now add a random cell killer to represent random death in the epithelial layer.
We also label each cell according to its current node index so we can track clonal spread
We now solve for a further 750 hours, up to a total of 1000 hours