Spatial cumulant models enable spatially informed treatment strategies and analysis of local interactions in cancer systems

Theoretical and applied cancer studies that use individual-based models (IBMs) have been limited by the lack of a mathematical formulation that enables rigorous analysis of these models. However, spatial cumulant models (SCMs), which have arisen from theoretical ecology, describe population dynamics generated by a specific family of IBMs, namely spatio-temporal point processes (STPPs). SCMs are spatially resolved population models formulated by a system of differential equations that approximate the dynamics of two STPP-generated summary statistics: first-order spatial cumulants (densities), and second-order spatial cumulants (spatial covariances). We exemplify how SCMs can be used in mathematical oncology by modelling theoretical cancer cell populations comprising interacting growth factor-producing and non-producing cells. To formulate model equations, we use computational tools that enable the generation of STPPs, SCMs and mean-field population models (MFPMs) from user-defined model descriptions (Cornell et al. Nat Commun 10:4716, 2019). To calculate and compare STPP, SCM and MFPM-generated summary statistics, we develop an application-agnostic computational pipeline. Our results demonstrate that SCMs can capture STPP-generated population density dynamics, even when MFPMs fail to do so. From both MFPM and SCM equations, we derive treatment-induced death rates required to achieve non-growing cell populations. When testing these treatment strategies in STPP-generated cell populations, our results demonstrate that SCM-informed strategies outperform MFPM-informed strategies in terms of inhibiting population growths. We thus demonstrate that SCMs provide a new framework in which to study cell-cell interactions, and can be used to describe and perturb STPP-generated cell population dynamics. We, therefore, argue that SCMs can be used to increase IBMs’ applicability in cancer research. Supplementary Information The online version contains supplementary material available at 10.1007/s00285-023-01903-x.


Part I:
The code setup SI.1 Downloading code files
The UF-Software, which was developed by Cornell et al. 2019 can be downloaded from https://doi.org/10.6084/m9.figshare.9633161. The software contains two main parts: the Model Constructor and the Model Simulator.
The Model Constructor is a Wolfram Mathematica toolbox that enables the generation of spatial cumulant model (SCM) and mean-field population model (MFPM) equations. The toolbox comprises five Mathematica packages and requires Mathematica version 10 or greater. After downloading the packages, the packages must be installed in order to be used. This can be done by locating the File-tab in the Mathematica menu-bar and thereafter selecting Install, and entering the following information in the fields, Type of Item to Install: Package, Source: (locate the package), Install Name: (enter the name of the package).
The Model Simulator is a C code that enables the generation of spatio-temporal point processes (STPPs). It requires a C compiler.

