Abstract
Dissecting tissue compartments in spatial transcriptomics (ST) remains challenging due to limited spatial resolution and dependence on single-cell reference data. We present Chrysalis, a computational method that rapidly uncovers tissue compartments through spatially variable gene (SVG) detection and archetypal analysis without requiring external reference data. Additionally, it offers a unique visualisation approach for swift tissue characterisation and provides access to the underlying gene expression signatures, enabling the identification of spatially and functionally distinct cellular niches. Chrysalis was evaluated through various benchmarks and validated against deconvolution, independently obtained cell type abundance data, and histopathological annotations, demonstrating superior performance compared to other algorithms on both in silico and real-world test examples. Furthermore, we showcased its versatility across different technologies, such as Visium, Visium HD, Slide-seq, and Stereo-seq.
Subject terms: Machine learning, Software
Chrysalis, a machine learning-based framework accurately infers cellular niches and underlying gene expression programs in the tissue from spatial transcriptomics data. It demonstrates robust performance on a diverse set of tissues and platforms.
Introduction
ST is a rapidly evolving field dedicated to profiling the transcriptome of cells in their native tissue context, facilitating the identification of different spatial domains or cellular niches. Deciphering these elements is crucial, as they provide insights into the tissue’s spatial structure, which largely determines its function1. Lacking single-cell resolution, a major obstacle in sequencing-based ST technologies, such as 10x Visium2, HDST3, Pixel-seq4, Decoder-seq5, or Slide-seq6, lies in the precise identification of such cellular niches. These platforms face the multi-cell spot problem either due to their limited spatial resolution or reduced RNA capture efficiency, which requires binning the capture spots to a lower resolution before analysis (e.g., Visium HD7). This may lead to transcripts from a diverse group of cells being captured within a single capture spot, masking the true cellular makeup of the tissue8. To decipher cellular niches, given these constraints, various computational methods have been developed, including unsupervised clustering9–12, cell type deconvolution13, and factor analysis14,15. Although these methods provide valuable insights, certain limitations restrict their applicability and accuracy.
Unsupervised clustering methods have been adapted from single-cell RNA-sequencing (scRNA-seq) data analysis, where each observation corresponds to a single cell16. Novel ST clustering methods have further incorporated spatial information17 and tissue morphology10. However, the fundamental challenge for these methods remains in the assignment of spots that simultaneously capture information from multiple cell types into individual categories, which inherently overlooks their complexity.
Deconvolution methods were developed to tackle this problem by estimating the cell type composition of the tissue through cell type-specific reference signatures acquired from single-cell or single-nucleus sequencing data. Using these signatures, deconvolution techniques decompose ST data by various machine learning methods, such as optimal transport18, graph-based19, or probabilistic models20,21. Although deconvolution methods present a substantial improvement over clustering, their accuracy is limited by the availability of representative single-cell or single-nucleus RNA-seq datasets, which are often difficult to obtain. This limitation is further amplified by biological heterogeneity and technical variability between modalities22. Moreover, identifying new cell types presents an additional challenge for deconvolution methods, as scRNA-seq may capture different cell types with varying efficiency due to technical limitations23, leading to biased reference data. Reference-free deconvolution strategies24 aim to uncover cell type-specific patterns without external reference, however, in complex tissues the decomposed latent factors may not be directly linked to specific cell types or states, resulting in decreased performance13,25.
Factor analysis techniques such as MEFISTO15, NSF14, and SpatialPCA26 offer an alternative reference-free approach by generating low-dimensional representations of the gene expression data that capture spatial domains. MEFISTO achieves this by building a probabilistic model that relies on Gaussian processes, while NSF employs Gaussian processes with non-negative constraints to create spatially aware latent factors. SpatialPCA utilises a spatially-informed probabilistic PCA implementation to infer spatial domains. Additionally, deep learning-based frameworks utilise spatial graphs to learn latent gene expression representations incorporating structural information. For example, STAGATE27 leverages a graph attention autoencoder, while GraphST28 uses a graph self-supervised contrastive learning strategy to learn low-dimensional representations. Despite incorporating spatial information, the biological interpretability of factor analysis methods may be limited due to the absence of constraints guiding the identification of biologically meaningful domains29. Furthermore, in deep learning-based approaches, nonlinear transformations hinder the ability to trace how input features are combined and weighted, making it challenging to understand the driving biological mechanisms in the inferred representation30.
To address these limitations, we introduce Chrysalis, a computational method for the rapid detection of spatially and functionally distinct spatial domains, that we refer to as tissue compartments, on sequencing-based ST platforms without requiring external references. Chrysalis builds on archetypal analysis31, a robust matrix decomposition method that has been shown to successfully identify functional trade-offs in multi-task biological systems by capturing function-specific archetypes32. It has further demonstrated its effectiveness in single-cell and imaging mass cytometry analyses by capturing key features during cancer and tissue development33–35, and more recently in a reference-free deconvolution method36. Chrysalis additionally utilises spatial information from the ST data by extracting SVGs and, if available, combining them with morphological features obtained from the histological image of the tissue. This approach enables the identification of tissue compartments based on the combination of morphological characteristics and gene expression profiles.
Here, we evaluate Chrysalis on both synthetic data and native tissue samples across several ST platforms. Our in silico benchmarks demonstrate that Chrysalis captures tissue zone signatures with increased sensitivity and robustness. On 10x Visium-derived biological samples, Chrysalis routinely detects tissue compartments with high accuracy, maps immune cell niches in the human lymph node, identifies intratumoral heterogeneity in the human breast, and uncovers cortical layers in the mouse brain. Additionally, we show the applicability of Chrysalis on Visium HD, Stereo-seq, and Slide-seqV2.
Results
Overview of Chrysalis
The overall workflow of Chrysalis is presented in Fig. 1. Chrysalis first detects SVGs in the ST data (Fig. 1a). Next, Chrysalis obtains a low-dimensional representation of the SVGs using principal component analysis (PCA). This low-dimensional embedding can be further augmented by incorporating morphological features extracted using different deep learning algorithms. To perform this, Chrysalis first obtains image tiles overlapping with each capture spot from the corresponding haematoxylin-eosin stained (H&E) histology image. We implemented a simple deep autoencoder architecture in Chrysalis to extract latent morphological variables; however, alternative architectures that may capture more complex morphological features can be freely used. Chrysalis subsequently combines these latent representations with the low-dimensional transcriptional information. In the following step, Chrysalis identifies tissue compartments (archetypes) by archetypal decomposition of the low-dimensional feature space. These correspond to capture spots that are exclusively covered by a particular cellular niche (Fig. 1b). Every other spot that contains signatures from multiple compartments is represented as a convex combination of these archetypes. Thus, tissue compartments denote spatially distinct functional units in the tissue. Finally, the weight of each SVG’s expression is calculated by multiplying the matrix containing the tissue compartment input feature contributions (matrix ) with the PCA loadings. In addition, Chrysalis features a distinctive approach based on maximum intensity projection (MIP) to visualise various tissue compartments simultaneously, facilitating the rapid characterisation of spatial relationships across the inferred domains.
Fig. 1. Chrysalis overview.
a Chrysalis takes SVGs from the gene expression matrix to construct a low-dimensional representation of ST data using dimensionality reduction. This can be augmented by integrating morphological feature vectors extracted from the corresponding H&E image tiles. By leveraging archetypal analysis, the original feature matrix is decomposed into two matrices, and , where contains the tissue compartment score for each observation and stores the contributions of the basis vectors for the tissue compartments. can be used to reconstruct the weights of individual SVGs for compartments. Finally, SVG weights are calculated by multiplying with the PCA loading matrix . Additionally, Chrysalis uses a MIP-based visualisation to project to the tissue space. b Chrysalis finds discrete tissue compartments that appear as vertex points of a multi-dimensional simplex fitted to the low-dimensional feature space. These correspond to capture spots exclusively covered by one distinct cellular niche, and every other capture spot containing the mixture of these compartments is represented as a linear combination of them.
Evaluation and benchmarking on synthetic data
As a proof of concept, we first evaluated the performance of Chrysalis in capturing tissue domains on synthetic ST data. We implemented a synthetic ST data generator based on prior works20,37 and used it to generate a comprehensive and heterogeneous in silico ST dataset. Briefly, we generated overlapping spatial patterns (tissue zones) on rectangular spatial grids consisting of 50 50 spots. We extracted different cell types from the Tabula Sapiens38 immune cell atlas, and independently assigned them to the aforementioned tissue zones (Fig. 2a). Cell abundances were then allocated to the capture spots, with individual cells drawn from the immune cell atlas. Next, we summed up the gene counts corresponding to the assigned cells for each capture spot and modelled the effect of technical confounders. We generated samples with varying numbers of tissue zones and introduced background cell populations to obscure the tissue zones’ signatures. Additionally, we introduced variability in the number of cell types assigned to the tissue zones and granularity in the spatial pattern generation process. The resulting dataset of 72 samples represents a comprehensive test environment for capturing the original tissue zone signatures from the count data.
Fig. 2. Validation and benchmarking of Chrysalis on synthetic ST data.
a Synthetic data was produced by generating spatial patterns (tissue zones) and assigning cells to these by drawing them from single-cell reference data. Synthetic counts for each capture spot were derived from the assigned single cells after adding the effects of technical variations, such as sequencing depth and contamination. b Synthetic tissue zones generated with Gaussian processes and the tissue compartments estimated by Chrysalis. c MIP of the tissue compartments estimated by Chrysalis of the sample shown in (b). d Heatmap showing the Pearson correlation coefficient between the tissue zones and the tissue compartments predicted by Chrysalis for the sample shown in (b). e Graphical description of the different conditions established for the generation of the main in silico dataset. f Boxplots showing the average Pearson’s r value distributions of the benchmarked methods on the main synthetic dataset of 72 samples (centre line: median, box limits: upper and lower quartiles, whiskers: 1.5x interquartile range, large black dot: average value, small grey dots: individual values). g Graphical description of the different conditions established for the generation of the technical variation and array size in silico datasets. h Heatmaps showing the effect of technical variation on the performance of Chrysalis across the 24 conditions (three samples per condition were averaged, and standard deviations are reported inside the heatmap tiles).
We evaluated Chrysalis by calculating Pearson correlation coefficients between its inferred tissue compartments and the synthetic tissue zones (Fig. 2b, c). In a demonstrative example, the correlation matrix shows that the tissue compartments are highly specific to the simulated tissue zones (Fig. 2d). We benchmarked the overall performance of Chrysalis against two factor decomposition methods, MEFISTO15, NSF14, and two deep learning-based approaches, STAGATE27 and GraphST28. We first calculated the average of the Pearson correlation coefficients between the inferred latent factors (referred to as domain scores) and the tissue zones for each sample in the synthetic dataset (Supplementary Fig. 1) and examined these average values (Fig. 2e, f). Across the different tested conditions, we found that Chrysalis provided a more accurate representation of the tissue zones compared to the other tested methods.
We subsequently assessed the robustness of Chrysalis against technical variation. To this end, we generated an additional dataset based on three distinct synthetic tissue samples, each retaining its original cellular composition and spatial patterns. For each sample, we created 24 variations by altering effective sequencing depths [1, 0.2, 0.04, 0.008, 0.0016, 0.00032] and contamination fractions [0.03, 0.09, 0.27, 0.81]. This resulted in a total of 72 samples. The performance of Chrysalis remained stable until the effective sequencing depth was downsampled to 4% of the original depth, which was simulated by proportionally reducing the counts in the datasets. A significant performance drop was observed at a contamination fraction of 0.81 (Fig. 2g, h). Beyond this point, the correlation with the tissue zones consistently declined, mirroring trends seen in other benchmarked methods (Supplementary Fig. 2). In addition, we assessed the impact of the number of capture spots forming the samples. Chrysalis and competitor methods were evaluated on a set of samples containing 625, 1250, and 2500 capture spots. Here, Chrysalis showed the highest and most consistent correlation with the synthetic tissue zones (Fig. 2g and Supplementary Fig. 3).
Overall, Chrysalis provided more accurate estimates compared to competing methods in capturing and deciphering tissue compartments from synthetic ST data. Additionally, Chrysalis maintained robust performance across varying sequencing depths and contamination levels, as well as with different numbers of capture spots, outperforming the other tested methods.
Chrysalis enables accurate tissue compartment identification in the human lymph node
To demonstrate the capabilities of Chrysalis in real-world examples, we first examined a publicly available 10x Visium fresh frozen (FF) human lymph node sample. The lymph node exhibits intricate morphology by housing various populations of immune cells39, making it a challenging testing ground for spatial compartment detection. Chrysalis successfully distinguished tissue compartments that overlap with the primary morphological features in the histological image highlighted by the pathologist’s annotations (Fig. 3a and Supplementary Fig. 4a). Further using the annotated germinal centres, we benchmarked Chrysalis against competing methods. Here, Chrysalis achieved the highest differential in spatial domain score distributions inside and outside the annotated germinal centres (Fig. 3b and Supplementary Fig. 4b–d).
Fig. 3. Chrysalis identifies tissue compartments from ST data in the human lymph node.
a Human lymph node H&E image and the projection of the tissue compartments identified by Chrysalis (scale bar: 500 µm). b Jensen–Shannon distance between domain score distributions in the annotated germinal centre and the remainder of the sample across the applied methods (inset). c Boxplots of Pearson’s r values calculated between the 34 reference cell type abundances, inferred with cell2location, and the domain scores for the six methods applied to the lymph node dataset (centre line: median, box limits: upper and lower quartiles, whiskers: 1.5x interquartile range, diamonds: outliers, black dot: average value). d Chrysalis Compartments 0, 3, 4, and 6 and their respective cell type abundances with the highest correlation. e Heatmap showing Pearson correlation coefficients between the cell type deconvolution results of the 34 reference cell types and the tissue compartments (DC cDC1: dendritic cell conventional type 1, DC cDC2: dendritic cell conventional type 2, DC pDC: plasmacytoid dendritic cells, DC: dendritic cell, FDC: follicular dendritic cell, GC-DZ: germinal centre-dark zone, GC-LZ: germinal centre-light zone, ILC: innate lymphoid cell, NK: natural killer cell, preGC: pre-germinal centre, prePB: pre-plasmablast, TfH: follicular regulatory T cell, TfR: follicular regulatory T cell, VSCM: vascular smooth muscle cell). f 20 top contributing genes for Compartments 0, 3, 4, and 6. Bold characters were used to highlight the names of the genes referred to in the main text.
As an orthogonal validation, we evaluated the biological relevance of the tissue compartments identified by Chrysalis by investigating their correlation with the abundance of 34 reference cell types mapped onto the lymph node sample using the cell2location20 cell type deconvolution method (Fig. 3c–e and Supplementary Fig. 5). We assessed the performance of competing methods by calculating the average Pearson correlation coefficient between the deconvolution results and their corresponding outcomes. Chrysalis outperformed existing approaches, most notably the two main matrix decomposition-based techniques, NSF and MEFISTO (Fig. 3c). Specifically, B cell populations dominant in germinal centres, such as cycling, germinal centre-dark zone (GC-DZ), and germinal centre-light zone (GC-LZ) B cells, are associated with Compartment 3, with Pearson’s r values of 0.91, 0.84 and 0.77, respectively. Naive B cells residing in B cell follicles matched with Compartment 6 (0.84 Pearson’s r). The overall tissue vasculature correlated with Compartment 4 (0.72 Pearson’s r for endothelial cells), and various T cell populations (naive, CD4 + /CD8 + , regulatory, follicular regulatory T cell (TfR)) showed a strong association with Compartment 0 with an average Pearson’s r of 0.89 (Fig. 3e). As an alternative validation, we computed the correlation between the tissue compartments and the expression of marker genes of lymph node resident immune cells (Supplementary Fig. 5c). We found strong associations, confirming that these signatures can aid interpreting the detected tissue compartments. Moreover, by directly examining the weights assigned to individual genes for each tissue compartment, we identified numerous canonical markers of different immune cells, such as TRAC or CXCL13 (Fig. 3f and Supplementary Fig. 5f).
In summary, Chrysalis outperformed other methods in deciphering intricate lymph node tissue compartments, as validated by pathomorphologic annotations and cell type abundance predictions. Additionally, examining the weights of the most relevant genes per compartment demonstrated its potential for niche identification without requiring a reference dataset.
Dissecting tumour heterogeneity in human breast cancer
Next, we applied Chrysalis to a human breast cancer dataset containing serial sections of a formalin-fixed paraffin-embedded (FFPE) ER + / HER2+ tumour sample, analysed with 10x Visium and 10x Xenium40. Running Chrysalis on the Visium data revealed distinct tissue compartments exhibiting unique morphological and transcriptional features (Fig. 4a and Supplementary Fig. 6). Notably, these regions coincide with the pathologist’s annotations (Supplementary Fig. 7a) of the invasive tumour area and multiple phenotypes of ductal carcinoma in situ (DCIS). The high resolution of Xenium is suitable for subcellular transcript detection, and combined with imaging-based cellular segmentation, enables single-cell phenotyping. We co-registered and transformed the Xenium readouts with the Visium spots to generate a reference for validating the tissue compartments inferred by Chrysalis (Supplementary Fig. 7b–d). Using this reference, we again conducted the correlation-based benchmark to evaluate the performance of different methods on this dataset, with Chrysalis achieving the highest mean Pearson’s r value (0.41), followed by NSF (0.38), GraphST (0.35) and STAGATE (0.33), SpatialPCA (0.20), MEFISTO (0.17) (Fig. 4b).
Fig. 4. Chrysalis uncovers distinct tissue compartments across various tissue types and spatial technologies.
a Human breast cancer H&E image and the projection of the tissue compartments identified by Chrysalis (scale bar: 500 µm). b Boxplots of Pearson’s r values calculated between the reference cell type abundances from the Xenium measurement and the tissue compartment scores for the six methods applied to the human breast cancer dataset (centre line: median, box limits: upper and lower quartiles, whiskers: 1.5x interquartile range, diamonds: outliers, black dot: average value). c Correlation heatmap showing Pearson’s r between the cell type abundance data of 20 cell types derived from the subsequent tissue section measured with Xenium and the tissue compartments inferred by Chrysalis. d Individual Chrysalis Compartments 0, 2, 4, and 6 denoting DCIS #1, invasive tumour, myoepithelial, and DCIS #2 signatures, respectively. e Top 20 genes that contribute the most to Compartments 0, 2, 4, and 6 in the human breast cancer dataset. f Chrysalis compartments with integrated morphological features extracted with a deep autoencoder. Morphological features improved the separation between the adipose tissue (yellow), invasive tumour (red), and stroma (purple; right panels). g Tissue compartments within the mouse brain identified by Chrysalis. The white rectangle highlights the 5 cortical layer-associated tissue compartments. Cortical layer-associated tissue compartment scores in expert-annotated regions. h Chrysalis MIP plot of the two-sample mouse brain dataset and individual compartments corresponding to the fibre tracts (Compartment 0), internal granular layer of the cerebellum (Compartment 1), and ventral (Compartment 7) and dorsal (Compartment 3) cortex. i Chrysalis MIP of a human colorectal cancer sample captured with Visium HD and individual compartments showcasing distinct cellular niches: muscular layer (Compartment 7), fibroblastic stroma (Compartment 12), stromal immune infiltrates (Compartment 11), neoplastic epithelium (Compartment 4). j MIP of Chrysalis compartments in the mouse embryo (E12.5) captured with Stereo-seq and the compartments corresponding to the developing heart (Compartment 8) and brain (Compartment 9) alongside their corresponding top-weighted genes.
The correlation between the compartments and the reference cell type-specific abundance data also indicated that the immune microenvironment (Compartment 5), the invasive/proliferative tumour (Compartment 2), the two separate DCIS phenotypes (Compartment 0 and 6), and the myoepithelium (Compartment 4) were precisely identified by Chrysalis (Fig. 4c, d). Compartments 1, 3, and 7 did not show significant correlations with any of the cell types defined by the DNA probe set of Xenium, which lacks the capacity to differentiate distinct stromal cell types or adipocytes. However, by examining these compartments (Supplementary Fig. 6b), we observed that Compartment 1 contained genetic markers of cancer-associated fibroblasts, such as MMP2, COL1A1, and HTRA141. Compartment 3 included FABP4, GPX3, and PLIN1, which are highly expressed in adipocytes. The top genes in Compartment 7, IGHG1, SFRP4, and PLTP are associated with tumour-infiltrating plasma cells42,43. In addition, by selecting capture spots with high tissue compartment scores, we were able to calculate the cell type composition of each tissue compartment using the mapped Xenium cell abundance data. This approach demonstrated various cellular niches dominated by distinct tumour cell populations (Supplementary Fig. 6e). The results of Chrysalis were further validated by the top compartment-specific genes (Fig. 4e) and through the assessment of the weights of canonical tumour and myoepithelial markers (Supplementary Fig. 6f) that show high specificity for the DCIS and invasive tumour tissue compartments.
As histomorphology is usually well preserved in FFPE material, we further utilised this sample to illustrate the potential of incorporating morphological features into Chrysalis. To achieve this, we trained a deep autoencoder on the H&E image tiles corresponding to each capture spot and integrated the encoder output with the gene expression data, creating a multimodal representation. With this approach, the inferred tissue compartments align more closely to the overall tissue morphology and our pathologist’s annotations (Fig. 4f and Supplementary Fig. 8). Furthermore, we assessed the overlap between morphology-integrated tissue compartments and annotations, comparing it to the gene expression-based compartments. We observed an overall increase in Adjusted Rand Index (ARI) and substantial improvements in regions with distinctive morphology, such as the adipose tissue, where F1 scores rose from 0.60 to 0.87 (Supplementary Fig. 8c).
Our results demonstrated Chrysalis’s ability to accurately disentangle the different anatomical regions of a breast cancer sample, aligning with pathomorphologic annotations and cell types inferred from Xenium’s subcellular resolution technology. Additionally, we highlighted Chrysalis’s modularity and the potential to incorporate morphological features from H&E images into tissue compartment detection.
Mapping structural and functional areas in the mouse brain
Subsequently, we used Chrysalis to analyse 10x Visium datasets of FFPE coronal and FF parasagittal sections of mouse brain tissue. The brain exhibits a complex arrangement of layers in the neocortex, making it challenging to accurately recapitulate the exact anatomical structures. We initially tested Chrysalis on the FFPE sample by generating annotations for the cortical layers based on histological features (Supplementary Fig. 9a). We then identified the tissue compartments with the highest Pearson correlation values for each cortical layer annotation. Subsequently, we measured the tissue compartment scores for these compartments inside the annotated areas. Our analysis revealed that Chrysalis accurately identified the tissue compartments corresponding to L1, L2/3, L4, L5, and L6 of the parietal cortex (Fig. 4g and Supplementary Fig. 9b–d).
We compared Chrysalis’s performance to other methods by analysing the average score of latent factors (domain scores), finding that Chrysalis achieved greater specificity in identifying these cortical layers (Supplementary Fig. 9b). Further, we quantified these observed differences by measuring the Jensen–Shannon distance of domain score distributions between annotated and non-annotated regions. Chrysalis consistently achieved the best scores for each layer, with NSF closely following (Supplementary Fig. 9e).
Due to the impaired preservation of morphology in FF tissue sections, the tissue compartments on the sagittal section were directly assessed by a trained veterinary pathologist, using the olfactory bulb and the Allen Mouse Brain Atlas44 as references. Chrysalis precisely identified the six layers of the olfactory bulb, the accessory olfactory bulb, the layers of the somatomotor cortex, striatal structures, the hippocampus CA3 region as well as the thalamus, pallidum, and hypothalamus (Supplementary Fig. 10). Further examining the gene expression of each cortical compartment in the FF sample revealed cell-type markers and key contributors to each cortical layer, supported by the mouse brain transcriptional atlas45 (Supplementary Fig. 11). For instance, Compartment 4 was dominated by markers of meningeal cells (Ptgds, Hba, Mgp), as well as markers of dendrites (Bc1), which are prominent in Layer 1. Compartment 15 (L2/3) was defined by the expression of genes such as Calb1 and Nrgn. Compartment 8 (L4) was accurately represented by the marker gene Nrn1 amongst others. Compartment 1 (L5) included markers such as Nefm and Pvalb, the latter being a classical marker of pyramidal cells abundant in Layer 5. Tbr1, a marker for Layer 6 of the neocortex, was found in Compartment 11.
In addition, we used this FF sample to showcase the performance of Chrysalis on datasets containing multiple tissue samples by combining it with the posterior part of the tissue section profiled in an independent experiment. On this integrated tissue sample, Chrysalis readily identified the main anatomical regions of the brain, including the Ammon’s horn and the dentate gyrus (Fig. 4h and Supplementary Fig. 12). By further investigating the individual tissue compartments, we observed continuous compartments that extend across both tissue sections. As an example, Compartment 0 corresponds to the fibre tracts with top genes such as Plp1, Mbp, and Mobp suggesting the presence of oligodendrocytes. In contrast, Compartment 1 can be exclusively found in the posterior brain sample, highlighting the internal granular layer of the cerebellum as indicated by the cerebellin genes. Compartments 7 and 3 are in accordance with the dorsal and ventral cerebral cortex, respectively (Supplementary Fig. 12d).
Our comprehensive analysis using Chrysalis on FFPE and FF mouse brain tissue sections demonstrated its high accuracy in identifying and annotating complex cortical layers and anatomical regions as supported by histological features and gene expression markers. Additionally, we highlighted the potential of Chrysalis to effectively detect tissue compartments on integrated datasets encompassing several ST samples.
Uncovering tissue compartments across various spatial transcriptomics technologies
To demonstrate Chrysalis’s capability to extract tissue compartments across various ST technologies, we applied it to datasets generated by Visium HD, Stereo-seq46 and Slide-seqV2 platforms.
We first examined a human colorectal cancer sample acquired using Visium HD. The tissue compartments inferred by Chrysalis accurately recapitulated the main compartments of the tissue, such as the muscular layers, connective tissue, and the epithelium (Fig. 4i). Additionally, Chrysalis characterised multiple colorectal cancer niches, identifying a signature indicative of active proliferation, exemplified by histone genes in Compartment 4 (Supplementary Fig. 13), and an invasive phenotype in Compartment 2, characterised by the expression of canonical marker genes (EPCAM, CEACAM5) along with genes promoting invasion (ST1447). Moreover, we identified several cancer-infiltrating immune cell-associated tissue compartments (Compartments 5, 11, and 13), which were characterised by the expression of various immunoglobulin genes, as well as JCHAIN, CD74, and LYZ.
In a mouse hippocampus dataset generated with Slide-seqV2, Chrysalis distinguished the pyramidal layer of the Ammon’s horn (Compartment 1) and delineated the molecular layer of the dentate gyrus (Compartment 10) from the surrounding brain tissue (Supplementary Fig. 14).
Moreover, Chrysalis pinpointed tissue compartments in mouse embryo cross-sections (E9.5 and E12.5) measured with Stereo-seq, corresponding to the developing organs, such as the heart (Compartment 8), liver (Compartment 21) or brain (Compartment 9), corroborating the expert annotations from the original study (Fig. 4j and Supplementary Fig. 15).
Discussion
To fully uncover and understand tissue heterogeneity in ST, models generating accurate cellular niche representations are needed. Even though different approaches, such as clustering, deconvolution or matrix decomposition methods have been developed, Chrysalis provides a robust alternative to explore tissue heterogeneity in an interpretable way, without the need for external reference data. By using archetypal analysis, we impose constraints that facilitate the identification of cellular niches, which are often represented by unique transcriptional states32,48, and can be captured by a simplex that is fit to the low-dimensional feature space. This leads to an accurate and interpretable approach to describe cellular niches in the tissue, as both our findings and previous studies indicate that the estimated archetypes correspond to the most informative extremes of gene expression embeddings29,49. This constraint may also present limitations when signatures of low-quality capture spots coincide with the extremal points in the latent space after sub-optimal sample preparation. Precise quality control during preprocessing or the examination and exclusion of the impacted tissue compartment-associated signatures during downstream analysis can successfully minimise these effects.
In our study, we demonstrated that Chrysalis enables an accurate identification of tissue domains across different ST datasets. We performed extensive benchmarking and validation on in silico ST datasets, where Chrysalis accurately recapitulated the underlying tissue zones, even when obscured by biological and technical noise introduced by the cell type assignment and technical variation modelling. In this particular task, Chrysalis achieved markedly increased performance compared to competing methods. Additionally, we demonstrated the advantage of Chrysalis over other methods by measuring its robustness on tissue zones concealed by increasing amounts of technical variations.
Chrysalis further showed increased performance in spatial domain detection on real-world examples covering different tissue types. In the human lymph node, Chrysalis reached the highest correlation with the inferred cell type abundances used as a reference. Furthermore, Chrysalis performed with the highest accuracy in predicting the germinal centres annotated by expert pathologists. In the human breast, Chrysalis enabled an accurate mapping of DCIS and invasive tumour tissue compartments and provided the highest accuracy when evaluated on single cell abundance data derived from a Xenium experiment conducted on the adjacent tissue section.
Chrysalis enables the integration of morphological features derived from ST-associated histological images, enhancing the detection of tissue compartments by combining multiple data modalities. For instance, in the breast cancer dataset, integrating morphological information improved our ability to identify the adipose tissue compartment. Sequencing-based ST platforms often experience lateral diffusion, where transcripts are captured by adjacent spots50. This issue is exacerbated in fatty tissues, where standard deparaffinization removes cytoplasmic lipid droplets51, leaving behind artificial empty vacuoles that allow transcripts to diffuse more rapidly. By incorporating morphological features into the estimation of tissue compartments, Chrysalis offers a more accurate mapping of different tissue types compared to relying on transcriptomics alone.
We demonstrated that Chrysalis can be effectively utilised on integrated datasets containing multiple ST samples and on a wide range of different ST platforms. This includes datasets derived from cutting-edge technologies, such as the Visium HD7, that contain a larger number of capture spots showcasing the scalability of our method. Recent advances in deep learning have made it possible to infer high-resolution gene expression profiles from standard ST platforms by leveraging histological image features52,53. Chrysalis can be effectively applied to these workflows, enabling the study of tissue compartments at higher resolutions, as showcased in our example on super-resolved ST data inferred with iStar54 (Supplementary Fig. 16). Furthermore, Chrysalis is implemented as a lightweight software package with seamless integration to the SCANPY55-based ecosystem, enabling downstream applications, and interoperability between existing and future ST technologies.
In summary, we presented Chrysalis, an innovative method that employs SVG identification and archetypal analysis for rapid tissue compartment identification and visualisation in ST with state-of-the-art performance. Additionally, Chrysalis is compatible with any sequencing-based ST technology and can be augmented by integrating morphological features. We anticipate that Chrysalis will emerge as a valuable extension of ST data analysis workflows, enhancing our understanding of the spatial structure and functional characteristics of tissues, thus propelling the field of ST further into the realm of high-resolution biological discovery.
Methods
Chrysalis overview
Data preprocessing
We have designed Chrysalis to seamlessly integrate into workflows based on SCANPY55 or Squidpy56 Python packages. As such, SCANPY functions are utilised for quality control (QC) and preprocessing for all datasets. Given that Chrysalis assumes that unique tissue compartments are represented by extreme points, stringent QC and outlier removal are important for finding high-quality tissue compartments. During our analyses, SCANPY functions were used to perform QC by first filtering spots based on the unique molecular identifier (UMI) count numbers (pp.filter_cells). The exact cutoff value can be determined individually for samples based on the UMI count distribution and other technical attributes. Genes expressed in less than 10 capture spots (pp.filter_genes) were subsequently discarded. Following that, the gene expression matrix was normalised (pp.normalize_total) and log1p-transformed (pp.log1p) using SCANPY preprocessing functions before subjecting it to further analysis.
Detection of SVGs
PySAL’s57 implementation of the global Moran’s Index (Moran’s I) is used (Supplementary Fig. 17a) to detect SVGs in the gene expression matrix. First, we standardise the preprocessed (normalised and log1p-transformed) expression matrix so that for each capture spot , the standardised gene expression can be described as:
where represents the expression level of a specific gene at the -th capture spot, while is the mean expression level across all spots and is the standard deviation of expression levels across all spots. Moran’s I58 can then be formulated as follows:
where and are the standardised gene expression levels at spots and , respectively. is the total number of spots and is the spatial weight between spot and spot . Spatial weight is defined as 1 if spot is within the set number of k-nearest neighbours (KNN) of spot , and 0 otherwise. To evaluate the potential influence of neighbourhood size, we computed Moran’s I statistic with 6, 18, and 36 neighbours (Supplementary Fig. 17b) on the 10x Visium human lymph node sample (for details on preprocessing, see Methods, Human lymph node analysis section). As our results show consistent Moran’s I values regardless of neighbourhood size, Chrysalis uses 6 nearest neighbours by default for computational efficiency, reflecting the hexagonal grid pattern in which Visium capture spots are organised. For analysing Cartesian grid-based technologies (e.g., Stereo-seq, Visium HD) and the in silico data, we used a neighbourhood size of 8. The Slide-seqV2 dataset was analysed with the same neighbourhood size of 8 due to the binning we performed during preprocessing (see Methods, Slide-seqV2 mouse hippocampus analysis section).
Moreover, we also explored alternative spatial autocorrelation statistics to Moran’s I, namely, Geary’s C59. It has been previously reported60 that combining the two metrics can yield better performance, as Geary’s C is more sensitive to local changes. Nevertheless, these two metrics were indistinguishable in our tests using the preprocessed 10x Visium human lymph node dataset (for details on preprocessing, see Methods, Human lymph node analysis section), and therefore we continued with Moran’s I (Supplementary Fig. 17c). To decrease computational runtimes, Chrysalis calculates Moran’s I only for genes that are expressed in at least 5% of the capture spots. This approach does not compromise the identification of spatially variable genes, as demonstrated by the 2D histogram showing that genes exhibiting high Moran’s I values tend to be expressed across wider regions of the tissue (Supplementary Fig. 17d).
To determine the number of SVGs, a rank-order plot is generated by arranging the Moran’s I values for every gene in descending order. This results in a curve characteristic of a power-law distribution (Supplementary Fig. 17e). The inflexion point of this curve, marking the transition from a high-autocorrelation interval to a flatter low-autocorrelation interval, serves as a cutoff point for classifying SVGs. Genes below this inflexion point are omitted, preserving most of the spatial variability in the data while reducing noise. Our findings indicate that in the majority of cases, the inflexion point occurs approximately at the 1000th gene. Consequently, Chrysalis classifies the top 1000 genes as SVGs by default, which are then used for further analysis.
For SVG detection, Chrysalis can also incorporate alternative methods61–64, which may provide marginal improvements in performance at the cost of increased computational runtimes (Supplementary Fig. 18). To compare the performance of these SVG detection methods to Moran’s I, the 10x Visium human lymph node dataset was preprocessed using SCANPY. SVG detection methods SpatialDE261, SEPAL62, BSP63, and SPARK (SPARK-X)64 were run according to the published guidelines (Supplementary Table S1). Chrysalis was then applied using the top 1000 SVGs assigned by each method (for details on preprocessing, Chrysalis pipeline, and correlation-based validation, see Methods, Human lymph node analysis section). Pearson correlation coefficient was then calculated between the tissue compartments and the cell type deconvolution results.
Low-dimensional embedding
PCA is performed (Scikit-learn65 Python package implementation) on the SVG matrix to identify the main spatial expression patterns. To determine the optimal number of PCs, we conducted multiple tests with varying configurations using the human lymph node dataset (PCs: [6, 10, 20, 40], compartments: 3–24). We calculated a correlation matrix between the cell type deconvolution results and the compartments identified by Chrysalis (see the details in Methods, Human lymph node analysis section) and assessed the average Pearson’s r value of the highest correlating cell type-tissue compartment pairs to evaluate the compartments’ ability to depict the true tissue microenvironments (Supplementary Fig. 19a). Based on this analysis we set the default to 20 PCs, as it sufficiently captured information attributed to the underlying tissue microenvironments.
Morphological feature integration
Chrysalis can incorporate latent feature vectors obtained through deep learning models from H&E images associated with ST measurements. This allows the identification of tissue compartments with unique transcriptional and morphological properties. The generic workflow includes:
Extracting morphological features for each capture spot.
Performing dimensionality reduction on the feature vectors.
Concatenating the morphology-based and gene expression-based components.
Scaling the concatenated components to prevent any issues arising from disparate scales across modalities.
The integrated feature matrix can be subsequently used in Chrysalis to find tissue compartments with archetypal analysis (for details regarding the integration performed for the human breast cancer data, see Methods, Human breast cancer analysis, Morphological feature extraction and integration section).
Tissue compartment inference
To detect tissue compartments, Chrysalis uses archetypal analysis on the low-dimensional embedding of SVGs. The goal of archetypal analysis is to identify extremal points in multidimensional data, known as archetypes (e.g., tissue compartments), such that any capture spot in the dataset can be represented as a convex combination of these archetypes. This can be interpreted as fitting a multidimensional simplex to the data space with the archetypes representing the vertices of this simplex (Fig. 1b and Supplementary Fig. 5d). Therefore, any observation in the data (i.e.,: each capture spot) can be represented as a mixture of archetypes with a measurable contribution of each archetype to the sample, allowing a comprehensive understanding of the tissue structure.
More formally, let be a data matrix of size , where is the number of observations (capture spots) and is the dimension of low-dimensional SVG representation (selected number of principal components).
Archetypal analysis aims to find a set of archetypes such that the input data matrix can be approximated as , where denotes the coefficient matrix and denotes archetypes. This approximation is subject to the following constraints:
Where denotes the contribution of -th archetype to the -th observation.
The process of obtaining matrices and involves minimising the reconstruction error, measured as the Frobenius norm across all data points formulated as follows:
Moreover, each observation is approximated as:
Upon optimisation, the low-dimensional SVG representation is decomposed into archetypes. To obtain archetypical decompositions of SVGs, the PCA loadings can be used as described below. Let represent the loadings obtained through PCA decomposition of SVGs. The expression of the individual genes for archetype represented by can be calculated as follows:
where is the preprocessed mean (normalised and log1p-transformed, for details, see Methods, Chrysalis overview, Data preprocessing section) gene expression vector, and represents the weights of each gene in the -th archetype.
Chrysalis leverages the archetypes Python package implementation of archetypal analysis (n_init = 3, max_iter = 200, tol = 0.001, random_state = 42).
Visualisation
To jointly visualise the tissue compartments, MIP is used. Initially, each archetype (tissue compartment) is assigned to a unique colour in the RGB space, with each colour channel containing values in the range [0, 255]. Following that, linear interpolation is used to assign colours to each capture spot for every tissue compartment . Consequently, the assigned colour values transition between (0, 0, 0), which is assigned to the lowest value in compartment , and . Given tissue compartments, the visualisation colour for a spot is determined using MIP as follows:
where , , and represent the red, green, and blue values for compartment at spot .
In silico ST data
Synthetic ST data generation
To benchmark Chrysalis, we adapted a synthetic ST data generator from prior works20,37. The data generation process follows two main steps:
Cell type abundance simulation along spatial patterns
To simulate cell type abundance, Gaussian process was first used to generate spatial patterns for a 2-dimensional array with Cartesian coordinates corresponding to an arbitrary number of tissue zones in the sample. By tuning parameter eta, the sparsity of the tissue zones was controlled, resulting in sparse (eta = 1.5) and uniform (eta = 1.0) tissue zones. To introduce variability in the spatial coherence of tissue zones, we employed a range of length scale parameter values [4, 10]. Higher length scale values are associated with strongly correlated, spatially coherent variations across the tissue zones, while lower values produce more localised variations, with rapid changes and strong correlations only between nearby points. Detailed parameter values are provided in Supplementary Table S2. A softmax function and min-max normalisation were subsequently applied to the sparse and uniform tissue zones to adjust their scale to [0, 1].
Cell type abundance assignment and expression profile generation relied on annotated input scRNA-seq data. For our benchmarks, we used the Tabula Sapiens38 immune cell atlas. The cell atlas was first subsampled (pp.subsample from SCANPY) to 26 000 cells, on which quality control was performed. We excluded cells with over 20% mitochondrial gene counts and those expressing more than 2500 unique genes. Additionally, cell types represented by fewer than 100 cells and genes expressed in fewer than 10 cells were discarded. After these filtering steps, the resulting cell atlas comprised 17 000 cells spanning 26 unique cell types.
Next, we performed binary assignment of sparse and uniform cell types to tissue zones and patterns. Cell types present in the scRNA-seq input data were randomly assigned to the sparse tissue zones using a binomial distribution function (p = [0.02, 0.04]). For the uniform tissue zones, one cell type per zone was randomly selected.
Following that, we assigned cell types to high or low abundance groups, generating average abundance values for each cell type. This was performed by drawing the abundance values from gamma distributions with different shape parameters for the two abundance groups (shapehigh = 5, shapelow = 3).
We then multiplied the average cell type abundances with the corresponding tissue zones to compute abundance at each location. A noise factor was subsequently added using a log-normal distribution (mean = 0, σ = 0.35) to mimic real tissue variability.
Generation of multi-cell mRNA expression profiles with confounding technical variation
To build the count matrix, we randomly selected cells based on the previously assigned abundance matrix for each location. After that, mRNA abundance across all cell types was aggregated to produce multi-cell mRNA profiles. To introduce technical variation, we first multiplied the counts with a detection rate parameter drawn from a gamma distribution (shape = 5, scale = 1/15). This was followed by calculating a contamination vector introducing counts to each gene by multiplying the average gene counts with contamination fractions drawn from a gamma distribution (shape = 0.03*100, scale = 1/100)). This vector was then applied for genes at every location resulting in a per-location average contamination matrix.
Sequencing depth effects were also modelled by a per location sequencing depth effect (shape = 1*25, scale = 1/25) and a per experiment depth effect (shape = 1*5, scale = 1/5) sampled from two gamma distributions. The count matrix was multiplied with the two sequencing depth effects, and the final counts were then sampled from a Poisson distribution. This was further multiplied by the final contamination counts sampled from a Poisson distribution using the previously calculated per-location average contamination.
To benchmark performance across technical variation, we introduced an alternative approach that keeps the total count number stable irrespective of the fraction of contaminating random counts. Instead of depending on average contamination and sequencing depth values sampled from gamma distributions, we modelled the contamination directly as a fraction of the average count of every gene (), with the range of [0.03, 0.09, 0.27, 0.81] across the generated sample set. We further modified the original approach by shuffling the per-location average contamination matrix across genes and spatial locations, replacing the uniform contamination that models only gene-specific variability. Sample-wise sequencing depth effect was also directly specified as a range of fractional values multiplying the synthetic count matrix [1, 0.2, 0.04, 0.008, 0.0016, 0.00032]. The final contamination counts were added to the count matrix after multiplying the original counts by . For the full range of parameters used in the synthetic data generation process, see Supplementary Table S2.
As the random seed and the tissue zone number parameters are fixed in the technical variation benchmark, the resulting samples share identical spatial patterns and cell type abundance matrices. The difference therefore is only reflected by the increasing amount of technical noise introduced.
To measure the effect of different spatial array sizes, 3 samples were selected from the main dataset and truncated to different spatial dimensions (5050, 2550, 2525) by systematically reducing the spatial arrays’ dimensions by half in each step (Supplementary Fig. 3).
Benchmarking
Calculating low-dimensional embeddings of the benchmarked methods
Before running Chrysalis, we normalised (pp.normalize_total) and log1p-transformed (pp.log1p) the gene expression matrix using SCANPY. We then employed Chrysalis to identify SVGs using Moran’s I with 8 nearest neighbours and selected the top 1000 genes amongst genes expressed in more than 5% of the capture spots. Finally, Chrysalis was used to define tissue compartments using archetypal analysis (number of PCs = 20, number of compartments = number of sparse tissue zones).
To run NSF14 and MEFISTO15, the gene expression matrix was decomposed to a number of factors equal to the number of sparse tissue zones using their respective software implementation pipelines (Supplementary Table S1) after preprocessing the data with SCANPY following the same criteria as for Chrysalis.
For STAGATE27, and GraphST28, the low-dimensional embeddings were extracted after running their respective inference pipelines according to the published guidelines (Supplementary Table S1). This resulted in low-dimensional embeddings with 30 latent features for STAGATE. As GraphST outputs a reconstructed gene expression matrix, we applied a PCA and used an equal number of PCs as sparse tissue zones generated for each synthetic sample. We note that due to excessive computational time, we omitted SpatialPCA from the in silico benchmarks and only evaluated its performance on real-world examples.
Calculating performance metrics
To compare the performance of the tested methods, we first calculated the pairwise Pearson correlation between the sparse tissue zones and the inferred factors or latent features. For each tissue zone, the highest Pearson’s r value was selected. These values were then averaged, representing the overall performance of the models on a single sample.
Human lymph node analysis
We obtained the 10x Visium human lymph node dataset from the 10x Genomics online data repository and preprocessed it using the SCANPY package as described below. First, capture spots containing less than 6000 UMI counts were removed (pp.filter_cells) to filter out low-quality spots. Genes expressed in less than 10 spots were discarded (pp.filter_genes). Next, we normalised (pp.normalize_total) and log1p-transformed (pp.log1p) the gene expression matrix. We then employed Chrysalis to identify SVGs using Moran’s I, selecting genes with at least 0.08 Moran’s I value amongst genes expressed in more than 5% of the capture spots. 997 SVGs above the previously defined Moran’s I threshold were used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Finally, Chrysalis was used to define tissue compartments using archetypal analysis (number of PCs = 20, number of compartments = 8). The included histology image was used to annotate tissue regions.
Validation with cell type deconvolution results and specific marker genes
Correlation with reference data
Cell type deconvolution results were generated with cell2location20 by running the Google Colaboratory notebook provided in the documentation (Supplementary Table S1), using scRNA-seq reference data from the original publication. This single-cell reference was originally obtained by integrating datasets from human secondary lymphoid organs comprising more than 70 000 cells. Correlation coefficients were calculated using the Pearson method to analyse the relationships between the 8 tissue compartments identified with Chrysalis and the inferred abundances of 34 cell types. Subsequently, these coefficients were used to construct a correlation matrix for validating the tissue compartments.
Correlation with marker gene signatures
We explored canonical marker gene signatures of 16 cell types found in the lymph node derived from the CZ CELLxGENE Discover online resource. Using SCANPY’s tl.score_genes function, scores for each of the 16 downloaded gene sets were determined by calculating the difference between their average expression and the average expression of a reference gene set, which was randomly sampled from the total gene pool corresponding to discretised expression levels. Pearson correlation coefficients were calculated, and a correlation matrix was constructed to denote the association between the signature scores and the compartments.
Benchmarking
Calculating low-dimensional embeddings of the benchmarked methods
To run the inference pipelines we used the same procedures described in the In silico ST data, Benchmarking, Calculating low-dimensional embeddings of the benchmarked methods section, with the exception of setting the number of extracted factors (NSF, MEFISTO) to 8 factors. STAGATE and SpatialPCA outputs a low-dimensional embedding with 30 and 20 dimensions, respectively. Therefore we tested those without further processing. For GraphST, we performed PCA on the transformed count matrix and selected the first 20 PCs corresponding to the inflexion point in the cumulative explained variance curve.
Assessment of alternative methods in characterising germinal centres
To benchmark the effectiveness of the low-dimensional representations in characterising the annotated germinal centres, we selected spatial domains (i.e., individual factors from NSF and MEFISTO, embedding vectors from STAGATE, and SpatialPCA, and PCs for GraphST) best describing the annotated germinal centres as described below. First, the low-dimensional representations were min-max normalised to be within the range of [0, 1]. Subsequently, using the germinal centre annotations from the cell2location article20, we calculated the area under the receiver operating characteristic curve (ROC AUC) scores to identify the embedding vectors most representative of the germinal centres. (Supplementary Fig. 4b, c). Following that, the mean Jensen–Shannon distance was calculated between the embedding vector (i.e., domain score) distributions (Supplementary Fig. 4d) for spots labelled as germinal centres and the rest of the sample from 1000 random permutations.
Benchmarking alternative methods with cell type deconvolution results
For the correlation-based benchmark, the unscaled low-dimensional representations were used. Correlation matrices were first built by calculating Pearson correlation coefficients between the 34 cell type abundances from the cell2location reference data and the embeddings. For each cell type, the highest Pearson’s r value was selected, corresponding to the highest correlating embedding vector, and the averages of these values were calculated.
Computational running time
The computational running time of these methods was gauged by measuring execution time starting by reading the dataset up to the point where the low-dimensional representations were calculated (Supplementary Fig. 19b). This measurement was done on a Windows machine using Ubuntu 20.04 LTS via Windows Subsystem for Linux without GPU acceleration (CPU: AMD Ryzen 9 5900HS, RAM: 32 GB, GPU: NVIDIA GeForce RTX 3060 Laptop GPU).
Human breast cancer analysis
The combined 10x Xenium and Visium human breast cancer dataset was downloaded from the 10x Genomics online resource with the corresponding high-resolution H&E. The Xenium dataset contains 167 780 segmented cells with the gene expression data of 313 genes. Cell type annotations of 20 cell types were directly provided by 10x Genomics (Supplementary Fig. 7b).
Co-registration of Visium and Xenium data
To map individual cells from the Xenium section to the Visium data, we first co-registered the two corresponding H&E tissue images. We utilised the image alignment functionality of 10x Genomics’ Loupe Browser, which offers manual landmark-based image alignment. We placed 30 landmarks to create the initial alignment, followed by an algorithmic refinement step relying on the mutual information measured between the two images. Two image registration steps were carried out: one between the post-Xenium H&E and the image captured by the CytAssist machine, and another one between the pre-Visium H&E and the CytAssist image, as the image alignment functionality in Loupe Browser is limited to CytAssist generated image data. Afterwards, affine transformation matrices were exported and used to translate the XY positions of individual cells in the Xenium dataset to the Visium coordinate system (Supplementary Fig. 7c). Cells with centroids outside of the Visium capture spots were omitted and the remaining ones were aggregated for each cell type and assigned to the capture spots (Supplementary Fig. 7d). As there is no one-to-one mapping between the two modalities, spots outside of the Xenium ROI were also removed, retaining 3906 of the original 4992 capture spots.
Mapping pathologist annotations to the Visium dataset
The high-resolution post-Xenium H&E image was assessed and annotated by a trained veterinary pathologist using QuPath66 software. Transformation matrices described in the above paragraph were used to translate the annotation polygons and the spatial coordinate pairs of the Visium dataset to a unified coordinate system. Visium capture spots were subsequently labelled according to their overlap with the annotation polygons (Supplementary Fig. 7a).
Validation with Xenium data
Correlation with reference data
Visium data was preprocessed by normalising (pp.normalize_total) and log1p-transforming (pp.log1p) the gene expression matrix using SCANPY. Once the ground truth data measured with Xenium were added, we discarded low-quality spots containing less than 1000 UMI counts (pp.filter_cells) and genes expressed in fewer than 10 spots (pp.filter_genes) using SCANPY. SVGs were first determined using Chrysalis with the following parameters: minimum Moran’s I = 0.05, genes expressed in > 5% of the total number of capture spots. The detected SVGs were used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Chrysalis was subsequently used to define tissue compartments using archetypal analysis (number of PCs = 20, number of compartments = 8). To examine the relationship between the Xenium reference data and the compartments identified by Chrysalis, a correlation matrix was constructed by calculating Pearson correlation coefficients between these elements.
Marker gene contributions
SVG weights for each tissue compartment were calculated using Chrysalis to assess the importance of breast cancer and myoepithelial marker genes acquired from the original study40.
Assessing cell type composition of tissue compartments
To determine the cell type composition within each tissue compartment, we selected capture spots with domain scores above 0.8. We then aggregated the abundance data of the 20 mapped reference cell types and calculated their respective proportions per compartment.
Benchmarking
To benchmark methods based on their correlation with the Xenium reference data, we used the same procedures described in the In silico ST data, Benchmarking, Calculating low-dimensional embeddings of the benchmarked methods section, with the exception of setting the number of extracted factors (NSF, MEFISTO) to 8 factors. STAGATE and SpatialPCA outputs a low-dimensional embedding with 30 and 20 dimensions, respectively. Therefore we tested those without further processing. For GraphST we performed PCA on the transformed count matrix and selected the first 20 PCs.
Morphological feature extraction and integration
To incorporate morphological information, the spatial positions of capture spots from the Visium sample were first mapped to the 40X magnification post-Xenium H&E slide scan. Transformation matrices were used to translate the spatial positions between the two tissue sections (for details, see Methods, Human breast cancer analysis, Co-registration of Visium and Xenium data section). 3906 image tiles (299 × 299 px) were then extracted (Supplementary Fig. 8a) by marking squares with centroids equal to those of the capture spots and side lengths equal to the capture spot diameters (55 µm). The image tiles were resized to 256 × 256 px, and the pixel values were standardised to be within the range of −1 to 1. The transformed images were used to train a deep autoencoder. The encoder was built using three 2D convolutional layers (kernel size: 3) and a dense layer, all coupled with GELU activation functions. The encoder output (i.e., bottleneck) is a 1-dimensional vector of 512. The decoder contains one dense layer and three 2D transposed convolution layers (kernel size: 3). The first three layers utilised GELU activation functions, while a Tanh activation function was employed for the last layer, resulting in an output size equivalent to that of the input image (pre-trained model is available at Zenodo). The architecture was built and trained using PyTorch67 and PyTorch-Lightning for 100 epochs with a batch size of 1 and learning rate decay using the Adam optimiser. After training, the latent vector for each encoded image tile was collected, resulting in a 2D matrix of 3906 × 512. Next, a PCA was performed on this matrix and the PCs were min-max scaled using scikit-learn’s MinMaxScaler function. Simultaneously, the same operation was applied to the PCs of the SVG expression matrix. The scaled morphology PCs (10) were then concatenated with the SVG expression PCs (20), and the resulting matrix of 30 PCs was subsequently processed with Chrysalis to find tissue compartments (number of PCs = 30, number of compartments = 8).
To demonstrate the benefits of the multimodal approach, we assessed the performance of Chrysalis relying on our pathologist’s annotations (see Methods, Human breast cancer analysis, Mapping pathologist annotations to the Visium dataset). We assigned every spot to the tissue compartment with the highest domain score (Supplementary Fig. 8b). ARI was computed between those compartments and the annotation labels. F1 score was then calculated for every combination of annotations and tissue compartments computed by the gene expression-based and morphology-integrated approaches (Supplementary Fig. 8c). Precision-recall curves for selected annotations were calculated using the respective tissue compartments with the highest F1 score (Supplementary Fig. 8d).
Mouse brain analysis
FFPE coronal section processing and benchmarking
The brain section was acquired from the 10x Genomics online repository. Manual annotations were generated by a trained veterinary pathologist using QuPath66 software by assessing the high-resolution H&E image. Visium capture spots were subsequently labelled (Supplementary Fig. 9a) according to their overlap with the annotation polygons.
Capture spots containing less than 3000 UMI counts were omitted (pp.filter_cells), and genes expressed in 10 or fewer capture spots were also removed (pp.filter_genes) using SCANPY. This was followed by a normalisation (pp.normalize_total) and log1p-transformation (pp.log1p) step.
Chrysalis was used to determine SVGs on genes expressed in > 5% of the total number of capture spots. The top 1000 detected SVGs were used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis, followed by tissue compartment identification (number of PCs = 20, number of compartments = 28).
To run the inference pipelines we used the same procedures described in the In silico ST data, Benchmarking, Calculating low-dimensional embeddings of the benchmarked methods section, with the exception of setting the number of extracted factors (NSF, MEFISTO) to 8 factors. STAGATE and SpatialPCA outputs a low-dimensional embedding with 30 and 20 dimensions, respectively. Therefore we tested those without further processing. For GraphST we performed PCA on the transformed count matrix and selected the first 20 PCs. The output vectors were subsequently scaled to [0, 1].
Following that, the mean Jensen–Shannon distance was calculated between the embedding vector distributions (Supplementary Fig. 9e) for spots labelled with one of the six cortical layers (L1, L2/3, L4, L5, L6) and the rest of the sample from 1000 random permutations.
FF parasagittal section
To process the FF anterior half of the mouse parasagittal brain section, the data was first downloaded from the 10x Genomics online data repository. Manual annotations were acquired from another publication28. Capture spots containing less than 1000 UMI counts were omitted (pp.filter_cells), and genes expressed in 10 or fewer capture spots were also removed (pp.filter_genes) using SCANPY. This was followed by a normalisation (pp.normalize_total) and log1p-transformation (pp.log1p) step.
Chrysalis was used to determine SVGs with the following parameters: minimum Moran’s I = 0.05, genes expressed in > 5% of the total number of capture spots. The detected SVGs were used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Chrysalis was used to define tissue compartments (number of PCs = 20, number of compartments = [8, 12, 16, 20, 24, 28]) and to visualise them (Supplementary Fig. 11b). Based on the results of 28 tissue compartments, the neocortex layers (Compartments 4, 15, 8, 1, and 11) were manually identified. The visual representation of the tissue compartments was examined and directly annotated based on the Allen Mouse Brain Atlas44. Additionally, we performed uniform manifold approximation and projection (UMAP) on the dataset using SCANPY. Chrysalis’s MIP method was used to shade the capture spots to verify the proximity of cortical tissue compartments in the UMAP space (Supplementary Fig. 11c).
Sample integration
The posterior part of the parasagittal mouse brain dataset was downloaded from the 10x Genomics online data repository and preprocessed identically to the anterior sample described above. Data integration was performed with Scanorama68 after the initial normalisation (pp.normalize_total) and log1p-transformation (pp.log1p) of the count matrix for each sample. Following that, Chrysalis was used to calculate SVGs for both samples separately (minimum Moran’s I = 0.20, genes expressed > 10% of the capture spots), and the SVG gene sets were concatenated. This resulted in 1325 SVGs with 675 genes overlapping between the two samples (Supplementary Fig. 12c). The resulting SVG count matrix was used for dimensionality reduction and spatial domain detection by Chrysalis to identify tissue compartments (number of PCs = 20, number of compartments = 10).
Visium HD colorectal cancer analysis
Visium HD data of human colorectal cancer was downloaded from the 10x Genomics data repository. The gene expression matrix corresponding to the 16 × 16 μm rectangle bins was read with SCANPY. Normalisation (pp.normalize_total) and log1p-transformation (pp.log1p) were subsequently performed after filtering out capture spots containing less than 1000 UMI counts (pp.filter_cells) and genes expressed in 10 or fewer capture spots (pp.filter_genes). Chrysalis was used to find the top 1000 SVGs (minimum Moran’s I = 0.05, genes expressed >5% of the bins, number of neighbours for Moran’s I calculation = 8). SVGs were afterwards used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Then, Chrysalis was used to define tissue compartments using archetypal analysis (number of PCs = 20, number of compartments = 28).
Slide-seqV2 mouse hippocampus analysis
Slide-seqV2 data of mouse hippocampus was downloaded using the link provided by the original study6. The count matrix and the corresponding spatial coordinates were read, and the appropriate AnnData data structure was manually constructed with SCANPY. Spatial locations beyond a circle with a radius of 2440 px from the mean XY spatial coordinate pair were removed to discard spots outside of the original ROI. The data was binned into square-shaped bins with a size of 24.4 px to create an evenly spaced array from the randomly dispersed capture beads. Bins containing less than two beads were omitted from further analysis. This was followed by removing capture spots containing less than 100 UMI counts (pp.filter_cells) and genes expressed in 10 or fewer bins (pp.filter_genes) using SCANPY. The count matrix was then normalised (pp.normalize_total) and log1p-transformed (pp.log1p). Chrysalis was used to find SVGs (minimum Moran’s I = 0.05, genes expressed > 5% of the bins, number of neighbours for Moran’s I calculation = 8). SVGs were used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Subsequently, Chrysalis was used to define tissue compartments (number of PCs = 20, number of compartments = 11).
Stereo-seq mouse embryo analysis
Stereo-seq data of mouse embryo cross sections (E9.5, E12.5 - bin 50) were downloaded from the MOSTA: Mouse Organogenesis Spatiotemporal Transcriptomic Atlas data repository. The gene expression matrix in these datasets is tiled up to 25 × 25 μm rectangle bins. HDF files were read with SCANPY, and bins labelled as cavities were removed using the provided annotations. Normalisation (pp.normalize_total) and log1p-transformation (pp.log1p) were subsequently performed. Chrysalis was used to find SVGs (minimum Moran’s I = 0.05, genes expressed > 5% of the bins, number of neighbours for Moran’s I calculation = 8). SVGs were afterwards used to construct a low-dimensional representation using the dimensionality reduction step of Chrysalis. Then, Chrysalis was used to define tissue compartments using archetypal analysis (number of PCs = 20, number of compartments = 24).
Super-resolution tissue compartments with iStar
To demonstrate the compatibility of Chrysalis with super-resolution methods, we used the previously analysed human breast cancer sample generated with the 10x Visium platform. Following the instructions from the iStar documentation, we prepared the data and trained the iStar model. The resulting gene expression matrix predicted gene expression for 1000 SVGs across 472 320 spatial locations derived from the whole-slide image. Using this gene expression matrix as input, we ran Chrysalis with the same settings as for the original data (number of PCs = 20, number of compartments = 8).
Statistics and reproducibility
For the evaluation and benchmarks, Pearson correlation coefficients were computed with the pearsonr function from SciPy’s69 stats module. Jensen–Shannon distance was determined using the jensenshannon function from SciPy’s spatial.distance module. ROC curves and F1 scores were generated using the roc_curve and f1_score functions, respectively, from SciPy’s metrics module. The Adjusted Rand Index, used to evaluate morphological feature integration, was calculated with the metrics.adjusted_rand_score function. Visualisations, including boxplots, violin plots, bar plots, line plots, heatmaps, and others, were created using matplotlib70 and seaborn71.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Supplementary information
Acknowledgements
We thank Chang He, Morganne Decollogny, and Stefano Bagatella for providing guidance and assistance with the mouse brain tissue histology. We also thank Lollija Gladiseva, Joanna Ficek-Pascual, Petra C. Schwalie, and Benedek Pesti for feedback and helpful discussions about Chrysalis. This work was supported by the European Research Council (ERC-2019-AdG-883877), the Swiss National Science Foundation (320030M_219453), the Swiss Cancer Research Foundation (KFS-5519-02-2022), and the Department of Defense (Award No. W81XWH-22-1-0557).
Author contributions
D.T. conceived the idea of Chrysalis. A.V. and S.R. contributed to the study conceptualisation and supervised the research. D.T. designed the methodology, algorithms, validation, and benchmarking analysis with input from S.R., J.V., and A.V. and implemented Chrysalis software. J.V. and D.T. developed morphological feature integration. K.H. performed histopathological validation and tissue annotations. D.T. wrote the original draft, J.V., K.H., A.V., S.R., and D.T. revised and edited the manuscript. S.R. worked on project administration and funding acquisition.
Peer review
Peer review information
Communications Biology thanks Yun-Gui Yang and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Primary Handling Editor: and Tobias Goris. A peer review file is available.
Data availability
10x Visium datasets used in this study, including the human lymph node, the mouse brain FFPE coronal, the FF anterior, and posterior sagittal sections, and the Visium HD colorectal cancer are available on the 10x Genomics online data repository (https://www.10xgenomics.com/resources/datasets). 10x Xenium and Visium human breast cancer data and the corresponding high-resolution slide scans can be found on the 10x Genomics website (https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast). Tabula Sapiens immune cell atlas was acquired from the repository (https://tabula-sapiens-portal.ds.czbiohub.org). Cell type deconvolution data generated with cell2location for the human lymph node sample can be reproduced using the original pipeline (https://cell2location.readthedocs.io/en/latest/notebooks/cell2location_tutorial.html). Marker gene sets for cell types found in the lymph node are available on the CZ CELLxGENE Discover online resource (https://cellxgene.cziscience.com). Stereo-seq mouse embryo data can be accessed through the Mouse Organogenesis Spatiotemporal Transcriptomic Atlas (MOSTA) data repository (https://db.cngb.org/stomics/mosta). Slide-seqV2 mouse hippocampus data can be downloaded from the Broad Institute Single Cell Portal after registration (https://singlecell.broadinstitute.org/single_cell/study/SCP815/highly-sensitive-spatial-transcriptomics-at-near-cellular-resolution-with-slide-seqv2#study-summary). AnnData objects of analysed datasets, all intermediary files, including synthetic datasets, cell type deconvolution results, marker gene sets for the human lymph node, the single cell labels for the Xenium data, reference data, and the expert annotations required to reproduce the analysis presented in this study are deposited at Zenodo (10.5281/zenodo.824777972).
Code availability
Chrysalis is available as a Python package at https://github.com/rockdeme/chrysalis73. Documentation and tutorials are available at https://chrysalis.readthedocs.io. The code used for the data analysis presented in this article is available at https://github.com/rockdeme/chrysalis/tree/master/article.
Competing interests
J.V., K.H., and A.V. are currently employed by F. Hoffmann-La Roche Ltd. The other authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
These authors jointly supervised this work: Sven Rottenberg, Alberto Valdeolivas.
Contributor Information
Demeter Túrós, Email: peter.turos@unibe.ch.
Sven Rottenberg, Email: sven.rottenberg@unibe.ch.
Alberto Valdeolivas, Email: alberto.valdeolivas_urbelz@roche.com.
Supplementary information
The online version contains supplementary material available at 10.1038/s42003-024-07165-7.
References
- 1.Longo, S. K., Guo, M. G., Ji, A. L. & Khavari, P. A. Integrating single-cell and spatial transcriptomics to elucidate intercellular tissue dynamics. Nat. Rev. Genet. 1–18 10.1038/s41576-021-00370-8 (2021). [DOI] [PMC free article] [PubMed]
- 2.Ståhl, P. L. et al. Visualization and analysis of gene expression in tissue sections by spatial transcriptomics. Science353, 78–82 (2016). [DOI] [PubMed] [Google Scholar]
- 3.Vickovic, S. et al. High-definition spatial transcriptomics for in situ tissue profiling. Nat. Methods16, 987–990 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Fu, X. et al. Polony gels enable amplifiable DNA stamping and spatial transcriptomics of chronic pain. Cell185, 4621–4633.e17 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Cao, J. et al. Decoder-seq enhances mRNA capture efficiency in spatial RNA sequencing. Nat. Biotechnol. 1–12 10.1038/s41587-023-02086-y (2024). [DOI] [PubMed]
- 6.Stickels, R. R. et al. Highly sensitive spatial transcriptomics at near-cellular resolution with Slide-seqV2. Nat. Biotechnol.39, 313–319 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Oliveira, M. F. et al. Characterization of immune cell populations in the tumor microenvironment of colorectal cancer using high definition spatial profiling. bioRxiv 2024.06.04.597233 10.1101/2024.06.04.597233 (2024).
- 8.Tian, L., Chen, F. & Macosko, E. Z. The expanding vistas of spatial transcriptomics. Nat. Biotechnol. 1–10 10.1038/s41587-022-01448-2 (2022). [DOI] [PMC free article] [PubMed]
- 9.Zhao, E. et al. Spatial transcriptomics at subspot resolution with BayesSpace. Nat. Biotechnol.39, 1375–1384 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Pham, D. et al. stLearn: integrating spatial location, tissue morphology and gene expression to find cell types, cell-cell interactions and spatial trajectories within undissociated tissues. Biorxiv 2020.05.31.125658 10.1101/2020.05.31.125658 (2020).
- 11.Hu, J. et al. SpaGCN: Integrating gene expression, spatial location and histology to identify spatial domains and spatially variable genes by graph convolutional network. Nat. Methods18, 1342–1351 (2021). [DOI] [PubMed] [Google Scholar]
- 12.Liu, W. et al. Probabilistic embedding, clustering, and alignment for integrating spatial transcriptomics data with PRECAST. Nat. Commun.14, 296 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Li, H. et al. A comprehensive benchmarking with practical guidelines for cellular deconvolution of spatial transcriptomics. Nat. Commun.14, 1548 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Townes, F. W. & Engelhardt, B. E. Nonnegative spatial factorization applied to spatial genomics. Nat. Methods20, 229–238 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Velten, B. et al. Identifying temporal and spatial patterns of variation from multimodal data using MEFISTO. Nat. Methods19, 179–186 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Stuart, T. et al. Comprehensive integration of single-cell data. Cell177, 1888–1902.e21 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Zeng, Z., Li, Y., Li, Y. & Luo, Y. Statistical and machine learning methods for spatially resolved transcriptomics data analysis. Genome Biol.23, 83 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Cang, Z. & Nie, Q. Inferring spatial and signaling relationships between cells from single cell transcriptomic data. Nat. Commun.11, 2084 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Song, Q. & Su, J. DSTG: deconvoluting spatial transcriptomics data through graph-based artificial intelligence. Brief. Bioinform.22, bbaa414 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Kleshchevnikov, V. et al. Cell2location maps fine-grained cell types in spatial transcriptomics. Nat. Biotechnol. 1–11 10.1038/s41587-021-01139-4 (2022). [DOI] [PubMed]
- 21.Cable, D. M. et al. Robust decomposition of cell type mixtures in spatial transcriptomics. Nat. Biotechnol.40, 517–526 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Walker, B. L., Cang, Z., Ren, H., Bourgain-Chang, E. & Nie, Q. Deciphering tissue structure and function using spatial transcriptomics. Commun. Biol.5, 220 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Wigerblad, G. et al. Single-cell analysis reveals the range of transcriptional states of circulating human neutrophils. J. Immunol.209, 772–782 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Miller, B. F., Huang, F., Atta, L., Sahoo, A. & Fan, J. Reference-free cell type deconvolution of multi-cellular pixel-resolution spatially resolved transcriptomics data. Nat. Commun.13, 2339 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Sutton, G. J. et al. Comprehensive evaluation of deconvolution methods for human brain gene expression. Nat. Commun.13, 1358 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Shang, L. & Zhou, X. Spatially aware dimension reduction for spatial transcriptomics. Nat. Commun.13, 7203 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Dong, K. & Zhang, S. Deciphering spatial domains from spatially resolved transcriptomics with an adaptive graph attention auto-encoder. Nat. Commun.13, 1739 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Long, Y. et al. Spatially informed clustering, integration, and deconvolution of spatial transcriptomics with GraphST. Nat. Commun.14, 1155 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Handschutter, P. D., Gillis, N., Vandaele, A. & Siebert, X. Near-Convex Archetypal Analysis. arXiv10.48550/arxiv.1910.00821 (2019).
- 30.Samek, W., Wiegand, T. & Müller, K.-R. Explainable artificial intelligence: understanding, visualizing and interpreting deep learning models. arXiv 10.48550/arxiv.1708.08296 (2017).
- 31.Cutler, A. & Breiman, L. Archetypal analysis. Technometrics36, 338–347 (1994). [Google Scholar]
- 32.Hausser, J. & Alon, U. Tumour heterogeneity and the evolutionary trade-offs of cancer. Nat. Rev. Cancer20, 247–257 (2020). [DOI] [PubMed] [Google Scholar]
- 33.Hart, Y. et al. Inferring biological tasks using Pareto analysis of high-dimensional data. Nat. Methods12, 233–235 (2015). [DOI] [PubMed] [Google Scholar]
- 34.Persad, S. et al. SEACells infers transcriptional and epigenomic cellular states from single-cell genomics data. Nat. Biotechnol.41, 1746–1757 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Marrahi, A. E., Lipreri, F., Alber, D. & Hausser, J. Four tumor micro-environmental niches explain a continuum of inter-patient variation in the macroscopic cellular composition of breast tumors. Biorxiv 2022.03.04.482793 10.1101/2022.03.04.482793 (2022).
- 36.He, S. et al. Starfysh integrates spatial transcriptomic and histologic data to reveal heterogeneous tumor–immune hubs. Nat. Biotechnol. 1–13 10.1038/s41587-024-02173-8 (2024). [DOI] [PMC free article] [PubMed]
- 37.Andersson, A. et al. Single-cell and spatial transcriptomics enables probabilistic inference of cell type topography. Commun. Biol.3, 565 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Consortium*, T. S. et al. The Tabula Sapiens: a multiple-organ, single-cell transcriptomic atlas of humans. Science376, eabl4896 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Rodda, L. B. et al. Single-cell RNA sequencing of lymph node stromal cells reveals niche-associated heterogeneity. Immunity48, 1014–1028.e6 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Janesick, A. et al. High resolution mapping of the breast cancer tumor microenvironment using integrated single cell, spatial and in situ analysis of FFPE tissue. Biorxiv 2022.10.06.510405 10.1101/2022.10.06.510405 (2022).
- 41.Wu, H., Ma, S., Xiang, M. & Tong, S. HTRA1 promotes transdifferentiation of normal fibroblasts to cancer-associated fibroblasts through activation of the NF-κB/bFGF signaling pathway in gastric cancer. Biochem. Biophys. Res. Co.514, 933–939 (2019). [DOI] [PubMed] [Google Scholar]
- 42.Albers, J. J., Vuletic, S. & Cheung, M. C. Role of plasma phospholipid transfer protein in lipid and lipoprotein metabolism. Biochim. Et. Biophys. Acta Bba Mol. Cell Biol. Lipids1821, 345–357 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Zhang, Y., Fang, X. & Sun, Y. IGHG1 promotes malignant progression in breast cancer cells through the regulation of AKT and VEGF signaling. Biomol. Biomed. 10.17305/bb.2022.8508 (2023). [DOI] [PMC free article] [PubMed]
- 44.Lein, E. S. et al. Genome-wide atlas of gene expression in the adult mouse brain. Nature445, 168–176 (2007). [DOI] [PubMed] [Google Scholar]
- 45.Belgard, T. G. et al. A transcriptomic atlas of mouse neocortical layers. Neuron71, 605–616 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Chen, A. et al. Spatiotemporal transcriptomic atlas of mouse organogenesis using DNA nanoball-patterned arrays. Cell185, 1777–1792.e21 (2022). [DOI] [PubMed] [Google Scholar]
- 47.Ding, K.-F. et al. Effect of SNC19/ST14 gene overexpression on invasion of colorectal cancer cells. World J. Gastroenterol.11, 5651–5654 (2005). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Adler, M., Kohanim, Y. K., Tendler, A., Mayo, A. & Alon, U. Continuum of gene-expression profiles provides spatial division of labor within a differentiated cell type. Cell Syst.8, 43–52.e5 (2019). [DOI] [PubMed] [Google Scholar]
- 49.Milite, S., Caravagna, G. & Sottoriva, A. Deep Archetypal Analysis for interpretable multi-omic data integration based on biological principles. bioRxiv 2024.04.05.588238 10.1101/2024.04.05.588238 (2024).
- 50.Ni, Z. et al. SpotClean adjusts for spot swapping in spatial transcriptomics data. Nat. Commun.13, 2971 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Hughes, C., Gaunt, L., Brown, M., Clarke, N. W. & Gardner, P. Assessment of paraffin removal from prostate FFPE sections using transmission mode FTIR-FPA imaging. Anal. Methods6, 1028–1035 (2014). [Google Scholar]
- 52.Hu, J. et al. Deciphering tumor ecosystems at super resolution from spatial transcriptomics with TESLA. Cell Syst.14, 404–417.e4 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 53.Bergenstråhle, L. et al. Super-resolved spatial transcriptomics by deep data fusion. Nat. Biotechnol.40, 476–479 (2022). [DOI] [PubMed] [Google Scholar]
- 54.Zhang, D. et al. Inferring super-resolution tissue architecture by integrating spatial transcriptomics with histology. Nat. Biotechnol.42, 1372–1377 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55.Wolf, F. A., Angerer, P. & Theis, F. J. SCANPY: large-scale single-cell gene expression data analysis. Genome Biol.19, 15 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 56.Palla, G. et al. Squidpy: a scalable framework for spatial omics analysis. Nat. Methods19, 171–178 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 57.Rey, S. J. & Anselin, L. PySAL: A Python library of spatial analytical methods. Rev. Regional Stud.37, 5–27 (2007).
- 58.Moran, P. A. P. The interpretation of statistical maps. J. R. Stat. Soc. B (Methodol.)10, 243–251 (1948). [Google Scholar]
- 59.Geary, R. C. The contiguity ratio and statistical mapping. Inc. Stat.5, 115–141 (1954). [Google Scholar]
- 60.Jiang, R., Li, Z., Jia, Y., Li, S. & Chen, S. SINFONIA: scalable identification of spatially variable genes for deciphering spatial domains. Cells12, 604 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 61.Kats, I., Vento-Tormo, R. & Stegle, O. SpatialDE2: Fast and localized variance component analysis of spatial transcriptomics. Biorxiv 2021.10.27.466045 10.1101/2021.10.27.466045 (2021).
- 62.Anderson, A. & Lundeberg, J. sepal: identifying transcript profiles with spatial patterns by diffusion-based modeling. Bioinformatics37, btab164 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 63.Wang, J. et al. Dimension-agnostic and granularity-based spatially variable gene identification. Biorxiv 2023.03.21.533713 10.1101/2023.03.21.533713 (2023). [DOI] [PMC free article] [PubMed]
- 64.Zhu, J., Sun, S. & Zhou, X. SPARK-X: non-parametric modeling enables scalable and robust detection of spatial expression patterns for large spatial transcriptomic studies. Genome Biol.22, 184 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 65.Pedregosa, F. et al. Scikit-learn: machine learning in Python. Arxiv10.48550/arxiv.1201.0490 (2012). [Google Scholar]
- 66.Bankhead, P. et al. QuPath: open source software for digital pathology image analysis. Sci. Rep.7, 16878 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 67.Paszke, A. et al. PyTorch: an imperative style, high-performance deep learning library. arXiv 10.48550/arxiv.1912.01703 (2019).
- 68.Hie, B., Bryson, B. & Berger, B. Efficient integration of heterogeneous single-cell transcriptomes using Scanorama. Nat. Biotechnol.37, 685–691 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 69.Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat. Methods17, 261–272 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 70.Hunter, J. D. Matplotlib: a 2D graphics environment. Comput. Sci. Eng.9, 90–95 (2007). [Google Scholar]
- 71.Waskom, M. seaborn: statistical data visualization. J. Open Source Softw.6, 3021 (2021). [Google Scholar]
- 72.Túrós, D. Chrysalis: decoding tissue compartments in spatial transcriptomics with archetypal analysis. Zenodo10.5281/zenodo.8247779. [DOI] [PMC free article] [PubMed]
- 73.Túrós, D. rockdeme/chrysalis. GitHub10.5281/zenodo.14001091.
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
10x Visium datasets used in this study, including the human lymph node, the mouse brain FFPE coronal, the FF anterior, and posterior sagittal sections, and the Visium HD colorectal cancer are available on the 10x Genomics online data repository (https://www.10xgenomics.com/resources/datasets). 10x Xenium and Visium human breast cancer data and the corresponding high-resolution slide scans can be found on the 10x Genomics website (https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast). Tabula Sapiens immune cell atlas was acquired from the repository (https://tabula-sapiens-portal.ds.czbiohub.org). Cell type deconvolution data generated with cell2location for the human lymph node sample can be reproduced using the original pipeline (https://cell2location.readthedocs.io/en/latest/notebooks/cell2location_tutorial.html). Marker gene sets for cell types found in the lymph node are available on the CZ CELLxGENE Discover online resource (https://cellxgene.cziscience.com). Stereo-seq mouse embryo data can be accessed through the Mouse Organogenesis Spatiotemporal Transcriptomic Atlas (MOSTA) data repository (https://db.cngb.org/stomics/mosta). Slide-seqV2 mouse hippocampus data can be downloaded from the Broad Institute Single Cell Portal after registration (https://singlecell.broadinstitute.org/single_cell/study/SCP815/highly-sensitive-spatial-transcriptomics-at-near-cellular-resolution-with-slide-seqv2#study-summary). AnnData objects of analysed datasets, all intermediary files, including synthetic datasets, cell type deconvolution results, marker gene sets for the human lymph node, the single cell labels for the Xenium data, reference data, and the expert annotations required to reproduce the analysis presented in this study are deposited at Zenodo (10.5281/zenodo.824777972).
Chrysalis is available as a Python package at https://github.com/rockdeme/chrysalis73. Documentation and tutorials are available at https://chrysalis.readthedocs.io. The code used for the data analysis presented in this article is available at https://github.com/rockdeme/chrysalis/tree/master/article.




