Documentation for Release 2024.1
Running Crypt Simulations With Mutations
This tutorial is automatically generated from TestRunningCryptSimulationsWithMutationsTutorial.hpp at revision 66cf8dbe76c3. Note that the code is given in full at the bottom of the page.
Examples showing how to run crypt simulations with various mutations
Introduction
This tutorial assumes you have already read the tutorial Running Mesh Based Simulations.
In this tutorial we show how Chaste can be used to simulate a cylindrical model of an intestinal crypt with mutations using both mesh and vertex-based simulations. Full details of the computational model can be found in the paper by Osborne et al. (2010) 10.1098/rsta.2010.0173.
As in previous cell-based Chaste tutorials, we begin by including the necessary header files.
The next header file defines a helper class for generating cells for crypt simulations.
The next header file defines a WntCellCycleModel
, where the proliferative behaviour of a cell is
dependent on the concentration of Wnt at that point in space. Cells proliferate where there is a plentiful level of Wnt
and cease proliferation below a given threshold.
The next header file defines a helper class for generating a suitable triangular mesh for the crypt simulation, such that the cell corresponding to each node is initially in mechanical equilibrium with its neighours and periodic boundary conditions are applied at the left- and right-hand sides of the mesh (hence the “cylindrical”).
The next header file defines a CellPopulation
class that uses a triangular mesh, and allows
for the inclusion of ‘ghost nodes’. These are nodes in the mesh that do not correspond
to cells; instead they help ensure that a sensible Delaunay triangulation is generated
at each timestep. This is because the triangulation algorithm requires a convex hull.
The next header file defines a force law, based on a linear spring, for describing the mechanical interactions between neighbouring cells in the crypt.
The next header file defines the class that simulates the evolution of a CellPopulation
,
specialized to deal with the cylindrical crypt geometry.
The next header file defines a Wnt singleton class, which (if used) deals with the
imposed Wnt gradient in our crypt model. This affects cell proliferation in the case
where we construct each cell with a WntCellCycleModel
.
The next header file defines a cell killer class, which implements sloughing of cells into the lumen once they reach the top of the crypt.
These headers are used for defining and recording mutations.
The final header ensures that this test is only ever run sequentially, not in parallel.
Next, we define the test class, which inherits from AbstractCellBasedTestSuite
and defines some test methods.
Test 1: a mesh-based crypt simulation with mutations
In the first test, we demonstrate how to introduce mutations into a simulation of a crypt.
Note that time is re-initialized to zero and the random number generator is re-seeded to zero in the AbstractCellBasedTestSuite
.
We first create a cylindrical mesh, and get the cell location indices, exactly as before.
We create the cells, using the same method as before. Here, though, we use a SimpleWntCellCycleModel
.
We now create boost shared pointers to any mutations we wish to use.
We need to do this using the CellPropertyRegistry
, otherwise
the numbers of each type of mutation aren’t correctly tracked. For
a list of possible mutations, see subclasses of AbstractCellMutationState
.
These can be found in the
inheritance diagram for AbstractCellMutationState.
Each mutation has a different effect on the cell cycle models; see the class
documentation for details.
We create the cell population, as before.
In order to visualize mutant cells and to count how many cells there are of each type we need to use the following command.
We set the height of the crypt. As well as passing this variable into the SloughingCellKiller
,
we will pass it to the WntConcentration
object (see below).
When using a SimpleWntCellCycleModel
, we need a way of telling each cell what the Wnt concentration
is at its location. To do this, we set up a WntConcentration
object. Like SimulationTime
,
WntConcentration
is a singleton class, so when instantiated it is accessible from anywhere in
the code (and in particular, all cells and cell-cycle models can access it). We need to say what
the profile of the Wnt concentation should be up the crypt: here, we say it is LINEAR
(linear
decreasing from 1 to 0 from the bottom of the crypt to the top). We also need to inform the
WntConcentration
of the cell population and the height of the crypt.
Create a simulator as before (except setting a different output directory).
As before, we create a force law and cell killer and pass these objects to the simulator, then call
Solve()
.
Now we have run the simulation to a steady state (where the initial regular configuration is lost) we select a cell to become mutant.
We select one of the cells and set the mutation state to ApcTwoHitCellMutationState
(i.e. p_state
).
We also change the value of the damping constant for mutant cells to be ten times the normal value.
Next we reset the end time to some later time.
Run the simulation to the new end time.
Finally, we must tidy up by destroying the WntConcentration
singleton object. This avoids memory leaks occurring.
To visualize the results, open a new terminal, cd
to the Chaste directory,
then cd
to anim
. Then do: java Visualize2dCentreCells /tmp/$USER/testoutput/MeshBasedCryptWithMutations/results_from_time_0
.
These are the results before we add the mutations do: java Visualize2dCentreCells /tmp/$USER/testoutput/MeshBasedCryptWithMutations/results_from_time_10
to see the results from after the mutation has been added.
We may have to do: javac Visualize2dCentreCells.java
beforehand to create the
java executable.
In the results folder there is also a file cellmutationstates.dat
which tracks the numbers of each mutation type in the simulation.
These results are just tab separated columns so may be visualized by using gnuplot, Matlab or similar.