SI.1.2 Downloading the pipeline code files
The pipeline developed in this study utilises the UF-Software. Pipeline codes can be downloaded from the code-hosting platform GitHub (https://github.com/SJHamis/SpatialCumulantModels_CancerApplications).

SI.1.3 The structure of code file directories
In order for the pipeline codes to work, the files must be arranged as shown in Figure   Part II: The model implementation pipeline Figure 1 in the main article provides a pictorial overview of the model implementation pipeline. The notation (A1,B1-4,C1-7,D1) used in this document follows that figure. The code files outlined in Sections SI.2-SI.2 describe the biological system presented in Section 3.2 of the main article. Detailed instructions on how to customise the code files to model other systems are provided in this document and via comments embedded in the code files.

SI.2.1 A1: Formulate a model description using RCP-processes
As a first step towards creating STPPs and deriving and SCM equations using the UF-Software, one must describe the modelled system by one or more reactant-catalyst-product (RCP) process (Cornell et al., 2019). Such model descriptions can, for clarity, be presented with the help of RCP-process tables. The UF-Software includes a set of pre-defined RCP-processes, some of which are included in Table SI.I. The software also allows a user to add custom RCP-processes (Cornell et al., 2019). A full biological system can described as a sum of Markov operators so that if we, for example, want to model a biological system in which cells with mark 1 divide, move and die (all in a density-independent way) then, using the tabulated Markov operators, = 1 + 1 + 1 .

Biological process
Reactants (r), An individual with mark in location 1 produces an individual of mark in location 2 with kernel ( 1 − 2 ).
An individual with mark jumps from location 1 to 2 with kernel ( 1 − 2).

Density Independent Death[ , ]
An individual with mark in location 1 dies at rate .
An individual of mark in location 1 induces death in an individual of mark in location 2 with kernel ( 1 − 2 ).

SI.2.2 B1: Define the model description
The Model Simulator reads the RCP-processes model description from a text file. In the pipeline, this text file for the no-drug scenario is named model_definition_STPP/model_no_celldeath.txt. The file can be modified to describe other biological systems. The pre-defined RCP-processes that are included in the UF-Software, and the formats required to include them in model description text files, are listed in the file model_definition_STPP/processes.txt. The UF-Software recognises two types of kernels: Gaussian kernels and Top-Hat kernels, which are respectively written as truncatedGaussian [Integral, StandardDeviation] and tophat [Integral,Radius] in the model description text files, where Integral, StandardDeviation, Radius are numerical values.

SI.2.3 B2: Define the initial point configuration
In this study, we generated the initial cell configurations in silico using the MATLAB code model_defini tion_STPP/initial_cell_configs/cerateInitialCellConfigurations.m. The initial cell configuration data are written to the text files model_definition_STPP/initial_cell_configs/ICC .txt, for =1,2,3. In these text files, the first column denotes cell marks, and the other two columns denote cell coordinates. These text files can be modified to describe other initial cell configurations, which can be generated in silico or obtained be from biological data.

SI.2.4 B3: Generate spatio-temporal point patterns
In order to generate spatio-temporal point patterns from the STPP, a user can run the Bash-script run_STPP_nodrug.sh for the no-drug model from a terminal. In the Bash-scripts, variables can be edited to modify the model definition (RCP_MODEL), initial cell configuration (ICC), the number of spatiotemporal patterns to generate (indicated by the number of for-loops), the size of the spatial domain (for a quadratic domain, the number after option -U denotes the domain side), the simulation time (the number after option -T), the time intervals with which snapshot data will be taken (the number after option -dT). Note that the executable C file STPP_code_files/ppsimulator must be compiled for the Bash-script to work (in Linux systems this can be done by the command line gcc ppsimulator.c -lm -O2 -o ppsimulator), this only needs to be done once. For more information on how to customise the ModelSimulator, we refer the reader to Cornell et al.'s 2019 Supplementary Notes.

SI.2.5 B4: Evaluate point pattern data
The MATLAB file cumulant_data/STPPAnalyser_files/measure_cumulants_from_pointpatterndat a.m can be run to generate approximate spatial cumulant data from point pattern data. More precisely, the file calculates mean, one standard deviation, minimum and maximum densities for all subpopulations at the sampled time points. The file also calculates mean, one standard deviation, minimum and maximum spatial covariances for all possible cell-mark pairs at user-defined time points (as a default, selected to be the initial, middle and final time points of the STPP simulations). These calculations utilise the Cross-Correlation Theorem. A user can modify the number of marks (e.g., denoting cell types) in the MATLAB file by modifying the variable no_subpops. Output files are located in the folder cumulant_data/vi, where i corresponds to the ICC.

SI.2.6 C1-C2: Define the model description and generate SCM equations
By defining application-specific model description in the Mathematica Notebook MathematicaNotebooks /generateODEs.nb, SCM (and thus also MFPM) equations can be generated. Instructions on how to modify model descriptions are provided in the Notebook.

SI.2.7 C3-C7: Calculate SCM dynamics and compare with STPP and MFPM dynamics
The Mathematica Notebook MathematicaNotebooks/SCMSolver.nb can be used to (1) visualise snapshot data, (2) visualise spatial cumulant data, (3) calculate SCM and MFPM dynamics and (4) generate plots to visually compare STPP, SCM and MFPM dynamics. This Notebook produces the plots shown in Figure 3 and 4 in the main article. Instructions on how to modify the code to describe other user-defined biological systems are provided in the Notebook.

SI.2.8 D1: Analyse SCM and MFPM equations
The Mathematica Notebook MathematicaNotebooks/deriveDeathRateExpressions.nb is used to symbolically derive the MFPM and SCM informed death rates.