This tutorial was generated from the file projects/Wisc2013/test/TestCryptProliferationLiteratePaper.hpp at revision r22049.
Note that the code is given in full at the bottom of the page.
Connecting models to data in multiscale multicellular tissue simulations#
For performance, it is recommended to build Chaste using the GccOptNative build type when using
the Functional Curation extension project, on which this code is built. You can run the code shown
below using the commands:
A clean build of Chaste takes a considerable amount of time. If you have multiple cores available
then the process can be sped up greatly using the ‘-j’ flag to scons, e.g.
to build on 4 cores. You can additionally run the code itself in parallel, in order to run each value
in the main parameter sweep simultaneously, using 5 cores with the GccOptNative_5 build type, e.g.
With these settings on our test machine, reproducing the paper results takes about 19 hours.
The first step is to include the header files we need. This code is written as a Chaste test suite, for
easy execution using the Chaste build framework. We thus need to include the TestSuite.h header, along
with various system libraries, Functional Curation headers, and functionality from core Chaste.
This final header, from core Chaste, is needed to enable running in parallel.
The helper method below runs the given protocol on three different cell-based Chaste models,
writing protocol outputs to the given folder.
Optionally some of the protocol inputs may be overridden by providing a non-empty map
as the third argument.
The fourth argument modelsInParallel specifies whether, if multiple processes are available,
to run the protocol on multiple models simultaneously, or whether the protocol should try to
parallelise internally.
If the copyPlots argument is given as true, then all automatically generated results
plots in the sub-folder for each model will be copied to the parent results folder,
with names that include the model name, for easy inclusion in the paper.
If the rCheckResults vector is non-empty, then this list of results data files will be
checked against recorded values, in order to ensure that the simulation results have not changed.
Create the folder to which outputs should be written.
Locate the protocol definition on the file system.
Allow the different models to be run simultaneously, if multiple processes are available.
Loop over available (cell cycle) models.
Get a human readable name for the model to run in this loop iteration.
Output for each model gets written to a sub-folder of the main output folder, named after the model.
Load the model to simulate.
Load the protocol to run on it.
As an alternative to running different models on different processes, the Functional Curation system
can also parallelise nested simulation loops automatically in some circumstances. This line turns
that functionality on if modelsInParallel is false, which is the case for the main parameter sweep.
Thus while generating the steady state plots can use at most 3 processes (corresponding to the 3 cell
cycle models) the parameter sweep can use up to 5 (the number of crypt heights to test).
Override some of the protocol’s inputs if requested.
By default the Functional Curation system uses the plot titles specified in the protocol, and names
the generated files after the title too. However, where multiple models are being simulated under
the same protocol, it is more useful to title plots based on the model name. We also add a sub-figure
index, and adjust the plot page size, so that the generated figures can be included directly in the paper.
Finally, run the protocol on this model, using ‘outputs’ as the prefix for result file names.
Optionally copy generated plots, as described above. We find all .eps files in the sub-folder,
and copy them, with a different name, into the main output folder.
Check against recorded values for specific results files.
If an error occurs while running the protocol etc. we display the error message,
but don’t terminate execution (since the other models may run successfully).
This test runs the inner CryptProliferation protocol on each model, for the default crypt
height of 10 nominal cell diameters. The raw results from the underlying cell-based Chaste
simulation can then be used with the Chaste visualisation tools to produce the crypt schematic
figure in the paper (Figure 1).
To visualise the results, open a new terminal, cd to the Chaste directory,
then cd to anim. Then do:
and
You may have to do “javac Visualize2dCentreCells.java” beforehand to create the java executable.
See ChasteGuides/RunningCellBasedVisualization for more detail on the visualisation tool.
This test runs the main parameter sweep protocol on each of our three variant models, producing
plots (a)-(c) in Figure 2.