Abstract
Physiological and pathological processes such as inflammation and cancer emerge from interactions between cells over time1. However, methods to follow cell populations over time within the native context of a human tissue are lacking because a biopsy offers only a single snapshot. Here we present one-shot tissue dynamics reconstruction (OSDR), an approach to estimate a dynamical model of cell populations based on a single tissue sample. OSDR uses spatial proteomics to learn how the composition of cellular neighbourhoods influences division rate, providing a dynamical model of cell population change over time. We apply OSDR to human breast cancer data2,3,4, and reconstruct two fixed points of fibroblasts and macrophage interactions5,6. These fixed points correspond to hot and cold fibrosis7, in agreement with co-culture experiments that measured these dynamics directly8. We then use OSDR to discover a pulse-generating excitable circuit of T and B cells in the tumour microenvironment, suggesting temporal flares of anticancer immune responses. Finally, we study longitudinal biopsies from a triple-negative breast cancer clinical trial3, in which OSDR predicts the collapse of the tumour cell population in responders but not in non-responders, based on early-treatment biopsies. OSDR can be applied to a wide range of spatial proteomics assays to enable analysis of tissue dynamics based on patient biopsies.
Similar content being viewed by others
Main
Physiological processes involve cell populations that change over time1. Some cell populations expand and others are removed, as occurs in development and in the immune response to pathogens9. A clinically important example of changing cell populations is the evolution of the cancer microenvironment, in which the growing tumour recruits stromal and immune cells that are crucial for tumour survival10,11. Understanding cell population dynamics and the underlying cell–cell communication circuits is a major goal of tissue biology, and can enable new treatment strategies based on sculpting cell populations in desired ways7,12.
However, measuring the dynamics of cell populations in human tissues is currently very difficult. Biopsies provide a single snapshot, and taking multiple biopsies from a single patient is infeasible and does not provide longitudinal evidence from the same cells.
Current strategies to measure tissue dynamics do not apply to human biopsies. For example, cell lines, mice, organ-on-a-chip13 or organoid models14 are treated as replicas and are analysed at different time points. Ex vivo tissues can be followed over time but lack the native physiological context. Intravital fluorescence microscopy has made it possible to follow living cells within animal models15,16. Recent advances use synthetic biology to engineer cells to record their activity or lineage17,18. These approaches are restricted to animal models or in vitro settings, limiting their ability to capture the complexity of in vivo dynamics in humans.
The emergence of single-cell technologies offers new opportunities for studying tissues at high resolution. Notable approaches use single-cell data for understanding cell–cell communication at a single time point19,20,21,22. Other approaches attempt to infer dynamics of processes such as transcription within individual cells on a timescale of hours. Examples include RNA velocity, ergodic rate analysis and Zman-seq23,24,25. These methods do not address the challenge of understanding how cell populations change on the tissue level, processes that could take days to weeks.
Here we present an approach to estimate cell population dynamics based on a spatial biopsy snapshot (Fig. 1a). This approach, OSDR, is based on using a cell division marker to determine division rates as a function of neighbourhood composition, providing a dynamical model of how cell populations change over time. We applied OSDR to human breast cancer spatial proteomics samples from three large cohorts2,3,4. OSDR reconstructs a fibroblast–macrophage circuit with two steady states of hot and cold fibrosis5,7, in agreement with co-culture experiments that measure dynamics directly8. We then used OSDR to discover a pulse-generating excitable circuit of T and B cells, suggesting that cancer surveillance in the tumour microenvironment operates in temporal flares, as opposed to the steady-state picture implicit in current literature. Finally, we validated OSDR using longitudinal data from patients with triple-negative breast cancer who received either chemotherapy or chemotherapy and immunotherapy. In both treatment regimes, OSDR predicted the collapse of the tumour cell population in responders but not in non-responders, based on biopsies at treatment initiation. The present approach opens the way to infer cell population dynamics from spatial snapshots of patient biopsies.
a, OSDR uses spatial proteomics of a biopsy to infer cell population dynamics. The illustration was created by Nigel Orme. b, The division probability is learned based on the number of cells of each type in the neighbourhood. c, Cell division rates are inferred from a cell division marker (Ki67). d, Rate of change in the number of cells \(X\) is the difference between divisions and removals as described by a stochastic model. e, Simulations can take an initial spatial arrangement of cells and propagate the populations over time. f, OSDR also provides a phase portrait showing the direction of change of cell populations as a function of their neighbourhoods, revealing fixed points.
Tissue dynamics from a spatial snapshot
The aim of this study was to introduce a method for inferring a dynamical model of cell populations based on a single tissue sample (Fig. 1a). We considered biopsy sections with cell-type markers and cell division markers. From this data, we generated a list of cell coordinates and division status for each cell type. We used imaging mass cytometry (IMC) samples2,3,4 and the division marker Ki67 (Methods), but in principle, other spatial proteomic or transcriptomic assays can be used (Methods).
The key idea is to use a spatial omics snapshot to estimate the division and removal rates of cells as a function of the composition of the neighbourhood of the cell. We call this approach OSDR. Its essential advance is the use of division rates measured at the level of single cells at one time point to produce dynamics at the tissue level.
The change in cell counts within a tissue is a balance between division, death and migration. We separated the dynamics into two parts: one part that results from cell division and death within a tissue, and a second part that results from influx of cells from circulation. Our work focused on inferring cell division and death. We then used this estimated component to quantify the net contribution of migration from external sources of cells (Methods; Supplementary Figs. 3m,n and 4m,n). In our analyses, local proliferation and removal were sufficient to explain the cell population dynamics, but this might not be the case in settings with a massive influx of cells.
To estimate the effect of each cell type on the growth and removal of other cells, we assumed that the neighbourhood surrounding each cell contains growth factors secreted by nearby cells. We thus tabulated, for each cell in a slide, its type, as well as the number and types of cells within a radius \(r\) (Fig. 1b). We used r = 80 µm based on measurements of in vivo cell–cell interaction ranges26 (Methods). The ability of neighbourhood composition to predict division rates, as well as the inferred dynamics, are not sensitive to this choice of radius \(r\) (Supplementary Figs. 2e, 3f and 4g).
We defined division events using Ki67 thresholds based on experiments in human cell lines by Uxa et al.27 (Methods; Fig. 1c). By using data on many different neighbourhoods, available from the spatial heterogeneity of the samples, we obtained the probability of division as a function of neighbourhood cell composition (Methods; Fig. 1d).
This approach is precise when cells across the sample obey the same underlying dynamics. In reality, varying proximity to blood vessels or tumour mass can create zones with different levels of metabolites, hypoxia, inflammation and other factors that can affect the dynamics29. To control for these effects, we show below that the estimated dynamics are preserved across such zones by including terms for density of endothelial or tumour cells in our model (Supplementary Figs. 3h and 4h). We also show that the estimated dynamics are preserved across various patient subgroups defined by external factors such as tumour genetics or stage (Supplementary Figs. 3i and 4i,j).
Ideally, one would also like a marker for cell death, but currently available markers are not considered to be sufficient to quantify the diverse forms of cell death28. To make progress, we bypassed the death marker by assuming that the death rate is a constant for each cell type, namely, that the removal rate is not affected by the composition of the neighbourhood of the cell. We found that the results are robust to wide variations in the value of this constant removal rate (Supplementary Figs. 3g and 4e). We therefore approximate the removal rate by the mean division rate for each cell type, an assumption that is exact in the case of (quasi) steady-state tissues in which mean removal and division rates are equal.
We used the estimated models for cell division and death to produce dynamics of cell populations at the scale of a tissue. To produce a trajectory of tissue composition over time, we performed the following steps. We computed the probabilities for division and death for each cell in the tissue. We then used the computed probabilities to sample division and death events for each cell. We added a new cell next to each dividing cell and removed cells that died. This produces the composition of the tissue after one time step ∆T. By repeating this process, we obtained a trajectory of tissue composition over time (Fig. 1e).
In addition to these detailed trajectories, our approach allowed a second perspective to study the circuitry of cell interactions in a manner that does not depend on the spatial organization of a specific tissue. To do so, we analysed the dynamical system of neighbourhood composition dynamics (Fig. 1f). Each neighbourhood composition was mapped to a location in a state-space where each axis corresponds to the number of cells of one cell type (Fig. 2a). Plotting the direction of change for each possible neighbourhood composition produced a phase portrait (Fig. 2b,c), in which arrows mark the direction and magnitude of the rate of change. The phase portrait provides an overview of the dynamics, including its stable and unstable fixed points. Figure 2a–c denotes two cell types for ease of visualization, yet this approach can provide phase portraits with numerous cell types as shown below.
a, Neighbourhood composition maps to a location in state-space. b, The phase portrait shows the change in neighbourhood composition. c, The phase portrait corresponds to a set of ordinary differential equations, which are derived from the stochastic model using the mean direction of change. d, OSDR accurately reconstructs neighbourhood dynamics from simulations of known dynamical circuits based on simulated data of 10,000 cells of each type. ‘Known’ panels (left) display the ground-truth phase portrait of the system used to generate the simulated spatial data. The arrows indicate directions of change, and the coloured lines are nullclines in which only one cell type changes. The black and white dots are stable and unstable fixed points, respectively. ‘Inferred’ panels (right) display the estimated OSDR fixed points from ten simulations, for the four two-cell phase-portrait topologies, as well as the inferred phase portrait from the first simulation of the ten.
We thus obtained two outcomes: stochastic simulation starting from the tissue sample initial condition and phase-portrait analysis, which provides a general view of the dynamics. The phase portrait describes the cell-circuit ‘rules’ that govern local neighbourhoods. The simulations propagate these rules starting from a given initial condition. The two views complement each other. The phase portrait allows an overview of the fixed points of the system and basins of attraction; it does not include the effects of initial spatial conditions, which can influence the dynamics (Methods; Supplementary Fig. 1h–m). By contrast, the simulations provide a detailed account of a given tissue sample initial condition, but if the sample is small or not representative of other parts of the tissue, simulation might miss the larger picture provided by the phase portrait.
To test the feasibility of the OSDR approach, we began with simulated data. We asked how many cells are required to reconstruct a known dynamical system. In each simulation, we specified a certain dynamical system in which cells affect the growth rate of each other. We then simulated experimental spatial data by running the dynamics from various initial conditions of cell density, for a period of time that results in distributions of spatial cell concentrations that resemble experimental data. This created various cell compositions. We then fit OSDR to the simulated data and compared the estimated phase portrait with the phase portrait of the known dynamical system used in each simulation.
We simulated all possible phase-portrait topologies of two cell types, in which each cell type can be stable on its own or stable only in the presence of the other cell type. This resulted in four phase-portrait topologies (Fig. 2d). A few thousand cells of each type were sufficient to reliably reconstruct the fixed points and basins of attraction (Supplementary Fig. 2g–o). We conclude that the OSDR algorithm can reconstruct simple 2D dynamics from simulated cell data and recover the underlying phase portrait given enough cells.
OSDR infers fibroblast–macrophage dynamics
To test ODSR, we analysed an extensive spatial proteomics dataset by Danenberg et al.2 (IMC; Methods). Data included biopsies from 715 patients with breast cancer (Methods). The samples included various breast cancer genotypes and stages. Each sample was an approximately 500 µm × 500 µm tissue section. The samples included a total of 859,710 cells. Cell types were identified using standard markers and include fibroblasts, macrophages, endothelial cells, adaptive immune cells and epithelial cells. We adopted the cell-type definitions from the original publication2 (Supplementary Fig. 2a). The data included the Ki67 division marker.
As OSDR infers division probability (Ki67 > threshold) based on the identity of neighbouring cells, we first asked whether variation in Ki67 is indeed explained by the composition of the neighbourhoods of the cells in the data. This is not obvious, because this variation may stem from unmeasured factors such as gradients of nutrients, hypoxia or inflammation29. We performed logistic regression with cell counts as features (number of neighbouring cells of each type) and Ki67 as target (Ki67 over threshold; Methods). We found that cell counts accurately capture a wide range of division rates (Fig. 3a and Supplementary Fig. 2b). All fits were significant (log-likelihood ratio test P < 10−13; Supplementary Fig. 2c,d). We conclude that the counts of neighbouring cells are strong predictors of division rates.
a, Statistical inference using IMC data from 715 human breast cancer biopsies2 captures a wide range of division probabilities based on cell counts in the neighbourhood. Each dot corresponds to a subset of 4,000 cells (859,710 cells in total). b, The breast cancer microenvironment includes interactions between cancer-associated fibroblasts and macrophages. The illustration was created by Nigel Orme. c, The in vitro co-culture experiments of Mayer et al.8 followed fibroblast and macrophage cells in breast cancer conditioned medium (red arrows) or standard medium (grey arrows) to establish a phase portrait with several fixed points (coloured circles).The arrows are changes in cell concentration over 4 days. Panel c was reproduced from ref. 8, Springer Nature Ltd, under a Creative Commons licence CC BY 4.0. d, Ki67 marker in fibroblasts as a function of neighbourhood composition (Methods). Each point corresponds to one fibroblast (69,873 cells), and its position is the composition of the neighbourhood of that cell. The blue line separates inferred regions of rising and falling cell numbers (inferred nullcline). The black contours represent density. e, Same as d but for macrophages (3,761 cells). f, OSDR inferred phase portrait for breast cancer-associated fibroblasts and macrophages. Black, black–white and white circles are stable, semi-stable and unstable fixed points, respectively. g, Phase portraits of fibroblasts and macrophages in an OSDR model that includes tumour cells. The panels show sections of the 3D phase portrait at low (left) or high (right) tumour density (tumour cells fixed at zero or at their mean density of 64 cells per neighbourhood, respectively). Circles are as in g. h, Kaplan–Meier curves for patients whose biopsies indicate hot or cold fibrosis (defined by a macrophage density of more than the halfway point between hot and cold fibrosis fixed points). The hot-fibrosis state is associated with poor prognosis (log-rank test P = 0.0046, n = 607 patients with associated clinical data). The shading indicates 95% confidence intervals based on Greenwood’s exponential formula38.
The predictive ability of neighbouring cell counts could be explained by a number of factors (Supplementary Fig. 2f). Growth factor concentrations are influenced by the number of secreting and consuming cells in a neighbourhood26,30. Neighbour counts also reflect the chance of a cell to directly contact another cell, capturing processes such as contact inhibition and signalling via direct contact. Some cell types influence tissue hypoxia (endothelial cells and cancer cells) and inflammation (for example, macrophages and lymphocytes), processes that affect cell proliferation. Counts of such cell types might reflect the extent of hypoxia or inflammation in a region.
In some systems (for example, rapidly proliferating immune or developmental contexts), the assumption might not hold that the proliferation dynamics only depend on the current observed neighbourhood composition, and not on the history of neighbourhood compositions. We therefore recommend testing whether the division rate of each cell is predicted accurately based only on the current number of cells in its neighbourhood (as in Fig. 3a and Supplementary 2b–d). If this is not the case, the current approach is not relevant.
We compared OSDR to recent work that established in vitro dynamics for fibroblasts and macrophages in a breast cancer medium8, supplying a reference phase portrait for the dynamics of these two cell populations. The in vitro phase portrait was obtained by seeding mice mammary fibroblasts and bone marrow-derived macrophages at different initial concentrations in co-cultures and following the changes in the cell populations over several days (Fig. 3b). This is a measurement of the population-level dynamics. In the presence of breast cancer-conditioned medium, fibroblast and macrophage cells showed a phase portrait with several distinct fixed points (Fig. 3c). Fibroblasts and macrophages supported each other in a fixed point called ‘hot fibrosis’, in the sense that both fibroblasts and macrophages coexist. Fibroblasts alone could support themselves in a ‘cold fibrosis’ fixed point. Macrophages were induced by the cancer-conditioned medium to form a macrophage-only fixed point at high macrophage densities.
The OSDR phase portraits from breast cancer samples provide dynamics for fibroblasts and macrophages (Fig. 3f). We included all fibroblast and macrophage subsets defined by Danenberg et al.2 (Supplementary Fig. 2a). Similar results are found when considering neighbourhoods without adaptive immune cells, which were not present in the in vitro experiments, or including all neighbourhoods and adding terms for adaptive immune cells in the model (Supplementary Fig. 4k).
Of note, the reconstructed phase portrait shares most of the key features of the in vitro portrait (Fig. 3c,f). There is a stable fixed point in which fibroblasts and macrophages support each other, namely, a hot fibrosis fixed point. There is a cold fibrosis fixed point with fibroblasts only. There is a third semi-stable fixed point with high numbers of macrophages without fibroblasts.
We tested the robustness of the OSDR phase portrait. The fixed-point structure of the phase portrait is robust to resampling of cells and samples (Supplementary Fig. 3b–d). It is also consistently found in a wide range of parameter choices (neighbourhood radius and Ki67 threshold; Supplementary Fig. 3e,f) and death rates (Supplementary Fig. 3g), inclusion of endothelial or tumour cells in the statistical model (Supplementary Fig. 3h), or when considering only patient subgroups with specific cancer stage, tumour size, breast cancer genotype, patient survival time or type of treatment (Supplementary Fig. 3i).
We conclude that the reconstructed phase portrait captures the salient features of the in vitro phase portrait. Whereas the in vitro phase portrait used dynamical measurements of cell populations over days, the reconstructed portrait uses a single snapshot with cell density and division information.
We then asked whether cancer cells control the transition between cold and hot fibrosis. We used OSDR to fit a 3D model of cancer cell–fibroblast–macrophage dynamics. We then plotted 2D fibroblast–macrophage phase portraits at increasing cancer cell densities (Fig. 3g). Increasing tumour cell density pushes the stable fixed point towards a ‘hot’ state with abundant macrophages (Fig. 3g).
To ask whether hot fibrosis is clinically important, we partitioned the cohort from Danenberg et al.2 into two groups according to the presence of hot or cold fibrosis (macrophage density > halfway point between hot and cold fibrosis fixed points), and fit a Kaplan–Meier survival curve to each group. The hot fibrosis state was associated with poor prognosis (Fig. 3h; log-rank test P = 0.0046), with a decrease in median survival from 192 to 132 months. This result remained significant when the number of tumour cells was controlled for (Wald test P = 0.01; Supplementary Fig. 3j).
To further test OSDR, we analysed two additional IMC breast cancer datasets, with an additional 1,012 patients and 2.1 million cells3,4. Similar results were found in all three IMC breast cancer datasets (Supplementary Fig. 3k,l).
Excitable dynamics of T and B cells
We next considered two other cell types in the breast cancer microenvironment, T cells and B cells. These cells are components of the adaptive immune system that have a major role in the tumour microenvironment and are crucial for immunotherapy31,32.
We analysed all neighbourhoods in the Danenberg dataset with at least one T and/or B cell. This included a total of 73,961 T cells and 27,642 B cells, with 1,067 and 213 cell division events, respectively. Thus, about 1.4% of the T cells and 0.7% of the B cells showed division events, consistent with previous breast cancer data33.
We estimated the dynamics between T and B cells using OSDR. The inferred phase portrait has a striking feature called excitability. It shows a stable fixed point at zero cells (Fig. 4c). However, if T cells are raised above a threshold, they generate a pronounced pulse in which T cells rise, followed by B cells, and then both populations reduce to zero (Fig. 4d). This pulse is similar to pulses observed in autoimmune diseases such as relapsing–remitting multiple sclerosis34.
a, Ki67 marker as a function of neighbourhood composition. Each point corresponds to one T cell (73,961 cells) from the IMC dataset of Danenberg et al.2. b, Same as a but for B cells (27,642 cells). c, OSDR inferred phase portrait indicates an excitable system. The blue highlighted trajectory displays a large pulse of adaptive immune cells. d, Spatial simulation of a 2 mm × 2 mm tissue based on inferred population dynamics shows that a high enough number of T cells triggers a pulse of T cells followed by B cells. The y axis displays the number of cells, normalized to the area of a 80-µm neighbourhood. e, Each pulse is followed by a refractory period, as evidenced in simulations in which additional T cells are introduced at different times (vertical arrows). A new pulse is generated only when T cells are introduced after B cells from the previous pulse have declined. f, 3D phase portrait with CD4 T cells, CD8 T cells and B cells shows an immune flare when the CD4 T cell density crosses threshold. The 2D projections are in grey. g, Distributions of CD4 T cells, CD8 T cells and B cells in the 100 most-proliferative and least-proliferative states of each cell type. The most-proliferative states are characterized by a high density of CD4 T cells and a low density of B cells.
Similar to the fibroblast–macrophage analysis above, the estimated dynamics were robust to resampling at the level of both cells and patients (Supplementary Fig. 4b–d) and were consistent under a wide range of death rates, neighbourhood sizes and Ki67 thresholds (Supplementary Fig. 4e–g). The dynamics are not confounded by unmodelled cell types (Supplementary Fig. 4h).
The pulsatile adaptive immune response in the inferred model is shown in Fig. 4c, in which T cells rise, followed by B cells that inhibit them, and then both cell populations decline. The model further indicates that after a pulse, there is a refractory period, in which B cells are still high and T cells are low. During this period, a new pulse cannot be generated due to the inhibitory effects of the B cells (Fig. 4e). A new pulse is possible only after the recovery period (Fig. 4e).
To study the role of different T cell subsets, we fit a 3D model including CD4 and CD8 T cell subsets as well as B cells. The excitable dynamics apparent in the 2D model were reproduced in the 3D model. The 3D model revealed that a pulse is initiated when the density of CD4 T cells crosses a threshold (Fig. 4f). For all three cell types, proliferation was highest in neighbourhoods with a high density of CD4 T cells and a low density of B cells (Fig. 4g). Proliferation was lowest at a high density of B cells and low density of CD4 cells (Fig. 4g). We conclude that CD4 cells initiate the immune pulse, whereas B cells provide the negative feedback required to terminate the pulse.
We next considered subtypes of breast cancer from the Danenberg cohort. We compared ER+, HER2+, PR+ and triple-negative breast cancer. Fibroblast–macrophage dynamics displayed hot and cold fibrosis fixed points in the phase portrait of all four subtypes (Supplementary Fig. 4j). The T–B immune pulse was similar in the three receptor-positive subtypes: ER+, PR+ and HER2+. However, the triple-negative breast cancer phase portrait showed a difference where the pulse does not end in zero T and B cells, but instead in a fixed point where B cells remain stable (Supplementary Fig. 4j). This result is consistent across breast cancer cohorts, with mixed cohorts displaying a collapse of both cells, and the triple-negative cohort displaying B cell stability. This result is consistent with the high rates of lymphocyte infiltration in triple-negative breast cancer, including tumour-infiltrating B cells at early stages of the disease35,36.
We also asked whether a full OSDR model with all cell types displays the same dynamics as the 2D models. We thus developed a model with the six major cell types in the Danenberg dataset: fibroblasts, macrophages, T cells, B cells, cancer cells and endothelial cells. We found that the 6D model recapitulates the dynamics of the 2D models in which other cell types are at their mean concentrations (Supplementary Fig. 4k). We conclude that the OSDR approach allows reconstruction of the dynamics of the full cell–cell interaction network in the samples.
OSDR predicts response to treatment
Patients with cancer can go through many months of treatment without knowing whether the tumour is growing or shrinking. To adjust treatment when it is ineffective, we need early signs of response. To address this challenge, we applied OSDR to a clinical trial with three longitudinal biopsies: the NeoTRIP trial. A cohort of 279 patients with triple-negative breast cancer were randomly assigned to chemotherapy (n = 141) or chemotherapy + anti-PDL1 immunotherapy (n = 138; Fig. 5a). Treatment consisted of eight 3-week cycles. Biopsies were collected at three time points: before treatment, 3 weeks into treatment (day of the second treatment cycle) and post-treatment (at surgical excision of the tumour following eight 3-week treatment cycles). Pathologists labelled the post-treatment biopsies as pathological complete response or residual disease.
a, Longitudinal triple-negative breast cancer dataset by Wang et al.3 includes a total of 141 patients in the chemotherapy arm and 138 patients in the chemotherapy + immunotherapy arm. The illustration was created by Nigel Orme. b, Longitudinal predictions for six cell types. OSDR models were fit separately to early-treatment biopsies from responders (47 and 49 patients in the chemotherapy and chemotherapy + immunotherapy arms, respectively) and non-responders (54 and 57 patients in the chemotherapy and chemotherapy + immunotherapy arms, respectively) in each treatment arm (a total of 140,118 and 157,347 cells in responders and non-responders, respectively, in the chemotherapy arm; 135,559 and 144,261 cells in the chemotherapy + immunotherapy arm, respectively). The tumour cell population collapses in responders (dark grey line) but is stable in non-responders (red line). To isolate the effect of the tumour microenvironment dynamics, as opposed to initial tissue composition, trajectories were computed starting from the composition of all biopsies taken at the beginning of treatment. Plots display the average cell count over all trajectories. The shading denotes 95% confidence intervals of the mean (bootstrap)39. c, Fraction of dividing tumour cells in all neighbourhoods (n = 41,117 and 17,932 cancer cells from non-responders and responders, respectively) and in neighbourhoods with the top 10% of T cells. The error bars display 95% confidence intervals of the mean (bootstrap)39. We compared the fraction of Ki67+ cancer cells in responders versus non-responders using chi-squared tests of independence in all neighbourhoods (left) and in high T cell neighbourhoods (right). Both cases had P < 10−7. d, Zoomed in view of the first 90 days of predicted chemotherapy + immunotherapy treatment response dynamics. The T cell density increases in both responders and non-responders, and the tumour cell population collapses only in responders. The shading denotes 95% confidence intervals of the mean (bootstrap)39.
We hypothesized that a response or lack of response to treatment should be evident in the early-treatment dynamics. We applied OSDR to week 3 biopsies from responders and non-responders in each treatment arm (total of four groups). We modelled dynamics of the six major cell types: fibroblasts, macrophages, tumour cells, endothelial cells, T cells and B cells. We then predicted the composition of the tissue over time. To detect differences resulting from dynamics, as opposed to differences resulting from initial tissue composition or tumour burden, we applied both responder and non-responder models to the same initial states, namely, we applied both models to every early-treatment biopsy. Figure 5b shows the predicted cell density over time, averaged over all starting states. In both treatment arms, OSDR predicts the collapse of the tumour cell population in responders but not in non-responders. These results are robust to the choice of patients used to fit each model (Supplementary Fig. 5a; Mann–Whitney U-test P < 10−5 for both treatment arms).
Our analysis showed that the collapse of tumour cells in responders is not a result of the initial tissue state, as we applied the models to all initial states. Moreover, the average proliferation rate of tumour cells at week 3 does not separate between responders and non-responders (Supplementary Fig. 5b). In fact, the mean division rate of tumour cells in responders was higher than non-responders in the immunotherapy treatment arm (Fig. 5c; chi-squared P < 10−7). Thus, the tumour cell population collapses as a result of interactions between cells over time and not initial tissue composition or average proliferation rates.
The predicted trajectories in immunotherapy show a sharp rise in T cell number (Fig. 5b). This rise appears in both responders and non-responders receiving immunotherapy, but not in patients in the chemotherapy arm. Because T cell density increases in both responders and non-responders under immunotherapy, we hypothesized that T cells have a different effect on tumour cells in these two groups. When considering all neighbourhoods, the fraction of dividing cancer cells is higher in responders than in non-responders (Fig. 5c, left; chi-squared P < 10−7). However, when we focus on neighbourhoods with many T cells (top 10%), the fraction of dividing cancer cells is twofold lower in responders than in non-responders (chi-squared P < 10−7; Fig. 5c).
We conclude that OSDR can predict treatment response using an early biopsy in both treatment arms (Fig. 5b). It also captures the rise in T cell numbers in immunotherapy but not in chemotherapy (Fig. 5d).
Discussion
We developed OSDR, an approach for inferring cell population dynamics from a tissue spatial omics snapshot. OSDR models cell division rate as a function of neighbourhood composition, and uses this to construct phase portraits and spatial simulations of a tissue. We validated the approach with longitudinal biopsies from breast cancer, identifying responders to chemotherapy and immunotherapy. We have discovered the potential for pulsatile T cell responses inhibited by B cells37. This can transform a steady-state concept of cancer immunity to a dynamic picture more similar to the flares observed in autoimmune disease34.
Limitations and caveats
Application of OSDR requires both domain knowledge and awareness of model limitations. First, OSDR estimates dynamics at a given point in time, but can not model changes in the dynamics themselves. As such, OSDR will be inaccurate if dynamics appreciably change. For example, in the cohort from ref. 3, cell division rates drop considerably over the 24 weeks of treatment (Supplementary Fig. 5c). This could be a cumulative effect of chemotherapy. Prior knowledge or samples from multiple time points can be used to establish the timescale of the changes in dynamics. Rapid changes in tissue composition could also have an effect that history rather than current neighbourhoods dominate the dynamics (Supplementary Fig. 2f). In all cases, plots such as in Fig. 3a and Supplementary Fig. 2b,c should be used to test that neighbourhood compositions predict proliferation rates.
The current implementation approximates the death rate for each cell type as independent of the neighbourhood, and equal to the mean division rate in the sample. Establishing reliable markers for cell death rate may improve model estimates.
When sampling tissues, it is important to obtain a large variance of neighbourhood compositions. We estimate that a model can be built for an individual patient given on the order of 0.2 cm2 of tissue, perhaps from multiple sections of a biopsy. By sampling a large tissue section or multiple biopsies, one can observe different tissue regions in different stages of the dynamic processes (Supplementary Fig. 5d).
Tissue dynamics naturally bias the distribution of observed neighbourhood compositions. As a result, some state-space regions could have limited data, making inferences more sensitive within these regions (Supplementary Fig. 2l–o). Plots of neighbourhood composition distribution as in Figs. 3d,e and 4a,b can help to recognize regions with limited data.
To use OSDR, one needs to consider confounders. First, when using data from multiple patients, one needs to check that a result is stable across different subsets of patients (for example, stage, genotype and tumour size). Reproducing the dynamics across patient subgroups ensures that we do not overinterpret multiple events from different tissues as a trajectory. A second type of confounder could occur spatially within the tissue, for example, gradients of hypoxia or inflammation. This can be tested by including terms for endothelial, immune and tumour cells, which serve as proxies for hypoxia and inflammation. These terms are automatically included in full OSDR using all cell types. If key cell subtypes are crucial for the dynamics but are not detected by the experimental markers, it might be impossible to test this type of confounder.
OSDR captures cell division and removal within the tissue, so predictions can deviate from observations when transdifferentiation or migration has a dominant role. We can identify cases in which transdifferentiation or migration terms are required to explain observations by plotting the sources and sinks of unexplained components of the dynamics, as in Supplementary Fig. 4m,n. For example, in the case of T and B cells, OSDR predicts a single stable point with zero cells of each type. An external source of cells is required to explain the observation of tissues with positive densities of each cell type. Accordingly, Supplementary Fig. 4m,n suggests that the influx of lymphocytes drives tissues with no lymphocytes to the point of initiation of an immune flare. Thus, observed high densities of lymphocytes are explained by local proliferation (that is, by OSDR) rather than external influx. In Fig. 4d,e, we simulated this migration component by adding cells to the tissue. Future implementations of OSDR could directly model transdifferentiation or migration components.
In the present work, we compared OSDR predictions against pre-therapy and post-therapy biopsies from human patients, over a 24-week course of treatment (Fig. 5). Direct measurement of tumour microenvironment dynamics in vivo can test the dynamics on a finer timescale in animal models. Possible methods include mouse models of tumour development (which have less inter-sample heterogeneity), pulse-chase experiments and intravital microscopy16.
In summary, OSDR opens up exciting opportunities for studying how interactions between cells in the tumour microenvironment contribute to changes in the tumour over time. Tissue dynamical models provided by OSDR can inform mechanisms of pathology and provide targets for treatments aimed at changing tissue composition to reach therapeutic goals.
Methods
The number of cells of a given type in a tissue section can change by division or death, moving in or out of the section (flux) or transdifferentiation40. If we restrict ourselves to modelling cell types that do not transdifferentiate at appreciable rates, such as T cells and macrophages, and analyse tissues in which flux is negligible relative to rates of death or division (or where we can add flux terms post hoc), we remain with the following equation for the rate of change of a population of cells of type \(i\):
OSDR aims to transition from static observations of cell division or death in a tissue into rates. The key insight is: if we obtain a marker for cell division (or death), and in each cell division the marker remains above a defined threshold for a time period \({dt}\), then all observed divisions occurred within the last \({dt}\) hours. Thus:
The rate of division or death of a cell is influenced by the signals that it receives from its environment, its access to nutrients, its genetics and factors such as physical contact with other cells. We call this complete set of factors the ‘neighbourhood’ of the cell. This definition sets an ideal, and we denote the particular set of features used to approximate this ideal as \(N(x)\), where \(x\) is some cell in the tissue.
If we consider cells with identical neighbourhoods, a fraction of them will be dividing. This fraction is higher if the neighbourhood induces a high rate of division. We thus viewed the observations of division or death as random events whose probabilities are determined by the neighbourhood of the cell. Thus, for cell \(x\) of type \(i\), the distribution of the observation \({O}_{i,t}(x)\) of a division or death event is modelled as:
Where pi+1 and pi−1 are the statistical inference models for division or death, and dt+ and dt− are the durations of observed division or death markers, respectively. In this study, dt+ is defined as 1 time unit (roughly a few hours; ref. 27), and the approximation of the death rate as the mean division rate is defined using the same time units. Thus, in this implementation dt+ = dt− = 1. We divided by the durations so that the (stochastic) change in the number of cells in each timestep is:
Tissues are heterogenous, and the diverse cellular compositions in different regions result in various directions of change. To analyse the change at a certain state, rather than the change in complete tissues, we computed the expected change with respect to an initial condition where cells share the same neighbourhood:
In this study, features are based on the number of neighbouring cells of each type within a predefined radius. For further discussion on this choice of features, see Supplementary Fig. 2f. The neighbourhoods can thus be represented as a vector of cell densities:
As a result, we can interpret the inferred statistical models as components of a set of ordinary differential equations (ODEs) defined over a state-space of cell densities:
Note that OSDR is inference-model agnostic; although we used logistic regression here, other statistical inference models can be adopted within this framework. In addition, this approach can be applied to data acquired by any technology that enables classification and spatial localization of discrete cells, together with reliable measurement of markers for division (and possibly death).
Model inference algorithm
For input:
Cell-level annotations: \(({B}_{i},{T}_{i},{\vec{x}}_{i}{,O}_{i})\) for cell \(i=1,\ldots \,N\)
-
\({B}_{i}\) denotes an ID for the biopsy sample cell \(i\) came from. \({B}_{i}\) is used to formalize that a cell can only influence cells from the same tissue.
-
\({T}_{i}\in T\) indicates the cell type for cell \(i\) (for example, \({T}_{i}\,=\) ‘fibroblast’), and let \(T\) be the set of types.
-
For any \(t\in T\), let \({n}_{t}\) be the total number of cells of type \(t\). We also assumed some order on the cells of type \(t\), such that: \(t[\,j]=i\) for any index \(j\in \{1,\ldots {n}_{t}\}\), and the original index \(i\in \{1,\ldots ,N\}\).
-
\(\vec{{x}_{i}}\in {R}^{2}\) denotes the 2D spatial coordinates for cell \(i\).
-
Oi ∈ {0,1} refers to the binary observation of division.
For the algorithm:
For each cell type \(t\in T\):
-
(1)
Compute a table of features (neighbour counts of each cell type) \({X}_{t}\in {R}^{{n}_{t}\times T}\).
$${X}_{t}[i,{t}^{{\prime} }]:= \mathop{\sum }\limits_{j=1}^{N}1\,[{B}_{j}={B}_{t[i]},{T}_{j}={t}^{{\prime} },\Vert {\overrightarrow{x}}_{t[i]}-\overrightarrow{{x}_{j}}\Vert < r]$$Here \(t[i]\) is the original index of the i-th cell of type \(t\). The value at row \(i\) and column \(t{\prime} \) is a count of all cells that came from the same tissue as cell \(t[i]\), that have type \(t{\prime} \) and are within a distance \(r\).
Row \(i\) in \({X}_{t}\) is our representation for the neighbourhood of the cell \(t[i]\): the counts of all cell types in its proximity. Denote this vector by \(N(t[i]):= {X}_{{T}_{i}}[i,:]\).
-
(2)
Perform feature transformations on \({X}_{t}\), such as adding interaction terms (transformations are selected through a separate process of cross validation).
-
(3)
Define the binary cell-division labels \({y}_{t}\in \{\mathrm{0,\; 1}{\}}^{{n}_{t}}\):
$${y}_{t}[i]={O}_{t[i]}$$ -
(4)
Fit a multivariate logistic regression model \({p}_{t}^{+}\) for the division rate based on the features and labels \({X}_{t},{y}_{t}\).
-
(5)
Define the death rate:
For output:
Ki67 thresholds
We used previous data to establish a Ki67 threshold for cell division events. Uxa et al.27 have demonstrated that Ki67 levels peak towards the G2/M phase of the cell cycle, with preserved kinetics (up to scale) across two human and one mouse cell line. We adjusted Ki67 levels to correct for different scaling and division rates between cell lines (Supplementary Fig. 1a,b) by selecting Ki67 values above a noise threshold \({T}_{n}\), subtracting \({T}_{n}\) and dividing by the Ki67 standard deviation. We choose \({T}_{n}=0.5\) mean isotopic counts because this is the typical magnitude of experimental noise in this dataset (Supplementary Fig. 1c). This produces distributions with similar shape (Supplementary Fig. 1d) in accordance with the cell line results from Uxa et al. We defined a cell division by the normalized Ki67 above a division threshold \({T}_{d}\). Example fractions of dividing cells are provided in Supplementary Fig. 1e. The resulting model estimates are robust to \({T}_{d}\) values between 0 and 1 on this adjusted scale (Supplementary Figs. 3f and 4g).
Choice of spatial proteomics technology
Out of the currently available spatial-omics technologies, multiplexed protein imaging41,42,43,44 was the most suitable for our setting. Current barcode-based spatial transcriptomics45,46 aggregate cells in spots of 55 µm in diameter so that they do not associate transcript levels with single discrete cells. In addition, because the distance between spot centres is 100 µm, if we place a cell in the centre of a spot, we measure less than one-ninth of the area immediately surrounding it (area of a circle of radius 27.5 µm, within another of radius 72.5). Fluorescent-based approaches such as MERFISH allow modelling single cells but they only recover a small fraction of every transcript in the tissue. This is a barrier for basing the analysis on levels of a single transcript: Ki67. IMC provides measurements within well-defined cells, reliable measurement of Ki67 and, in terms of cost, makes datasets in the order of magnitude of hundreds of thousands of cells feasible. Classical staining methods should also be feasible for analysing specific pairs of cells. For example, for analysing fibroblasts and macrophages, we could use four markers: fibroblast and macrophage markers, a cell nucleus marker and Ki67.
Implementing OSDR using spatial transcriptomics would allow more fine-grained definition of cell types based on transcriptional profiles. Cell division and death events could be defined based on multiple gene expression markers, rather than Ki67 used here, enhancing the accuracy of the method. In principle, OSDR can compute dynamics of many cell types and subtypes, beyond the six studied here. We expect the required number of cells to increase with the number of cell subtypes considered. Future work can add computation of transitions between cell subtypes or states to more fully capture cell population dynamics.
Data exclusion
We excluded outlier samples that deviated by more than six standard deviations in both cell density and number of cell divisions. These excluded outliers amounted to 3 samples out of 718 in the Danenberg dataset2, and 2 samples out of 771 in the Fischer dataset4.
Enforcing maximal density
We assumed there cannot be a net positive flux at the maximal observed density of a cell type. We applied a correction in the form of:
Where di is the density of cell I, and the power n controls the steepness: high n implies that the correction applies primarily to higher densities (Supplementary Fig. 1f,g). The constant term ci is defined as the minimal correction ensuring non-positive flux at maximum density (Di). We compute division minus death rates at the maximal density of one cell, over all possible values of the second cell:
In practice, the state-space region near maximal density for both cell types is unpopulated by cells, so we used values up to the 95% quantile density for each type. This is more robust to extrapolation errors in areas with minimal data. For the fibroblast–macrophage model, this correction is trivial because the estimated net flux is negative at high densities; for the T and B cell model, the correction makes a difference only to T cells (Supplementary Fig. 1g).
Population versus neighbourhood dynamics
In OSDR, we first estimated the cell-level models for division and death probabilities (see ‘Model inference algorithm’ in Methods). We then used the cell-level models to analyse tissue dynamics in one of two ways.
We called the first approach ‘population-level dynamics’. We started with a spatial tissue section. We then produced a temporal sequence of tissue snapshots as follows. We first computed the probabilities of division and death for each cell, taking into account the composition of the neighbourhood of each cell. We then used the probabilities to sample for each cell: division, death or none. We placed each new cell in the neighbourhood of the dividing cell. We removed cells that died (Supplementary Fig. 1h).
One nuance in this process relates to cells at the edge of the tissue. When a cell near the edge of the tissue divides, its daughter cell might be placed outside the tissue. To keep tissue size fixed, we removed cells placed out of bounds. This biases the neighbourhoods of cells near the edge of the tissue. To correct this bias, we rescaled the cell counts of cells near the edge of the tissue: \(\mathrm{Number}\,\mathrm{of}\,\mathrm{cells}\,\mathrm{in}\,\mathrm{neighbourhood}\cdot \frac{1}{\mathrm{Neighbourhood}\,\mathrm{fraction}\,\mathrm{within}\,\mathrm{tissue}}\). This is an unbiased estimator of neighbourhood composition, as the ‘neighbourhood fraction within the tissue’ is also the probability of keeping a daughter cell following division.
We can also add cell movement to this sampling procedure. We implemented a random walk by sampling a Gaussian translation to each cell at each time step. Note that a large diffusion coefficient can disperse cells out of tissue boundaries (Supplementary Fig. 1i), whereas a small diffusion coefficient can cause regions in the tissue to be effectively isolated (Supplementary Fig. 1j). More elaborate modes of cell movement include attraction towards a chemokine source, adhesion to nearby cells and migration of cells from outside the tissue. Studying the effects of different modes remains outside the present scope.
To study a sequence of tissue sections, we plotted the number of cells over time (for example, Fig. 4e,f). Because tissues can have different sizes, we found it useful to rescale the number of cells to the area of a neighbourhood. Thus, the y axis displays: \(\mathrm{Number}\,\mathrm{of}\,\mathrm{cells}\,\mathrm{in}\,\mathrm{tissue}\cdot \frac{\mathrm{Neighbourhood}\,\mathrm{area}}{\mathrm{Tissue}\,\mathrm{area}}\).
One limitation of plotting the average density is that we do not observe the complete distribution. Of note, the average density does not necessarily coincide with the mode. Supplementary Fig. 1k shows a simulation in which the mode locates the stable fixed point of the system, rather than average density.
Thus, to analyse population dynamics, we needed to specify an initial spatial tissue configuration and a diffusion coefficient. We had to also consider the distribution of neighbourhood densities across the tissue. The second approach for analysing tissue dynamics did not require these choices.
We called the second approach ‘neighbourhood-level dynamics’. Here we analysed an ODE obtained by computing the average direction of change of each cell type (Methods). To analyse this ODE, it was convenient to plot phase portraits for 2D models (for example, Figs. 2b–d, 3f and 4c) and trajectories for higher dimensions (for example, Fig. 5b).
Generally, population and neighbourhood dynamics do not have to agree. The population model is stochastic and discrete, whereas the neighbourhood model is deterministic and smooth. We constructed examples to highlight two important differences between the population and neighbourhood approaches.
The first type of discrepancy results from collapse of a cell population. In the deterministic neighbourhood dynamics, a cell population will always flow in the average direction of change. Thus, if a cell population has a positive stable fixed point, it will deterministically flow towards it. Conversely, in the stochastic population dynamics, a cell population can move against the average direction of change. If due to a random fluctuation, all cells in a population die, the population will not recover. This can produce large differences between neighbourhood and population dynamics. A collapse is more likely to occur for cells with a low-density fixed point. It is also more likely without diffusion. Adding even small diffusion allows neighbourhoods with higher densities to ‘rescue’ neighbourhoods that had collapsed. Supplementary Fig. 1l shows that the macrophage population eventually collapses without diffusion. Adding diffusion produces similar steady states under both models (Supplementary Fig. 1l).
A second type of discrepancy results from the initial tissue configuration. Population dynamics depend on the initial tissue configuration, whereas neighbourhood dynamics do not. Certain particularly ‘adversarial’ tissue configurations, coupled with low cell motion, can produce large discrepancies. For example, under neighbourhood dynamics, the T and B cell model produces a flare from a location of (4,1) on the TB phase portrait (Fig. 4c). Under population dynamics, a flare also occurs when we initialize a tissue by placing cells at random (Supplementary Fig. 1m, first example). However, we could organize the same number of cells such that no flare occurred. For example, we can place T cells at one side of the tissue and B cells at the other. In this case, the B cell population collapses because the B cells do not have T cell neighbours (Supplementary Fig. 1m, second example). Another option is placing all B cells in the same place, creating a high density of B cells locally. In this case, the low density of B cells at the tissue level does not reflect their high density locally (Supplementary Fig. 1m, third example). In these examples, we used our understanding of neighbourhood dynamics to design a tissue configuration that produces a discrepancy.
Simulations of known dynamical models
To determine the accuracy of the inferred dynamical model as a function of sample size, we simulated spatial data based on a known dynamical model (that is, predefined functions p+ and p−) using the following procedure:
-
(1)
Sample a random initial number of cells for each cell type.
-
(2)
Sample a random spatial position in the tissue for each cell.
-
(3)
For n steps:
-
(i)
Compute for each cell the probability of division or death based on its current neighbourhood.
-
(ii)
Sample an event of division, death or none based on the computed probabilities.
-
(iii)
Remove dead cells and place a new cell next to each dividing cell (here the location of new cells is sampled uniformly within the neighbourhood. It is straightforward to incorporate knowledge about cell motility at this stage, if available).
-
(i)
This produces a tissue section whose density and spatial distribution is produced by the dynamics, as we assume is the case for real tissues. We repeated the procedure 100 times from various initial densities and sample with replacement 50,000 cells evenly from all tissues. From this pool, we then sampled 1,000, 5,000, 10,000 or 25,000 cells for the model fits.
Because empirical distributions in our data had tails towards lower cell densities, we sampled the initial cell densities from a β-distribution biased towards lower densities (parameters 2,4 scaled to a maximal value of 7). Model parameters were selected to produce division rates in ranges that resemble real data (mostly within 1–6%). The fraction of divisions was approximately 2% for all models. We selected the number of simulation time steps as that required to produce distributions qualitatively similar to real data.
To evaluate model fits, we tested whether the correct location and type of stable or semi-stable fixed points were recovered (Supplementary Fig. 2g–k), as well as accuracy of reconstructed basins of attraction (Supplementary Fig. 2l–o). To account for discretization error, if a stable point on an axis was recovered, and an unstable point was located within less than one cell from that point, we considered it as semi-stable. Such a point has effectively no basin of attraction. The same precaution should apply to interpretation of model fits in general.
For a detailed analysis of the simulations of each ground truth model, see Supplementary Fig. 2g–o.
Plotting Ki67 levels as a function of neighbourhood composition
Figures 3d,e and 4a,b display the measured Ki67 > threshold as a function of neighbourhood composition. To transform the cell-level binary division events into rates, we computed a local average and subtracted the mean division rate. For the local average, we used a Gaussian smoothing kernel over the cell-density state-space, providing a non-parametric plot of the division rate. The gamma parameter of the kernel controls the degree of smoothing. We plotted a value of gamma that produces contours of similar complexity as those of the estimated parametric models.
Magnitude of error due to unmodelled terms
To estimate the effect of unmodelled processes we applied a Fokker–Planck approach. Each tissue is analogous to a particle moving through a space whose coordinates are defined by the densities of each cell type. For example, the location \(x\) could be the density of fibroblasts and macrophages (that is, \(x=(F,M)\)). The velocity through this space is determined by the rate of change in each cell type. This velocity has a deterministic component composed of \(\vec{v}(x,y)\), the division minus removal rates that we previously estimated using division markers, and \(\vec{u}(x,y)\), which includes unmodelled terms such as cell migration and differentiation from stem cells. The velocity also includes a stochastic component, which reflects fluctuations in velocity of each cell type.
Applying the Fokker–Planck equation to our setting:
For the notation: \(\nabla \cdot \) is the divergence operator; \(\rho ({\boldsymbol{x}})\) is the density of tissues at location \({\boldsymbol{x}}\) in the state-space; \(\overrightarrow{{\boldsymbol{v}}}({\boldsymbol{x}})+\overrightarrow{{\boldsymbol{u}}}({\boldsymbol{x}})\) is the velocity of a neighbourhood in the state-space; \(\overrightarrow{{\boldsymbol{v}}}({\boldsymbol{x}})\) is the division minus the death rate field, estimated from data; \(\overrightarrow{{\boldsymbol{u}}}({\boldsymbol{x}})\) is the velocity field due to unmodelled terms such as cell migration (will be estimated now); and \(D({\boldsymbol{x}})\) is the diffusion coefficient matrix. We assumed that fluctuations are proportional to the number of cells (for example, changes in nutrient availability modify growth rates of existing cells, rather than adding or removing cells at a constant rate).
Formally, \(dX=[{\boldsymbol{v}}({\boldsymbol{x}})+{\boldsymbol{u}}({\boldsymbol{x}})]dt+{\sigma }({\boldsymbol{x}})\,\circ \,d{W}_{t}\). Where \(d{W}_{t}\) is an N-dimensional Brownian motion and \({\sigma }({\boldsymbol{x}})={\sigma }\cdot {({{\boldsymbol{x}}}_{1},\ldots ,{{\boldsymbol{x}}}_{N})}^{T}\) multiplies each component independently. Overall, for \(i\ne j\) \({D}_{i,j}({\boldsymbol{x}})=0\) and for \(i=j\) \({D}_{i,i}({\boldsymbol{x}})={{\sigma }}^{2}{{{\boldsymbol{x}}}_{i}}^{2}\). The diffusion term becomes: \({{\sigma }}^{2}{\sum }_{i=1}^{N}\frac{{{\rm{\partial }}}^{{\bf{2}}}}{{{\rm{\partial }}}^{2}{{\boldsymbol{x}}}_{i}}[{{{\boldsymbol{x}}}_{i}}^{2}\rho ({\boldsymbol{x}})]\). We henceforth denote the scalar \({\sum }_{i=1}^{N}\frac{{{\rm{\partial }}}^{2}}{{{\rm{\partial }}}^{2}{{\boldsymbol{x}}}_{i}}[{{{\boldsymbol{x}}}_{i}}^{2}\rho ({\boldsymbol{x}})]\) as \(D({\boldsymbol{x}})\). The equation becomes:
For a large sample of patients, we can assume that sampling the same tumours within a number of days would produce approximately the same distribution. This implies that \(\frac{\partial \rho }{\partial t}\approx 0\). Thus:
The left-hand side is inferred from data for all \({\boldsymbol{x}}\). Recall, \(\overrightarrow{{\boldsymbol{v}}}({\boldsymbol{x}})\) is estimated from division markers and we estimated \(\rho (x)\) by computing the location of tissue of each patient in the state-space followed by kernel density estimation. We then numerically evaluated the divergence \({\rm{\nabla }}\cdot (\rho ({\boldsymbol{x}})\cdot \overrightarrow{{\boldsymbol{v}}}({\boldsymbol{x}}))\) using finite differences.
By plotting \({\rm{\nabla }}\cdot (\rho \cdot \overrightarrow{{\boldsymbol{v}}})\), we can visualize the net contribution (in units of change in density per unit time) of the missing terms. In the special case where \(\sigma \approx 0\), we directly obtained the divergence of the error (for example, migration) field as \({\rm{\nabla }}\cdot (\rho \cdot \overrightarrow{{\boldsymbol{u}}})=-\,{\rm{\nabla }}\cdot (\rho \cdot \overrightarrow{{\boldsymbol{v}}})\). Plotting \({\rm{\nabla }}\cdot (\rho \cdot \overrightarrow{{\boldsymbol{v}}})\) thus identified the sources and sinks of the error field, as well as the magnitude of error. Note, for interpretability, we divided the rates by the maximal \(\rho \) so that units are in [fractions of maximal density/∆t].
To quantify the contribution of diffusion versus deterministic terms (migration, and so on) we solved an ordinary least squares problem with a single parameter \(\sigma \):
The variable \({\boldsymbol{x}}\) is taken over a discrete 2D grid. Solving for \(\sigma \) this way implies that the deterministic error velocity \(\overrightarrow{{\boldsymbol{u}}}({\boldsymbol{x}})\) should not include components that could be explained by stochastic diffusion.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Data availability
IMC datasets analysed in this study were previously published by Danenberg et al.2 (https://zenodo.org/records/7324285, associated clinical data on https://www.cbioportal.org/), Fischer et al.4 (https://zenodo.org/records/7494509) and Wang et al.3 (https://zenodo.org/records/7990870).
Code availability
Analysis was performed using Python (tested on versions 3.10+). Code (https://github.com/JonathanSomer/osdr) and documentation (https://jonathansomer.github.io/osdr/) are available on GitHub.
References
Adler, M., Chavan, A. R. & Medzhitov, R. Tissue biology: in search of a new paradigm. Annu. Rev. Cell Dev. Biol. 39, 67–89 (2023).
Danenberg, E. et al. Breast tumor microenvironment structures are associated with genomic features and clinical outcome. Nat. Genet. 54, 660–669 (2022).
Wang, X. Q. et al. Spatial predictors of immunotherapy response in triple-negative breast cancer. Nature 621, 868–876 (2023).
Fischer, J. R. et al. Multiplex imaging of breast cancer lymph node metastases identifies prognostic single-cell populations independent of clinical classifiers. Cell Rep. Med. 4, 100977 (2023).
Adler, M. et al. Principles of cell circuits for tissue repair and fibrosis. iScience 23, 100841 (2020).
Zhou, X. et al. Circuit design features of a stable two-cell system. Cell 172, 744–757.e17 (2018).
Miyara, S. et al. Cold and hot fibrosis define clinically distinct cardiac pathologies. Cell Syst. 16, 101198 (2025).
Mayer, S. et al. The tumor microenvironment shows a hierarchy of cell-cell interactions dominated by fibroblasts. Nat. Commun. 14, 5810 (2023).
Medzhitov, R. The spectrum of inflammatory responses. Science https://doi.org/10.1126/science.abi5200 (2021).
Tlsty, T. D. & Coussens, L. M. Tumor stroma and regulation of cancer development. Annu. Rev. Pathol. 1, 119–150 (2006).
De Visser, K. E. & Joyce, J. A. The evolving tumor microenvironment: from cancer initiation to metastatic outgrowth. Cancer Cell 41, 374–403 (2023).
Wang, S. et al. An autocrine signaling circuit in hepatic stellate cells underlies advanced fibrosis in nonalcoholic steatohepatitis. Sci. Transl. Med. 15, eadd3949 (2023).
Leung, C. M. et al. A guide to the organ-on-a-chip. Nat. Rev. Methods Primer 2, 33 (2022).
Kim, J., Koo, B.-K. & Knoblich, J. A. Human organoids: model systems for human biology and medicine. Nat. Rev. Mol. Cell Biol. 21, 571–584 (2020).
Pittet, M. J., Garris, C. S., Arlauckas, S. P. & Weissleder, R. Recording the wild lives of immune cells. Sci. Immunol. 3, eaaq0491 (2018).
Entenberg, D., Oktay, M. H. & Condeelis, J. S. Intravital imaging to study cancer progression and metastasis. Nat. Rev. Cancer 23, 25–42 (2023).
Quinn, J. J. et al. Single-cell lineages reveal the rates, routes, and drivers of metastasis in cancer xenografts. Science 371, eabc1944 (2021).
Horns, F. et al. Engineering RNA export for measurement and manipulation of living cells. Cell https://doi.org/10.1016/j.cell.2023.06.013 (2023).
Efremova, M., Vento-Tormo, M., Teichmann, S. A. & Vento-Tormo, R. CellPhoneDB: inferring cell–cell communication from combined expression of multi-subunit ligand–receptor complexes. Nat. Protoc. 15, 1484–1506 (2020).
Jerby-Arnon, L. & Regev, A. DIALOGUE maps multicellular programs in tissue from single-cell or spatial transcriptomics data. Nat. Biotechnol. 40, 1467–1477 (2022).
Browaeys, R., Saelens, W. & Saeys, Y. NicheNet: modeling intercellular communication by linking ligands to target genes. Nat. Methods 17, 159–162 (2020).
Armingol, E., Baghdassarian, H. M. & Lewis, N. E. The diversification of methods for studying cell–cell interactions and communication. Nat. Rev. Genet. https://doi.org/10.1038/s41576-023-00685-8 (2024).
La Manno, G. et al. RNA velocity of single cells. Nature 560, 494–498 (2018).
Kafri, R. et al. Dynamics extracted from fixed cells reveal feedback linking cell growth to cell cycle. Nature 494, 480–483 (2013).
Kirschenbaum, D. et al. Time-resolved single-cell transcriptomics defines immune trajectories in glioblastoma. Cell https://doi.org/10.1016/j.cell.2023.11.032 (2023).
Oyler-Yaniv, A. et al. A tunable diffusion-consumption mechanism of cytokine propagation enables plasticity in cell-to-cell communication in the immune system. Immunity 46, 609–620 (2017).
Uxa, S. et al. Ki-67 gene expression. Cell Death Differ. 28, 3357–3370 (2021).
Kari, S. et al. Programmed cell death detection methods: a systematic review and a categorical comparison. Apoptosis 27, 482–508 (2022).
Setten, E. et al. Understanding fibrosis pathogenesis via modeling macrophage-fibroblast interplay in immune-metabolic context. Nat. Commun. 13, 6499 (2022).
Adler, M. Endocytosis as a stabilizing mechanism for tissue homeostasis. Proc. Natl Acad. Sci. USA https://doi.org/10.1073/pnas.1714377115 (2018).
Laumont, C. M. & Nelson, B. H. B cells in the tumor microenvironment: multi-faceted organizers, regulators, and effectors of anti-tumor immunity. Cancer Cell 41, 466–489 (2023).
Waldman, A. D., Fritz, J. M. & Lenardo, M. J. A guide to cancer immunotherapy: from T cell basic science to clinical practice. Nat. Rev. Immunol. 20, 651–668 (2020).
Wu, S. Z. et al. A single-cell and spatially resolved atlas of human breast cancers. Nat. Genet. 53, 1334–1347 (2021).
Lebel, Y., Milo, T., Bar, A., Mayo, A. & Alon, U. Excitable dynamics of flares and relapses in autoimmune diseases. iScience 26, 108084 (2023).
Stanton, S. E., Adams, S. & Disis, M. L. Variation in the incidence and magnitude of tumor-infiltrating lymphocytes in breast cancer subtypes: a systematic review. JAMA Oncol. 2, 1354–1360 (2016).
Toney, N. J. et al. B cells enhance IL-1β driven invasiveness in triple negative breast cancer. Sci. Rep. 15, 2211 (2025).
Yoshizaki, A. et al. Regulatory B cells control T-cell autoimmunity through IL-21-dependent cognate interactions. Nature 491, 264–268 (2012).
Davidson-Pilon, C. lifelines, Survival analysis in Python. Zenodo https://doi.org/10.5281/zenodo.14007206 (2024).
Waskom, M. L. seaborn: Statistical data visualization. J. Open Source Softw. 6, 3021 (2021).
Weinreb, C., Wolock, S., Tusi, B. K., Socolovsky, M. & Klein, A. M. Fundamental limits on dynamic inference from single-cell snapshots. Proc. Natl Acad. Sci. USA 115, E2467–E2476 (2018).
Giesen, C. et al. Highly multiplexed imaging of tumor tissues with subcellular resolution by mass cytometry. Nat. Methods https://doi.org/10.1038/nmeth.2869 (2014).
Keren, L. et al. MIBI-TOF: a multiplexed imaging platform relates cellular phenotypes and tissue structure. Sci. Adv. 5, eaax5851 (2019).
Goltsev, Y. et al. Deep profiling of mouse splenic architecture with CODEX multiplexed imaging. Cell 174, 968–981.e15 (2018).
Lin, J.-R. et al. Highly multiplexed immunofluorescence imaging of human tissues and tumors using t-CyCIF and conventional optical microscopes. eLife 7, e31657 (2018).
Tirado-Lee, L. Spatially resolved transcriptomics: an introductory overview of spatial gene expression profiling methods. 10X Genomics https://www.10xgenomics.com/blog/spatially-resolved-transcriptomics-an-introductory-overview-of-spatial-gene-expression- profiling-methods (2023).
Ståhl, P. L. et al. Visualization and analysis of gene expression in tissue sections by spatial transcriptomics. Science 353, 78–82 (2016).
Acknowledgements
We thank A. Aharoni-Somer, I. Kessler, I. Itzhak, R. Scherz-Shouval, S. Miyara, I. Ben-Shalom, Y. Lebel, A. Mayo, S. Mayer, T. Milo, L. Keren, N. Yosef, S. Itzkovitz, U. Shalit, R. Kishony, S. Shen-Orr, R. Meir and all members of our laboratories for discussions. J.S. was supported by the Adams Fellowship of the Israel Academy of Sciences and Humanities. This study was further supported by the Sagol Institute for Longevity Research, Cancer Research UK grant C19767/A27145 and the European Research Council under the European Union’s Horizon 2020 research and innovation program (grant agreement no.856487) to U.A.
Author information
Authors and Affiliations
Contributions
J.S., U.A. and S.M. conceived the study together. J.S. led the analyses and method development. S.M. and U.A. jointly supervised the research. All authors contributed to writing and revising the manuscript.
Corresponding authors
Ethics declarations
Competing interests
J.S., U.A. and S.M. are inventors on a patent application related to this work (PCT/IL2025/050139).
Peer review
Peer review information
Nature thanks Laleh Haghverdi and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Supplementary Table 1 (download CSV )
Raw data of velocities at all neighborhood compositions
Supplementary Table 2 (download CSV )
Raw data of velocities at all neighborhood compositions
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Somer, J., Mannor, S. & Alon, U. Temporal tissue dynamics from a spatial snapshot. Nature 650, 490–499 (2026). https://doi.org/10.1038/s41586-025-09876-1
Received:
Accepted:
Published:
Version of record:
Issue date:
DOI: https://doi.org/10.1038/s41586-025-09876-1
This article is cited by
-
Decoding TNBC architecture
Nature Cancer (2026)







