Spatial Patterning Analysis of Cellular Ensembles (SPACE) finds complex spatial organization at the cell and tissue levels.
Аннотация
Spatial patterns of cells and other biological elements drive physiologic and pathologic processes within tissues. While many imaging and transcriptomic methods document tissue organization, discerning these patterns is challenging, especially when they involve multiple elements in complex arrangements. To address this challenge, we present Spatial Patterning Analysis of Cellular Ensembles (SPACE), an R package for analysis of high-plex spatial data. SPACE is compatible with any data collection modality that records values (i.e., categorical cell/structure types or quantitative expression levels) at fixed spatial coordinates (i.e., 2d pixels or 3d voxels). SPACE detects not only broad patterns of co-occurrence but also context-dependent associations, quantitative gradients and orientations, and other organizational complexities. Via a robust information theoretic framework, SPACE explores all possible ensembles of tissue elements-single elements, pairs, triplets, and so on-and ranks the most strongly patterned ensembles. For single images, rankings reflect differences from random assortment. For sets of images, rankings reflect differences across sample groups (e.g., genotypes, treatments, timepoints, etc.). Further tools then characterize the nature of each pattern for intuitive interpretation. We validate SPACE and demonstrate its advantages using murine lymph node images for which ground truth has been defined. We then detect new patterns across varied datasets, including tumors and tuberculosis granulomas.
Другие публикации по теме
Перевод полного текста: Перевод в очереди
Полный текст источника
https://creativecommons.org/licenses/by-nc-nd/4.0/ This article is distributed under Creative Commons Attribution-NonCommercial-NoDerivatives License 4.0 (CC BY-NC-ND) .
Текст сохранён. Часть иллюстраций пока доступна только в первоисточнике; загрузка будет проверена повторно.
Biological tissue function emerges from the local interactions of diverse cells and structures. These interactions are determined by the spatial arrangement of the involved elements. Thus, finding new spatial patterns can reveal new mechanisms of tissue (dys)function ( 1 – 5 ).
Many technologies capture the spatial arrangements of deeply phenotyped cells and structures. Protein-targeted methods, using fluorescence ( 6 , 7 ), sequencing ( 8 ), or heavy metal isotopes ( 9 , 10 ), capture 30 to 100 molecular parameters at submicron resolution. Transcript-targeted methods capture hundreds of molecular parameters at similar resolution ( 11 – 13 ) or the entire transcriptome at lower spatial resolution ( 14 , 15 ). Multimodal techniques combine the advantages of several methods ( 16 ). In each case, dozens to hundreds of cell types and structures can be identified, in addition to the raw expression of hundreds to thousands of protein or mRNA biomolecules. These spatial elements are too numerous for manual exploration of combinatoric patterns.
Although many computational tools analyze high-plex spatial data, they fall into two broad approaches. The first approach detects quantitative patterns, but only among one or two elements. Marked point processes ( 17 ), Gaussian process regression ( 18 , 19 ), and generalized linear spatial models ( 20 ) determine whether single biomolecules are spatially variably expressed. Neighbor frequency ( 21 , 22 ), spatial correlation ( 23 – 25 ), and nearest distances ( 26 ) determine whether pairs of cell types or biomolecules are colocalized or mutually exclusive. Regardless of their statistical machinery, none of these methods detect patterns involving three or more elements. Moreover, the pairwise methods do not account for nonlinear or context-dependent patterns, i.e., patterns that differ qualitatively across tissue regions.
The second approach considers three or more elements simultaneously, but only in terms of discrete microenvironments (MEs). Methods of defining MEs include graph convolutional neural networks ( 27 ), hidden Markov random fields ( 28 , 29 ), graph-based community detection ( 30 ), K-means ( 31 , 32 ), and latent Dirichlet allocation ( 33 – 35 ). Regardless of the learning algorithm, the discrete nature of MEs cannot capture continuous features such as smooth gradients or orientations.
The “blind spots” of these two broad approaches overlap, such that continuous or context-dependent arrangements of three or more elements are not easily detected. Moreover, both approaches identify only patterns that differ from null expectations within a single specimen. Further customized analyses are required to discern how groups of biological specimens differ systematically from one another.
To overcome these limitations, we present Spatial Patterning Analysis of Cellular Ensembles (SPACE) ( Table 1 ), an information-theoretic algorithm that detects, validates, and characterizes spatial patterns of any complexity. SPACE is not merely a performance enhancement of existing approaches. Rather, SPACE is a conceptual invention of a third approach that detects arbitrarily complex patterns, even those in the shared “blind spot” of existing approaches.
Table 1.
Comparison of SPACE with other spatial analysis platforms
| Program | Input data | Continuous patterns | MEs | Tissue comparison | |||||||||
| Name | Platform | Expression | Objects | Linear | Non-linear | Automated | Custom | Within | Between | ||||
| Centroids | Image | Centroids | Image | 1 | 2 | 3 + | |||||||
| SPACE | R | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes |
| BayesSpace | R | Yes | No | No | No | No | No | No | No | Yes | No | Yes | No |
| CODEX Toolkit | GUI | Yes | No | Yes | No | Yes | Yes | No | No | Yes | No | Yes | No |
| CytoMAP | Matlab | Yes | No | Yes | No | No | Yes | No | No | Yes | No | Yes | No |
| Giotto | R | Yes | No | Yes | No | Yes | Yes | No | No | Yes | No | Yes | No |
| HistoCAT | GUI | Yes | No | Yes | No | Yes | Yes | No | No | No | No | Yes | No |
| ImaCytE | GUI | No | No | Yes | No | Yes | Yes | No | No | No | No | Yes | No |
| SIMPLI | Nextflow | Yes | No | Yes | No | Yes | Yes | No | No | No | No | Yes | No |
| SOMDE | Python | Yes | No | No | No | Yes | No | No | Yes | No | No | Yes | No |
| SpaGCN | Python | Yes | No | No | No | Yes | Yes | Yes | No | Yes | No | Yes | No |
| SPARK | R | Yes | No | No | No | Yes | No | No | Yes | No | No | Yes | No |
| SpatialDE | R/Python | Yes | No | No | No | Yes | No | No | Yes | No | No | Yes | No |
| SPIAT | R | Yes | No | Yes | No | Yes | Yes | No | No | Yes | No | Yes | No |
| SpiceMix | Python | Yes | No | No | No | No | No | No | No | Yes | No | Yes | No |
| Trendsceek | R | Yes | No | No | No | Yes | No | No | Yes | No | No | Yes | No |
| UTAG | Python | Yes | No | No | No | No | No | No | No | Yes | No | Yes | No |
| Visinity | GUI | No | No | Yes | No | No | Yes | No | No | Yes | Yes | Yes | No |
SPACE is compatible with data generated using any collection modality that records values at fixed spatial coordinates, whether 2d pixels, 3d voxels, or tabulated centroids. The values may be categorical objects (e.g., cell types or structures) or quantitative expression levels. For any ensemble of any number of these elements, SPACE quantifies the deviation from random patterning in a single specimen using a metric we call “cis mutual information” (cisMI). Across multiple specimens, SPACE quantifies how an ensemble’s spatial patterning differs across sample groups using a metric we call “trans mutual information” (transMI). SPACE exhaustively explores ensembles to discern the strongest patterns, which are then characterized in detail to reveal coassortment, gradients, orientations, and other complex and/or context-dependent features. SPACE is available as an open-source R package.
We demonstrate and validate SPACE on data from different collection modalities, host species and tissues, and input data formats ( SI Appendix , Table S1 ). We focus on the mouse lymph node (LN) where ground-truth patterning is known, as well as 3d imaging of a mouse tumor, a spatial transcriptome of human intestinal cancer, and a collection of human tuberculosis (TB) granulomas. In addition to recovering known patterns, SPACE provides an additional level of exploratory power that translates the enormous content of high-plex spatial data into a small set of spatial patterns most responsible for tissue organization.
Results
SPACE Algorithm.
Input data for SPACE can include images of molecular expression, segmented cells, pixel-based structures, and/or tables reporting the centroid, categorical type, and molecular expression of single cells ( Fig. 1 A ). Each input may be 2d or 3d. Multiple inputs representing the same specimen can be provided to integrate the molecular, cellular, and structural levels. Biological elements at any of these levels are simply called “variables” (see SI Appendix , Table S2 for a glossary). Across each layer of input data, 3d spherical or 2d circular neighborhoods are drawn ( Fig. 1 B ), and the content of each variable in each neighborhood is reported in a census ( Fig. 1 C and D ). A census may include multiple neighborhood sizes, for comparison across scales (e.g., cell contacts at 5 to 10 μm vs. microanatomical zonation at 50 to 100 μm). Contiguous patches of each variable are also recorded and reassorted into hypothetical randomized censuses ( Fig. 1 C ), which preserve sizes and morphology while eliminating spatial patterning ( Fig. 1 D ).
Иллюстрация — в первоисточнике ↗
Censuses are used to find patterns that differ from null expectations within a single specimen. For an ensemble of variables, the observed (co-)occurrence distributions are used to calculate interaction information—a generalization of mutual information that quantifies the patterning among variables which cannot be explained by any subset. This is essentially the difference between the true co-occurrence distribution vs. a predicted distribution of null expectations within a single specimen ( Fig. 1 E ). We call this cis-mutual information, or cisMI.
Censuses also reveal patterns that differ across groups of specimens. For an ensemble of variables, the observed co-occurrence distributions are used to calculate the Kullback–Leibler (KL) divergence, or essentially the difference in patterning, between pairs of specimens ( Fig. 1 F ). We call this trans-mutual information, or transMI. TransMI between every pair of specimens yields a fully connected network, where vertices represent specimens and edges are weighted by similarity of patterning ( Fig. 1 G ). When specimens belong to discrete sample groups, the modularity of this network can be calculated, quantifying how well the ensemble’s spatial patterning distinguishes sample groups.
Once cisMI or transMI modularity have been calculated, they are compared against a null distribution ( Fig. 1 H ). For cisMI, the null distribution is constructed by repeating the cisMI measurement on 100+ randomized censuses, to control for apparent patterning from tissue geometry or compositional abundances. For transMI modularity, the null distribution is constructed by permuting the network edge weights 100+ times, to control for apparent modularity from outlier specimens or small samples sizes. In either case, comparison against the null distribution yields a Z score and P value. These calculations are repeated for many ensembles, which are ranked by P value to reveal the most significantly patterned ensembles.
Low P values and high cisMI or transMI modularity identify ensembles of interest. To describe an ensemble’s patterning, its co-occurrence distribution is drawn in the multidimensional space defined by the abundance of each variable. A self-organizing map draws a curve through the areas of highest neighborhood density ( Fig. 1 I ), capturing the continuous spectrum of neighborhood compositions. The curve is projected into lower dimension by plotting the value of each variable along the curve. The resulting covariation plot shows how each variable in the ensemble covaries as the tissue is traversed along a hidden but illustrative (i.e., latent) path ( Fig. 1 J ). Neighborhoods with similar compositions map to similar positions on the latent path, such that traversing the latent path transitions across neighborhoods with smoothly varying compositions. This reveals context-dependent associations, quantitative gradients, and other features of an ensemble’s spatial patterning. The density of neighborhoods along the latent path is compared to a reference, from either a randomized census or a different sample group, to show enriched or depleted features of the ensemble’s spatial pattern ( Fig. 1 J ).
Finally, manual breakpoints can be drawn on the covariation plot, splitting the image into MEs with different amounts or gradients of the ensemble’s variables ( Fig. 1 K ). These MEs are mapped back onto the original image with new coloring ( Fig. 1 L ). Because MEs are formatted like other SPACE inputs, they can be recycled for further analysis of their own spatial patterning.
SPACE Detects Known Patterns and Gradients in the Mouse LN.
To compare SPACE against ground-truth, we used 20 markers from a 42-plex image of a mouse popliteal LN captured using IBEX ( 36 ). We segmented individual cells using CellPose 2.0 ( 37 ) and classified them into 19 well-studied types ( Fig. 2 A ) using a semisupervised algorithm ( SI Appendix Supporting Text and Fig. S1 ). On the resulting segmentation mask ( Fig. 2 B ), we censused neighborhoods of radius 10 µm to capture close cellular contacts. After examining every ensemble of one, two, or three cell types, there were 24 ensembles with patterning that was both substantial (|cisMI| > 0.05 bits) and significant ( P < 0.05 after Benjamini–Hochberg correction for multiple testing) ( Fig. 2 C ). Analyzing a table of cell centroids yields similar results ( SI Appendix , Fig. S2 and Dataset S1 ).
Иллюстрация — в первоисточнике ↗
Although not immunized, the mouse was conventionally housed, so we expected features of both a resting LN as well as mild immune activity. Indeed, the most significant ensemble involves germinal center (GC) dark zone (DZ) and light zone (LZ) B cells ( Fig. 2 C ). The covariation plot shows that DZ and LZ B cells co-occur in less than 15% of the image, a feature which is highly enriched compared to null expectations ( Fig. 2 D ). Within these concentrated regions, there are areas where DZ B cells dominate over LZ and vice versa. These features of the covariation plot represent the GC and its well-known subdivision into the DZ and LZ.
The third-most significant ensemble involves CD4 T cells in addition to DZ and LZ B cells, indicating that these GC subsets share further patterning relative to CD4 T cells (i.e., paracortical CD4 T cells, not follicular helper T cells, which were too rare to reveal statistically significant patterning). A covariation plot including CD4 T cells reveals that within the GC, DZ B cells abut the CD4 T cells (in the paracortical T zone), while LZ B cells are farther away ( Fig. 2 D , Inset ). Indeed, the orientation of GCs with the DZ facing the T zone is visually apparent ( Fig. 2 E ). While the internal structure of the GC can be explained by DZ and LZ B cells only, significant cisMI for the three-variable pattern is statistical evidence that GC orientation is also nonrandom.
The three-variable pattern with the largest cisMI involved CD4 T cells, CD8 T cells, and naïve B cells ( Fig. 2 C ). These define the largest microanatomical regions of the LN – the paracortical T zone and primary B follicles. Indeed, the covariation plot shows separate regions where T cells vs. naïve B cells dominate ( Fig. 2 F ). Additionally, within the T zone, CD4 and CD8 T cells form an opposing gradient: CD4 T cells dominate closer to the main B follicle and CD8 T cell dominate farther away. This T cell gradient is one of the most enriched features of the covariation plot compared to null expectations ( Fig. 2 F ) and is visually apparent ( Fig. 2 G ). Though the visual manifestation of this pattern depends on the slicing angle of the LN ( SI Appendix , Fig. S3 ), it remains that CD4 and CD8 T cells co-occur at large but oppose one another specifically within the B cell-devoid T zone. This context-dependent gradient of paracortical naive CD4 and CD8 T cells was discovered recently ( 38 ) using manual Histo-cytometry analyses ( 39 ), and SPACE recovers it automatically.
Additionally, CD8+ CD11b- dendritic cells (likely Type 1 conventional DCs, cDC1s) peak in abundance closer to the center of the T zone where CD8 T cells are concentrated, whereas CD8- CD11b+ dendritic cells (likely Type 2 conventional DCs, cDC2s) peak in abundance at the edge where CD4 T cells are concentrated ( 38 , 39 ). This is a four-element pattern, which we queried directly in SPACE and found to have significant cisMI ( P = 0.023). The covariation plot reveals that cDC1s peak in abundance in the T zone where CD8 T cells dominate, whereas cDC2s peak in abundance where CD4 T cells dominate ( Fig. 2 H ).
Many of these patterns found by SPACE are context-dependent, continuous, and multipartner. As such, they are largely inaccessible to other spatial analysis approaches. See SI Appendix Supporting Text and Figs. S4–S6 for benchmarking of SPACE against existing approaches.
SPACE Operates on Three-Dimensional Input Data.
To demonstrate SPACE’s compatibility with 3d data, we used an 808 µm × 753 µm x 270 µm volume of a murine MC38 tumor imaged using the Ce3D protocol ( 40 ). Based on fluorescent markers of CD3, CD4, CD8, and CD31, we generated a 3d rendering of CD4 T cells, CD8 T cells, and blood vessels in the tumor ( Fig. 3 A ). After censusing at 50 µm to capture broad patterns of cellular association, SPACE detects a significant pattern involving all three variables (|cisMI| = 0.17 bits, P = 1.01 × 10 −108 ), which we investigated further ( Fig. 3 B ).
Иллюстрация — в первоисточнике ↗
Many features of the covariation plot are informative. Much of the tumor is dominated either by T cells only (mostly CD8 T cells; 0 to 25% of latent path) or by blood vessels only (75 to 100%). Both features are enriched compared to null expectations. This indicates not only that T cells and blood vessels are separate structures but also that CD8 T cells outnumber CD4 T cells, especially in regions devoid of blood vessels, which we confirm via direct measurement ( Fig. 3 C ).
Regions where blood vessel content is intermediate (25 to 75% of latent path) reveal more subtle patterns. Where vessel content is medium-low, CD8 T cells equal or outnumber CD4 T cells (25 to 50%), and this is enriched vs. null expectations. Meanwhile, where vessel content is medium-high (50 to 75%), regions where CD4 T cells outnumber CD8 T cells are enriched (55 to 65%), but regions where CD8 T cells equal CD4 T cells (50 to 55% and 65 to 75%) are depleted. This indicates that specifically in the regions bordering blood vessels, CD4 T cells preferentially sit closer to vessels, which we confirm via direct measurement ( Fig. 3 D ). While the confirmations require custom analysis, all these nuances are available from a single SPACE command. Recent 3d intravital imaging reveals perivascular collections of T cell subsets in tumors ( 41 ) and after vaccination ( 42 ), consistent with SPACE’s findings.
SPACE Operates on Spatial Transcriptomic Input Data.
To demonstrate SPACE’s compatibility with spatial transcriptomic data, we used a 6.5 mm × 6.5 mm section of human intestinal colorectal cancer from the Visium Spatial Gene Expression protocol, publicly available from 10x Genomics. Filtering for transcripts that appear in at least half of the 2,660 spots yielded 6,914 transcripts. After censusing at 300 µm to capture groups of neighboring spots, we used SPACE to quantify cisMI for each individual transcript. CisMI correlates strongly with the global Moran’s I for each transcript published by 10x Genomics ( Fig. 4 A ).
Иллюстрация — в первоисточнике ↗
10x Genomics also used k-means clustering to group the spots into 8 MEs ( Fig. 4 B ). Each transcript’s abundance inside each ME was compared to its overall abundance using differential abundance testing. Only 13 transcripts significantly differed from their overall abundance in at least 4 of the 8 MEs. For these 13, we censused at 150 µm to capture directly neighboring spots, and we measured cisMI for ensembles of up to three transcripts ( Fig. 4 C ).
The 3-element ensemble with the highest cisMI includes MGAM2, GPX2, and PPP1R1B. The covariation plot shows that all three transcripts are positively correlated ( Fig. 4 D ), even beyond their pairwise correlations ( SI Appendix , Fig. S7 A – C ). In particular, the tissue region highly enriched for all three transcripts (87 to 100% on the latent path) corresponds closely to ME 5 ( Fig. 4 E ). The gated region on the covariation plot and ME 5 share a Cohen’s κ of 0.74 (0.70, 0.77), indicating “good” to “excellent” agreement ( Fig. 4 F ) ( 43 ).
While these patterns are accessible to existing methods, SPACE also finds new patterns. One of the top five significant ensembles includes SFRP2 and IGHG4. The covariation plot shows that these transcripts are positively correlated except at peak abundance, where there are two separate highly enriched regions: one where SFRP2 dominates over IGHG4 and vice versa ( Fig. 4 G ). This is not indicated by the overall positive correlation of SFRP2 and IGHG4 ( SI Appendix , Fig. S7 D ). Mapping these two regions onto the tissue reveals that neither corresponds well with any of the MEs ( Fig. 4 H ). Although both regions correspond best with ME 3, the gated regions on the covariation plot and ME 3 share Cohen’s κs of only 0.22 (0.18, 0.27) and 0.34 (0.29, 0.39), indicating “poor” agreement ( 43 ). Neither pairwise correlation nor discrete MEs capture this significant context-dependent pattern between SFRP2 and IGHG4, but SPACE does. Because the downregulation of SFRP2 is a marker of colorectal cancer ( 44 , 45 ), this pattern may reflect the role of immunoglobulin-expressing cells in infiltrating and combating tumors ( 46 , 47 ).
SPACE Directly Compares Spatial Patterning Across Sample Groups.
SPACE computes not only cisMI within a single specimen but also transMI to detect patterning differences across groups of specimens. To demonstrate transMI, we analyzed a publicly available set of human TB granulomas. Using a 37-plex MIBI-TOF panel, two 500 μm × 500 μm fields of view (FoVs) were imaged from each of 15 human TB patients ( 34 ). Of these patients, nine were undergoing diagnostic biopsies, three were undergoing therapeutic resections, and three were sampled postmortem. This range of clinical statuses may represent progressing disease. The original study uncovered patterns of granuloma organization that transcend clinical status (e.g., eight MEs with unique cell type compositions). Here, we identify further patterns that differ across clinical statuses.
Although few cellular abundances correlate with clinical status ( 34 ), SPACE measures two metrics of cellular diversity. Alpha diversity–the variety of cell types in each FoV ( Fig. 5 A )—is higher for biopsy and resection samples compared to postmortem ( Fig. 5 B ). Beta diversity—the distinctiveness of ME cellular compositions ( Fig. 5 C )—is higher in biopsy samples, compared to either resection or postmortem ( Fig. 5 D ).
Иллюстрация — в первоисточнике ↗
TransMI highlights specific patterns that differ across clinical statuses. We censused each FoV at 10 µm to capture close cellular interactions and measured transMI for ensembles of up to three cell types and/or cell-type-specific functional markers. Strikingly, every pattern that most significantly distinguishes the clinical statuses involves CD68 macrophages (“CD68 macs”) ( Fig. 5 E ). The SPACE covariation plot reveals that CD68 macs tend to cluster together in small regions of each FoV, which are particularly enriched in postmortem and resection samples compared to biopsy ( Fig. 5 F ). We confirmed this by comparing the observed fraction of neighborhoods with ≥90% CD68 macs against null expectations for every sample ( Fig. 5 G ).
We then investigated the ensemble that most significantly distinguishes the clinical statuses: neutrophil expression of IDO1, CD68 mac abundance, and CD11b/c CD206 macrophage (triple-positive “TP mac”) expression of PD-L1 ( Fig. 5 E ). Expression of PD-L1 by TP macs in the presence of CD68 macs is enriched in postmortem and resection samples vs. biopsy, while TP mac expression of PD-L1 in the absence of CD68 macs is depleted ( Fig. 5 H ). We confirmed this by explicitly modeling TP mac expression of PD-L1 as a function of local CD68 mac abundance and clinical status. In postmortem and resection samples, PD-L1 on TP macs increases with local CD68 mac abundance, while the opposite is true in biopsy samples (slopes significantly differ, P = 0.0003, Fig. 5 I ). We also confirmed visually that the highest PD-L1 expressing TP macs occur near CD68 macs in postmortem and resection samples but away from CD68 macs in biopsy ( Fig. 5 J , white arrows). A similar pattern involving CD68 macs and IDO1 expression on neutrophils was also suggested by SPACE ( Fig. 5 H ) and confirmed by linear modeling ( P = 1.73 × 10 −9 ). Because custom modeling requires preexisting hypotheses, nuanced patterns missed by existing analysis approaches would previously have been impossible to detect. However, SPACE can detect complex and subtle spatial patterns that correlate with clinical status.
Discussion
High-content images and spatial transcriptomics contain extensive information on tissue organization. To our knowledge, SPACE is the first analysis platform to quantify spatial patterns of any number of elements and any degree of complexity, such as continuous context-dependent gradients and orientations. These patterns may deviate from random assortment in a single specimen or distinguish among sample groups of specimens. In either case, SPACE ranks the exhaustively searched patterns, narrowing the rich information in the original data to the most significant patterns to be studied individually.
SPACE is compatible with many input data types and preprocessing steps. This paper includes multiplex imaging in both 2d and 3d, via fluorescence- and heavy metal isotope-based techniques, as well as spatial transcriptomics. Segmented cells, 3d surface renderings, and raw biomolecule quantification can all be analyzed, in full image or condensed table formats. Multiple representations of the same specimens can even be combined.
SPACE finds complex patterns that are inaccessible to existing analytical techniques. For example, in the mouse LN, pairwise associations cannot describe the opposing CD4 vs. CD8 T cell gradient specifically in the paracortex nor orientation of GCs with the DZ facing the paracortex, because both patterns are relative to a third cell type. Nor do MEs suffice, because both patterns involve continuous features that are not easily divided into discrete regions. Again, in human intestinal cancer, the tradeoff between IGHG4 and SFRP2 transcripts specifically where both are abundant is not detected by pairwise correlation nor by ME delineation. Thus, SPACE is not an incremental improvement in accuracy or power for existing approaches—it is a unique approach that detects a unique class of spatial patterns.
Therefore, even in the reanalysis of existing data, SPACE may provide additional insights. In a mouse tumor, the biased association of CD4 T cells toward blood vessels recalls literature showing that interactions between different T cell subsets and vasculature dictate trajectories of tumor growth ( 41 ) or infection ( 42 ). In human intestinal cancer, downregulation of SFRP2 expression promotes colorectal cancer cell proliferation ( 44 , 45 ). Meanwhile, cells expressing immunoglobulins (involving IGHG4), such as B cells and IgG plasma cells, infiltrate and help control colorectal tumors ( 46 , 47 ). The heterogeneous colocalization of IGHG4 and SFRP2 may reflect areas where humoral immunity is combating the cancer to different degrees of success.
The most insightful spatial patterns may be those that differ among sample groups. SPACE is one of the first spatial analysis platforms to make such statistical comparisons directly, as we demonstrate using the human TB dataset. SPACE finds that local accumulation of CD68 macs is more prevalent in the more severe disease cases (therapeutic resections and postmortem samples, compared to diagnostic biopsies), which has been observed in non-human primates ( 48 ). Near CD68 macs, immunoregulatory molecule expression, including PD-L1 on TP macs and IDO1 on neutrophils, increases in more severe disease cases but decreases in less severe cases. CD68 macs may play a crucial and bifurcating role in bacterial containment if they switch from a proinflammatory to a proregulatory role, perhaps as the result of some density-driven feedback, causing disease to progress. This is accompanied by a loss of beta then alpha diversity, suggesting that as immunological control deteriorates, ME integrity is lost as immune cell types first intermix and then begin to disappear from the granuloma altogether.
Speculative interpretations of the patterns in this study should be tempered, however. Sample sizes are small—just one for the cisMI demonstrations and just 15 TB patients. Potentially crucial metadata on comorbidities, ongoing treatments, etc. are missing. Moreover, static patterns are rarely sufficient evidence of dynamic processes. Thus, further work would be required to test the hypotheses proposed here. Another limitation of SPACE is computation time: because measuring cisMI for an ensemble requires entropy estimates for every sub-ensemble, datasets with many variables (e.g., thousands of unique transcripts) can include prohibitively many combinatoric ensembles. In such cases, prefiltering the variables is required to make SPACE computationally feasible. For example, SPACE analysis can be restricted to variables that surpass some threshold of total abundance or that are known to be functionally relevant. Nonetheless, SPACE greatly advances the ability to search exhaustively for complex spatial patterns, streamlining the process of hypothesis generation.
Although we developed SPACE with high-content tissue images in mind, SPACE can census and analyze any image-based data, from superresolution microscopy of single cells to remote sensing of earth’s surface. In fact, the information-theoretic calculation of cis- and transMI is agnostic to the data source, whether spatial or not. SPACE essentially performs a nonparametric test for divergences between distributions. While common nonparametric procedures compare the first moment of 1-dimensional distributions, SPACE compares the full shape of multidimensional distributions. Thus, SPACE could be a broadly useful statistical innovation. SPACE is available as a free, open-source R package that can be widely adopted and modified across many scientific fields.
Materials and Methods
SPACE Package.
SPACE is an R package, written in version 4.3.1 and developed on a laptop with 16 GB RAM and an 11th Gen Intel® Core™ i9-11900H 2.50 GHz processer. SPACE is open source and freely available from https://github.com/eschrom/SPACE , along with a tutorial demonstrating the usage of each function. Please see SI Appendix for a complete description of SPACE’s computational details and quantification of SPACE’s computational runtime, statistical power, and sensitivity and robustness.
Mouse LN Preparation.
The 42-parameter image of the mouse popliteal LN is publicly available https://zenodo.org/records/10870403 . The JOJO nuclear stain and CD45 membrane stain were supplied to Cellpose 2.0 ( 37 ) to obtain a segmentation mask of individual cells. Using an ImageJ macro, the mean fluorescent intensity (MFI) was calculated for each single cell, for 20 of the 42 fluorescent markers. A semisupervised algorithm in R was used to phenotype the cells based on their expression profiles. Please see SI Appendix for a complete description of this algorithm.
Mouse LN SPACE Analysis.
On the cellular segmentation mask of the 19 cell types, 8,609 neighborhoods of radius 10 µm were drawn using the SPACE “census_image” function. The 10 µm radius captures close cellular contacts, since the lymphocytes that comprise most of the LN are 5 to 7 µm in diameter. The number of neighborhoods was chosen to achieve 5× tissue coverage (i.e., each nonbackground pixel is included in an average of 5 neighborhoods), so that the tissue is thoroughly covered without excessive pseudoreplication.
From this census, cisMI was measured for all ensembles of one, two, or three cell types using the SPACE “measure_cisMI” function. This function also measured cisMI for the 4-element ensemble of CD4 T cells, CD8 T cells, cDC1s, and cDC2s. Ensembles for further exploration were chosen based on P value and/or cisMI magnitude. Covariation plots were generated using the SPACE “learn_pattern” function. Visualizations of representative regions were generated by aligning fluorescent staining with the segmented objects in ImageJ.
Censusing and cisMI measurement was performed identically using a table of cell centroids. To compare the table-based and image-based results, the cisMI Z scores for all 1,159 ensembles of one, two, or three variables were compared via linear regression.
Mouse Tumor 3D SPACE Analysis.
A 3d image of the mouse MC38 tumor was collected using the Ce3D protocol ( 40 ) for 6 fluorescent markers: MHCII, Lyve1, CD3, CD4, CD8, and CD31. After cropping to a smaller representative region in Imaris 10.0, the CD31 image was masked on MHCII and Lyve1 to remove spillover from these channels. The Imaris surface module was used to create 3d renderings of the CD31 blood vessels and the CD3 T cells. The CD3 T cells were then partitioned into CD4 T cells (CD4 MFI > 180 and CD8 MFI < 30) and CD8 T cells (CD4 MFI < 180 and CD8 MFI > 30). The ratio of total T cell volume to total blood vessel volume (79%) was used to estimate the number of expected vascular endothelial cells (3,464) relative to the number of T cells (4,388). The Imaris spots module was used to distribute 3,464 spots along the CD31+ blood vessel surfaces. The XYZ coordinates of each T cell and blood vessel spot were exported from Imaris.
These coordinates were loaded into SPACE, and 1,569 neighborhoods of radius 50 µm were drawn using the SPACE “census_table” function. The 50 µm radius captures broad cellular associations. The number of neighborhoods was chosen to achieve 5× tissue coverage.
From this census, cisMI was measured for the ensemble of all three object types (CD4 T cells, CD8 T cells, and blood vessels) using the SPACE “measure_cisMI” function. The covariation plot for the three-variable ensemble was created using the SPACE “learn_pattern” function.
To confirm the patterns found by SPACE, T cells were separated into those < 50 µm from the nearest blood vessel vs. those > 50 µm. The number of CD4 vs. CD8 T cells in each class was compared using a linear model with a binomial likelihood. The distance to the nearest vessel for CD4 vs. CD8 T cells in each class was compared using a linear model with a Gaussian likelihood.
Visium Human Intestinal Colorectal Cancer Analysis.
The 6.5 mm × 6.5 mm section of human colorectal cancer was publicly available from 10x Genomics at https://www.10xgenomics.com/datasets/human-intestine-cancer-1-standard , along with Moran’s I for individual transcripts, K-means clusterings, and differential abundance analyses across the 2,660 spots. After filtering for transcripts that appear in at least half of the spots, 6,914 transcripts remained. Using each spot as a seed point, 2,660 neighborhoods of radius 300 µm were drawn using the SPACE “census_table” function. The large neighborhood size was chosen because the target comparison metric, Moran’s I, is a global measure. CisMI was calculated for each transcript individually using the “measure_cisMI” function. After filtering out 36 additional transcripts with negative Moran’s I, the Moran’s I values were log-transformed and compared with cisMI via standardization and linear regression.
The differential abundance analysis identified 13 transcripts that significantly differ from their global means in at least 4 of the 8 MEs. Using each spot as a seed point, 2,660 neighborhoods of radius 150 µm were drawn using the SPACE “census_table” function. The smaller neighborhood size was chosen because the target comparison metric, k-means MEs, were drawn at the scale of individual spots. CisMI was calculated for ensembles of up to three transcripts using the “measure_cisMI” function. The covariation plots for specific ensembles were drawn using the “learn_pattern” function.
After drawing gates on the covariation plots to assign regions of interest, these regions were mapped onto the tissue by assigning each spot to its most similar self-organizing map node. After counting the number of mapped spots belonging to each ME, a 2 × 2 table reported the total number of spots that belong to the gated covariation region, the top-matching ME, both, or neither. Cohen’s κ was calculated from this table to quantify the agreement between the gated feature(s) of the covariation plot and the top-matching ME.
Correlations between pairs of transcripts were measured across all 2,660 spots by standardizing the transcript counts and performing linear regression.
Human TB Analysis.
The 30 TB FoVs, including phenotyped cells, MEs, and functional marker expression, were publicly available from ref. 34 . The cellular alpha and beta diversity of each FoV were measured using the “alpha_diversity” and “beta_diversity” SPACE functions. Diversity metrics were compared across clinical statuses using a linear model with clinical status as a categorical predictor.
On each FoV, 1,825 neighborhoods of radius 10 µm were drawn using the SPACE “census_image” function. The 10 µm radius captures close cellular associations. The number of neighborhoods was chosen to achieve 5× tissue coverage.
The total list of cell types, MEs, and cell-type-specific marker expression was reduced to variables that occur in at least 3 of the 6 resection FoVs, at least 3 of the 6 postmortem FoVs, and at least 9 of the 18 biopsy FoVs. TransMI was measured for every ensemble of up to three of these variables at a time using the SPACE “measure_transMI” function. Covariation plots were created using the SPACE “learn_pattern” function.
To measure the frequency of CD68 mac aggregates in each FoV, the fraction of neighborhoods with ≥ 90% CD68 macs from the observed census was divided by the same fraction from a randomized census, generated using the SPACE “plot_dist” function. The logarithms of these ratios were compared across clinical statuses using a linear model with clinical status as a categorical predictor.
To quantify how cell-type-specific marker expression (PD-L1 on TP macs or IDO on neutrophils) depends on local CD68 mac abundance and/or clinical status, all neighborhoods with nonzero cell-type-specific marker expression were pooled from the observed censuses. The log of cell-type-specific marker expression was then regressed on the interaction of local CD68 mac abundance and clinical status (where resection and postmortem were pooled), with a random effect of patient ID.
Reproducibility.
For all datasets, R scripts containing the code for SPACE and other analyses are available from https://github.com/eschrom/SPACE_Publication_Analyses .
Supplementary Material
Appendix 01 (PDF)
Dataset S01 (CSV)
This research was supported by the Division of Intramural Research of NIAID, NIH, the Center for Cancer Research, NCI, NIH, and the Chan-Zuckerberg Initiative.
Author contributions
E.C.S. and R.N.G. designed research; E.C.S., A.J.R., H.I., and A.A.-M. performed research; E.C.S., E.F.M., V.S., and A.J.R. contributed new reagents/analytic tools; E.C.S., E.F.M., A.J.R., H.I., E.S., L.A., N.T., S.G., and R.N.G. analyzed data; and E.C.S., E.F.M., A.J.R., E.S., L.A., and R.N.G. wrote the paper.
Competing interests
The authors declare no competing interest.
Reviewers: A.R., Genentech; and R.D.S., Washington University in St. Louis School of Medicine.
Data, Materials, and Software Availability
3D image data will be deposited in Zenodo. Previously published data were used for this work ( 34 , 36 , 49 , 50 ).
1 C. Baccin , Combined single-cell and spatial transcriptomics reveal the molecular, cellular and spatial bone marrow niche organization . Nat. Cell Biol. 22 , 38 – 48 ( 2020 ), 10.1038/s41556-019-0439-6 . 31871321 PMC7610809
2 A. Saviano , Single-cell genomics and spatial transcriptomics: Discovery of novel cell states and cellular interactions in liver physiology and disease biology . J. Hepatol. 73 , 1219 – 1230 ( 2020 ), 10.1016/j.jhep.2020.06.004 . 32534107 PMC7116221
3 S. M. Lewis , Spatial omics and multiplexed imaging to explore cancer biology . Nat. Methods 18 , 997 – 1012 ( 2021 ), 10.1038/s41592-021-01203-6 . 34341583
4 A. F. Rendeiro , The spatial landscape of lung pathology during COVID-19 progression . Nature 593 , 564 – 569 ( 2021 ), 10.1038/s41586-021-03475-6 . 33780969 PMC8204801
5 R. N. Germain , Understanding immunity in a tissue-centric context: Combining novel imaging methods and mathematics to extract new insights into function and dysfunction . Immunol. Rev. 306 , 8 – 24 ( 2022 ), 10.1111/imr.13052 . 34918351
6 J. R. Lin , Cyclic immunofluorescence (CycIF), A highly multiplexed method for single-cell imaging . Curr. Protoc. Chem. Biol. 8 , 251 – 264 ( 2016 ), 10.1002/cpch.14 . 27925668 PMC5233430
7 A. J. Radtke , IBEX: An iterative immunolabeling and chemical bleaching method for high-content imaging of diverse tissues . Nat. Protoc. 17 , 378 – 401 ( 2022 ), 10.1038/s41596-021-00644-9 . 35022622 PMC13430508
8 S. Black , CODEX multiplexed tissue imaging with DNA-conjugated antibodies . Nat. Protoc. 16 , 3802 – 3835 ( 2021 ), 10.1038/s41596-021-00556-8 . 34215862 PMC8647621
9 C. Giesen , Highly multiplexed imaging of tumor tissues with subcellular resolution by mass cytometry . Nat. Methods 11 , 417 – 422 ( 2014 ), 10.1038/nmeth.2869 . 24584193
10 L. Keren , MIBI-TOF: A multiplexed imaging platform relates cellular phenotypes and tissue structure . Sci. Adv. 5 , eaax5851 ( 2019 ), 10.1126/sciadv.aax5851 . 31633026 PMC6785247
11 C. L. Eng , Transcriptome-scale super-resolved imaging in tissues by RNA seqFISH . Nature 568 , 235 – 239 ( 2019 ), 10.1038/s41586-019-1049-y . 30911168 PMC6544023
12 C. Xia , Spatial transcriptome profiling by MERFISH reveals subcellular RNA compartmentalization and cell cycle-dependent gene expression . Proc. Natl. Acad. Sci. U.S.A. 116 , 19490 – 19499 ( 2019 ), 10.1073/pnas.1912459116 . 31501331 PMC6765259
13 J. R. Moffitt , The emerging landscape of spatial profiling technologies . Nat. Rev. Genet. 23 , 741 – 759 ( 2022 ), 10.1038/s41576-022-00515-3 . 35859028
14 P. L. Ståhl , Visualization and analysis of gene expression in tissue sections by spatial transcriptomics . Science 353 , 78 – 82 ( 2016 ), 10.1126/science.aaf2403 . 27365449
15 A. Rao , Exploring tissue architecture using spatial transcriptomics . Nature 596 , 211 – 220 ( 2021 ), 10.1038/s41586-021-03634-9 . 34381231 PMC8475179
16 K. Vandereyken , Methods and applications for single-cell and spatial multi-omics . Nat. Rev. Genet. 24 , 494 – 515 ( 2023 ), 10.1038/s41576-023-00580-2 . 36864178 PMC9979144
17 D. Edsgärd , Identification of spatial expression trends in single-cell gene expression data . Nat. Methods 15 , 339 – 342 ( 2018 ), 10.1038/nmeth.4634 . 29553578 PMC6314435
18 V. Svensson , SpatialDE: Identification of spatially variable genes . Nat. Methods 15 , 343 – 346 ( 2018 ), 10.1038/nmeth.4636 . 29553579 PMC6350895
19 M. Hao , SOMDE: A scalable method for identifying spatially variable genes with self-organizing map . Bioinformatics 37 , 4392 – 4398 ( 2021 ), 10.1093/bioinformatics/btab471 . 34165490
20 S. Sun , Statistical analysis of spatial expression patterns for spatially resolved transcriptomic studies . Nat. Methods 17 , 193 – 200 ( 2020 ), 10.1038/s41592-019-0701-7 . 31988518 PMC7233129
21 D. Schapiro , histoCAT: Analysis of cell phenotypes and interactions in multiplex image cytometry data . Nat. Methods 14 , 873 – 876 ( 2017 ), 10.1038/nmeth.4391 . 28783155 PMC5617107
22 Y. Goltsev , Deep profiling of mouse splenic architecture with CODEX multiplexed imaging . Cell 174 , 968 – 981.e15 ( 2018 ), 10.1016/j.cell.2018.07.010 . 30078711 PMC6086938
23 C. R. Stoltzfus , CytoMAP: A spatial analysis toolbox reveals features of myeloid cell organization in lymphoid tissues . Cell Rep. 31 , 107523 ( 2020 ), 10.1016/j.celrep.2020.107523 . 32320656 PMC7233132
24 R. Dries , Giotto: A toolbox for integrative analysis and visualization of spatial expression data . Genome Biol. 22 , 78 ( 2021 ), 10.1186/s13059-021-02286-2 . 33685491 PMC7938609
25 S. Warchol , Visinity: Visual spatial neighborhood analysis for multiplexed tissue imaging data . IEEE Trans. Vis. Comput. Graph. 29 , 106 – 116 ( 2023 ), 10.1109/TVCG.2022.3209378 . 36170403 PMC10043053
26 M. Bortolomeazzi , A SIMPLI (Single-cell Identification from MultiPLexed Images) approach for spatially-resolved tissue phenotyping at single-cell resolution . Nat. Commun. 13 , 781 ( 2022 ), 10.1038/s41467-022-28470-x . 35140207 PMC8828885
27 J. Hu , SpaGCN: Integrating gene expression, spatial location and histology to identify spatial domains and spatially variable genes by graph convolutional network . Nat. Methods 18 , 1342 – 1351 ( 2021 ), 10.1038/s41592-021-01255-8 . 34711970
28 E. Zhao , Spatial transcriptomics at subspot resolution with BayesSpace . Nat. Biotechnol. 39 , 1375 – 1384 ( 2021 ), 10.1038/s41587-021-00935-2 . 34083791 PMC8763026
29 B. Chidester , SPICEMIX enables integrative single-cell spatial modeling of cell identity . Nat. Genet. 55 , 78 – 88 ( 2023 ), 10.1038/s41588-022-01256-z . 36624346 PMC9840703
30 J. Kim , Unsupervised discovery of tissue architecture in multiplexed imaging . Nat. Methods 19 , 1653 – 1661 ( 2022 ), 10.1038/s41592-022-01657-2 . 36316562 PMC11102857
31 C. M. Schürch , Coordinated cellular neighborhoods orchestrate antitumoral immunity at the colorectal cancer invasive Front . Cell 182 , 1341 – 1359.e19 ( 2020 ), 10.1016/j.cell.2020.07.005 . 32763154 PMC7479520
32 A. J. Radtke , Multi-omic profiling of follicular lymphoma reveals changes in tissue architecture and enhanced stromal remodeling in high-risk patients . Cancer Cell 42 , 444 – 463.e10 ( 2024 ), 10.1016/j.ccell.2024.02.001 . 38428410 PMC10966827
33 Z. Chen , Modeling multiplexed images with spatial-LDA reveals novel tissue microenvironments . J. Comput. Biol. 27 , 1204 – 1218 ( 2020 ), 10.1089/cmb.2019.0340 . 32243203 PMC7415889
34 E. F. McCaffrey , The immunoregulatory landscape of human tuberculosis granulomas . Nat. Immunol. 23 , 318 – 329 ( 2022 ), 10.1038/s41590-021-01121-x . 35058616 PMC8810384
35 A. J. Nirmal , The spatial landscape of progression and immunoediting in primary melanoma at single-cell resolution . Cancer Discov. 12 , 1518 – 1541 ( 2022 ), 10.1158/2159-8290.CD-21-1357 . 35404441 PMC9167783
36 A. J. Radtke , IBEX: A versatile multiplex optical imaging approach for deep phenotyping and spatial analysis of cells in complex tissues . Proc. Natl. Acad. Sci. U.S.A. 117 , 33455 – 33465 ( 2020 ), 10.1073/pnas.2018488117 . 33376221 PMC7776876
37 M. Pachitariu , C. Stringer , Cellpose 2.0: How to train your own model . Nat. Methods 19 , 1634 – 1641 ( 2022 ), 10.1038/s41592-022-01663-4 . 36344832 PMC9718665
38 A. P. Baptista , The chemoattractant receptor Ebi2 drives intranodal naive CD4+ T Cell peripheralization to promote effective adaptive immunity . Immunity 50 , 1188 – 1201.e6 ( 2019 ), 10.1016/j.immuni.2019.04.001 . 31053504
39 M. Y. Gerner , Histo-cytometry: A method for highly multiplex quantitative tissue imaging analysis applied to dendritic cell subset microanatomy in lymph nodes . Immunity 37 , 364 – 376 ( 2012 ), 10.1016/j.immuni.2012.07.011 . 22863836 PMC3514885
40 W. Li , High-dimensional cell-level analysis of tissues with Ce3D multiplex volume imaging . Nat. Protoc. 14 , 1708 – 1733 ( 2019 ), 10.1038/s41596-019-0156-4 . 31028373 PMC8690297
41 M. Di Pilato , CXCR6 positions cytotoxic T cells to receive critical survival signals in the tumor microenvironment . Cell 184 , 4512 – 4530.e22 ( 2021 ), 10.1016/j.cell.2021.07.015 . 34343496 PMC8719451
42 H. Prizant , CXCL10+ peripheral activation niches couple preferred sites of Th1 entry with optimal APC encounter . Cell Rep. 36 , 109523 ( 2021 ), 10.1016/j.celrep.2021.109523 . 34380032 PMC9218982
43 J. L. Fleiss , Statistical Methods for Rates and Proportions ( John Wiley , New York , 1981 ).
44 Z. Bai , Effects of YAP1 and SFRP2 overexpression on the biological behavior of colorectal cancer cells and their molecular mechanisms . J. Gastrointest. Oncol. 12 , 1601 – 1612 ( 2021 ), 10.21037/jgo-21-418 . 34532114 PMC8421884
45 D. Müller , DNA methylation-based diagnostic, prognostic, and predictive biomarkers in colorectal cancer . Biochim. Biophys. Acta Rev. Cancer 1877 , 188722 ( 2022 ), 10.1016/j.bbcan.2022.188722 . 35307512
46 G. Bindea , Spatiotemporal dynamics of intratumoral immune cells reveal the immune landscape in human cancer . Immunity 39 , 782 – 795 ( 2013 ), 10.1016/j.immuni.2013.10.003 . 24138885
47 J. Xia , Single-cell landscape and clinical outcomes of infiltrating B cells in colorectal cancer . Immunology 168 , 135 – 151 ( 2023 ), 10.1111/imm.13568 . 36082430
48 L. Hunter , Dynamics of macrophage, T and B cell infiltration within pulmonary granulomas induced by mycobacterium tuberculosis in two non-human primate models of aerosol infection . Front. Immunol. 12 , 776913 ( 2022 ), 10.3389/fimmu.2021.776913 . 35069548 PMC8770544
49 10x Genomics, Data from “Human Intestine Cancer (FFPE).” 10xgenomics.com . https://www.10xgenomics.com/datasets/human-intestine-cancer-1-standard . Deposited 28 March 2022.
50 E. C. Schrom , SPACE. Github . https://github.com/eschrom/SPACE . Deposited 29 May 2024.
Supporting Information
Предметные рубрики MeSH
Подготовка и перевод публикации
Обработка статьи · этапы, ошибки и управление
Ошибки и ограничения
История · было → стало
Состояние обновляется каждые 5 секунд, пока блок открыт. Процент показывается только там, где известен объём работы. Пауза останавливает продолжение этапа; текущий запрос к источнику может завершиться.
Тип публикации указан по данным источника. Уровень доказательности автоматически не присваивается.