Agent-based model (ABM) of CLL and microenvironment interactions built on PhysiCell/BioFVM.
This repository is a custom PhysiCell project with:
- CLL-related cell populations (cancer, monocytes, macrophages, NLCs, apoptotic, dead)
- Diffusive signaling fields (cytokines, antiapoptotic, stress)
- Cell behavior rules loaded from CSV (CBHG rules)
The simulation represents interactions among CLL cells and immune/stromal-like populations in a 2D tissue domain.
Core runtime flow:
- Load XML configuration.
- Initialize substrates (BioFVM).
- Initialize cell definitions and rules.
- Seed cells from CSV initial conditions.
- Simulate diffusion + cell updates over time.
- Save snapshots to
output/.
Relevant implementation files:
main.cpp: entry point, simulation loop, outputscustom_modules/custom.cpp: cell setup, rule initialization, tissue seedingconfig/NLC_CLL.xml: model/domain/cell definitions and file wiringconfig/rules0.csv: behavior rulesconfig/cells.csv: initial cell positions and cell types
Primary config file: config/NLC_CLL.xml
- 2D domain (
use_2D=true), box: x/y from -500 to 500 microns, z thin slab - Duration:
max_time = 18720 min(13 days) - Time steps:
- diffusion:
dt_diffusion = 0.01 min - mechanics:
dt_mechanics = 0.1 min - phenotype:
dt_phenotype = 6 min
- diffusion:
- Parallel threads:
omp_num_threads = 4
The model defines three diffusive signals:
cytokinesantiapoptoticstress
These appear in microenvironment_setup and are used by chemotaxis, secretion/uptake, and cell rules.
Defined in <cell_definitions>:
cancermonocytesmacrophagesNLCsapoptoticdead
Key characteristics by type (from config/NLC_CLL.xml):
cancer- motile (
speed=1), chemotaxis towardantiapoptotic - secretes cytokines, uptakes antiapoptotic
- baseline transformation toward apoptotic state exists
- motile (
monocytes- slow motility (
speed=0.1), chemotaxis towardstress - uptake of cytokines/stress
- phagocytosis of apoptotic/dead cells
- can transform to
macrophagesandNLCs(rule-modulated)
- slow motility (
macrophages- similar motility pattern to monocytes
- phagocytosis of apoptotic/dead cells
- can attack cancer and induce damage
- can transform to
NLCs(rule-modulated)
NLCs- motile, chemotaxis toward stress
- antiapoptotic secretion (important for CLL survival support)
- moderate phagocytosis and adhesive interactions
apoptoticanddead- represent CLL progression states and debris-like populations
- feed back into stress/cytokine dynamics and phagocytic behaviors
Configured under <initial_conditions>:
- cell positions loaded from CSV:
- folder:
config - filename:
cells.csv
- folder:
In this project, this CSV seeding is the practical initializer (the generic number_of_cells parameter is set to 0, so random per-type placement in custom.cpp is effectively disabled by default).
Rules are enabled in XML via:
<cell_rules><rulesets><ruleset ... format="csv" ...>- loaded from
config/rules0.csv
The parsed rule summary is visible in output/detailed_rules.txt after running.
Main rules in this model:
- contact with NLCs decreases migration speed
- damage increases transform to apoptotic
- antiapoptotic decreases transform to apoptotic
- stress increases phagocytose apoptotic
- stress increases phagocytose dead
- cytokines increases transform to macrophages
- intracellular stress increases transform to NLCs
- intracellular cytokines increases transform to NLCs
- stress increases phagocytose apoptotic
- stress increases phagocytose dead
- intracellular stress increases transform to NLCs
- intracellular cytokines increases transform to NLCs
- stress increases phagocytose apoptotic
- stress increases phagocytose dead
- contact with cancer increases antiapoptotic secretion
Interpretation: NLC contact and antiapoptotic signaling support CLL survival, while stress/cytokine pathways regulate myeloid-to-NLC transitions and clearance phenotypes.
These commands follow normal PhysiCell usage patterns from the official MathCancer repository (compile with make, clean with make clean, clear outputs with make data-cleanup) adapted to this project.
- Linux/macOS
g++with OpenMP supportmake- Optional (post-processing): Python 3 + packages used in
scripts/
make clean
makeThis creates executable project (see PROGRAM_NAME := project in Makefile).
./project config/NLC_CLL.xmlImportant: this repository does not rely on the default ./config/PhysiCell_settings.xml at launch. Pass config/NLC_CLL.xml explicitly.
make data-cleanupmake clean # remove objects and executable
make jpeg # convert SVG snapshots to JPG (ImageMagick required)
make movie # build MP4 from snapshots (ffmpeg required)Simulation outputs are written to output/, including:
initial.svg,final.svgoutput00000000.xml-style MultiCellDS snapshotsdetailed_rules.txtanddetailed_rules.htmldictionaries.txt(signals and behaviors dictionary)
Example script:
scripts/run_model.py
It runs multiple iterations and writes aggregate CSV metrics into data/.
Example:
python scripts/run_model.py 10This uses:
scripts/collect_data.pyconfig/NLC_CLL.xml- output snapshots in
output/
This project follows the standard PhysiCell project structure and Makefile workflow from:
In particular:
makecompilesmake cleanremoves build artifactsmake data-cleanupresets output data
The main difference is model-specific configuration and rules:
- XML:
config/NLC_CLL.xml - rules:
config/rules0.csv - initial cell layout:
config/cells.csv
If you use this model, cite PhysiCell and BioFVM as requested in source headers (main.cpp, custom_modules/custom.cpp).
Primary PhysiCell reference:
- Ghaffarizadeh A, Heiland R, Friedman SH, Mumenthaler SM, Macklin P. PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellular Systems. PLoS Comput Biol. 2018;14(2):e1005991.