Abstract
Understanding how tissues remodel in response to perturbations requires computational tools that can untangle condition-specific changes from the conserved tissue architecture. We present Haruka, a spatially aware contrastive learning framework that identifies salient (condition-specific) and background (shared) spatial domains across tissue slices and experimental conditions. Haruka integrates contrastive variational inference with an auxiliary microenvironment reconstruction task, enabling the model to learn spatial-context-informed embeddings that capture both perturbation effects and local neighborhood context. Through benchmarking on simulated and real datasets, Haruka outperforms state-of-the-art methods in detecting spatially heterogeneous responses. Applied to diverse spatial omics platforms, Haruka distinguished immunotherapy responders in melanoma, traced fibrosis progression in human lung tissue, and mapped treatment-resistant microenvironments in KRASG12D-mutated lung cancer. Thus, Haruka provides a generalizable framework for spatial contrastive analysis, enabling systematic dissection of tissue organization, cellular plasticity, and microenvironmental remodeling across disease, development, and therapeutic response.
Introduction
Advances in high-throughput spatial omics technologies have revolutionized our ability to study biological systems by capturing molecular information directly within intact tissue. By profiling multiple tissue slices in parallel, these methods enable detailed assessment of spatial heterogeneity and reproducibility across biological and experimental conditions. Integrating spatially resolved transcriptomics and proteomics allows direct mapping of gene expression and protein distribution, providing richer context for interpreting molecular and cellular organization. Moreover, methods such as MERFISH1, seqFISH+2, and Slide-seq3 have made it possible to chart high-resolution transcriptomic profiles across sections, revealing both spatial continuity and local variability. Additionally, spatial proteomics platforms such as CODEX3,4 and imaging mass cytometry (IMC)3–5 allow multiplexed protein quantification across slices, uncovering patterns of tissue architecture and function. Collectively, these spatial omics approaches have transformed our capacity to interrogate complex tissue organization and heterogeneous cellular responses across diverse biological contexts.
Understanding how cells respond to perturbations within their spatial microenvironment is essential for decoding the principles that govern development, disease progression, and therapeutic response. Spatially resolved studies have uncovered how cellular behaviors and molecular programs vary dramatically depending on their position within a tissue. For instance, spatial omics revealed gene expression dynamics underlying brain development and aging6,7 as well as microenvironment-specific responses that drive tumor heterogeneity and influence treatment outcomes8–11. Yet, analyzing spatial responses to perturbations remains challenging due to the intricate interplay between cell types, local environment and global tissue organization. Even genetically identical cell types can display remarkably distinct responses depending on their spatial niche7- underscoring the need for computational frameworks that can resolve such context-dependent heterogeneity.
Despite the rapid advances of spatial omics, most computational frameworks remain limited in effectively integrating spatial context or employing contrastive analysis12,13 to capture perturbation-specific responses. Conventional methods often rely on clustering or factor decomposition without explicitly modeling spatial relationships or contrasting conditions, limiting their ability to discern subtle yet meaningful spatial differences. For instance, CellCharter14 models cell type distributions and neighborhood interactions but lacks the capacity for contrastive learning across conditions. Conversely, contrastive variational inference (contrastive VI)15 excels at disentangling shared and condition-specific latent factors but ignores spatial information, treating each observation as independent. This gap between spatial modeling and contrastive learning hinders accurate interpretation of perturbation-driven heterogeneity.
To overcome these limitations, we developed Haruka, a spatially aware contrastive learning framework that disentangles condition-specific perturbations from shared tissue architecture. Haruka combines contrastive variational inference12,15 with an auxiliary microenvironment reconstruction task, enabling learned embeddings to capture both spatial dependencies and global condition effects. These embeddings are then aggregated into higher-order niche representations, linking fine-grained cellular responses to the broader organization of tissue microenvironments. Through this integration, Haruka establishes a generalizable framework for analyzing spatial perturbations across tissues and conditions, providing new opportunities to uncover how developmental, pathological, and therapeutic processes remodel the cellular landscape.
Results
1. Benchmarking Haruka against state-of-the-art methods reveals superior detection of salient spatial domains
Haruka is a deep generative model that jointly encodes spatial context and contrastive structure to learn two embeddings per cell: a salient (condition-specific) and a background (shared) representation. Specifically, we integrate a multi-task reconstruction objective, including spatial omics profile recovery and spatial covariance matrix reconstruction, with an additive contrastive generative process to infer both background and salient representations. These embeddings are aggregated through spatial neighborhoods and clustered to define spatial domains that capture both shared architecture and condition-specific variation (Fig. 1). The learned representations also support downstream analysis across multiple slices and conditions.
Figure 1. Overview of Haruka.

a, Overview of the Haruka pipeline. Haruka takes as input multi-slice spatial omics datasets from both condition and control samples and can flexibly accommodate different spatial omics modalities. The Haruka model extracts spatial-aware salient and background representations for each niche (a centric cell with its given neighbors) after reconstruction training. The salient and background niche embeddings are then aggregated by spatial neighbors to obtain a spatially smooth niche embedding that considers multi-scale resolution information. Finally, Gaussian Mixture Model clustering is applied to obtain the final salient/background spatial domains, consistent across both condition and control slices. b, Details of the Haruka model architecture. Haruka first transforms each niche into two input parts: the Covariance Gene Expression matrix (COVET) of neighboring cells and the centric cell gene expression (CGE). Haruka then receives only CGE as input for subsequent encoders. For condition group niches, they are modeled by a combination of salient latent embedding and latent background embedding. Control group niches are modeled by only the background embedding. Haruka utilizes two separate decoders (CGE reconstruction layers and COVET reconstruction layers) to reconstruct CGE and COVET separately. This process forces the latent embedding to capture information contained in the niche neighbors by reconstructing COVET without explicit input. The final latent embedding (background for control groups and salient + background for condition groups) for both groups is then fed to both decoders. The model is optimized based on a variational inference framework to achieve minimal reconstruction loss in COVET and CGE.
In simulated benchmarking, we used a MERFISH mouse hypothalamus dataset as the background and introduced region-specific perturbations to define salient domains (Fig. 2a, Methods). We then compared Haruka to CellCharter14, Contrastive VI15, and CINEMA-OT17, using ARI, NMI and related clustering metrics (Methods). Across tasks of varying difficulty, Haruka outperformed all other methods in detecting salient domains while maintaining competitive accuracy in background domain identification (Fig. 2b–c and Extended Data Fig. 1). CellCharter, which was designed primarily to capture background spatial structure, underperformed on salient variation while Haruka efficiently identified both salient and background patterns.
Figure 2. Benchmarking Haruka against existing methods using semi-simulated and mouse brain aging datasets.

a, MERFISH mouse brain datasets simulation diagram. We add different parameter gamma distributions in three simulated spatial domains and then introduce heterogeneity shifts in these spatial domains relative to the original ground truth expression. Thus, the original brain section serves as the ground truth background spatial domain, and the three simulated spatial domain shifts represent the ground truth salient domains. b, Visualization of the ground truth salient and background spatial domains, and the results from Haruka alongside comparison methods (ContrastiveVI, CellCharter, and CINEMA-OT). c, Quantitative comparison between Haruka and comparison methods on the MERFISH semi-simulation dataset in terms of clustering accuracy (ARI, NMI) and spatial continuity (PAS, CHAOS) across different simulated salient shifts (Poisson signal parameter (alpha=2,4,6) and domain area proportion (0.1, 0.15, 0.2)). d, Visualization of the real-world mouse brain aging benchmark dataset. We separate each brain subregion into positively correlated, negatively correlated, and non-correlated domains with the aging procedure, totaling 3*4 = 12 salient spatial domains, with the original brain subregion serving as the ground truth background spatial domain (left). Results of Haruka and comparison methods (Contrastive VI, CellCharter, and CINEMA-OT) are also shown. e, Quantitative comparison of Haruka with comparison methods using clustering accuracy metrics (ARI, NMI).
For real-world evaluation, we applied Haruka to a MERFISH-based mouse brain aging dataset7 (Methods). The original study reported that gene expression responses to aging vary markedly across brain regions in a cell type-specific manner, with some regions exhibiting pronounced changes while others remained relatively stable. We used these observations to construct twelve spatial domains (four brain sections and three correlation groups per section) representing different regional responses to aging (Methods). This benchmark presented two key challenges: salient domains in real tissue can be spatially discontinuous, and identical cell types may behave differently across brain sections. Because of this complexity, we excluded continuity-sensitive metrics such as CHAOS and PAS that penalize fragmented but biologically meaningful domains. Background domains were defined by anatomical subregions, and the youngest (E3.4) and oldest (E34.5) sections were designed as control and condition samples, respectively. Haruka significantly outperformed all baseline methods in identifying salient domains and performed comparably to CellCharter on background domains task (Fig. 2d–e). These results demonstrate that Haruka generalizes effectively across simulated and real-world datasets, capturing biologically relevant heterogeneity with robustness and scalability.
2. Haruka identifies salient immune domains that stratify immunotherapy response in melanoma
To assess Haruka's performance in a clinical context, we applied it to a large CODEX melanoma spatial proteomics dataset8 analyzed before and after immune checkpoint blockade (ICB) therapy, and annotated with clinical status as a responder or non-responder to treatment based on objective response rate (ORR) labels (n = 6 patients total). In our analysis, pre-treatment tissues were designated as control, and post-treatment tissues as condition, allowing Haruka to identify response-associated spatial variation (Fig. 3a). Haruka discovered four recurrent salient immune domains (Domains 0–3) that capture microregional heterogeneity in post-treatment tumor landscapes (Fig. 3b–e and Extended Data Fig. 2a).
Figure 3. Haruka-derived microenvironment reveals immunotherapy response heterogeneity in the CODEX melanoma dataset.

a, Overview of the Haruka pipeline applied to the melanoma immunotherapy CODEX dataset. b, Spatial distribution of annotated cell types and cell neighborhoods in a representative tissue section. c, Background and Salient spatial domains derived from Haruka in the same representative tissue section as b. d, Cell type proportion and cell-cell co-occurrence for each salient spatial domain (0,1,2,3). Spot size indicates cell type proportion in this domain, and edge abundance between two nodes denotes the cell type co-occurrence frequency in this domain. Four salient spatial domains show distinguished cell type and co-occurrence patterns, reflecting their heterogeneous response to immunotherapy. e, Coarse-grained cell type proportion comparison among four salient spatial domains. f, Fine-grained immune cell type proportion comparison between salient spatial domains 1 and 3, which show closer coarse-grained immune cell type proportion distribution. g, Principal Component Analysis (PCA) results for salient spatial domain frequency for each patient with Non-responder/Responder phenotype annotation. h, UMAP visualization of MaxFuse co-embedding of external scRNA-seq dataset and salient domain 0 CODEX proteomics data. i, Volcano plot showing differential gene expression results in CD8 T cells from scRNA-seq data grouped by matched/non-matched CODEX salient domain 0. j, GO term enrichment results on the significant differential expression marker genes in matched domain 0 cells (resistant to immunotherapy). k, RNA-protein co-expression correlation in domain 0 with the integrated result after MaxFuse. Higher PCC indicates potential higher co-expression of the spatial proteomics biomarker and gene expression.
Importantly, Haruka revealed that responders (ORR=1) were enriched for Domain 0 and 2, each representing distinct yet converging routes to effective ICB response (Extended Data Fig. 2b). Both domains were characterized by networks centered on TCF1+ CD8+ T cells, a stem-like precursor subset essential for sustained antitumor immunity18,19. In concert with dendritic cells (DCs) and CD4+ T cells20, these form a productive immune circuit necessary for T cell priming and expansion. Domain 0 represented a T cell dominated activation hub (Fig. 3d), where TCF1+ CD8+ T cells directly interacted with tumor cells21, while Domain 2 formed a stromal-integrated immune zone where stromal cells supported rather than impeded immune–tumor interactions. Here, TCF1+ CD8+ T cells remain central, but function within a broader, more balanced co-occurrence structure that maintains immune accessibility19,20. Thus, both domains represent effective immunotherapy microenvironments: one via immune density, the other via immune-stromal harmony.
In contrast, non-responders (ORR = 0) were enriched for Domains 1 and 3 (Extended Data Fig. 2b), two distinct modes of immunotherapy resistance. A shared hallmark is a near-complete absence of TCF1+ CD8+ T cells, a progenitor population critical for sustaining anti-tumor immunity and predictive of checkpoint blockade responsiveness18. Domain 1 was dominated by interconnected fibroblasts and M2-like macrophages that form a non-productive, immunosuppressive niche (Fig. 3d), consistent with immune exclusion mechanisms22,23. Domain 3 displayed an epithelial-dominant phenotype lacking immune cell infiltration (Fig. 3d–e), consistent with immune desert24. The absence of dendritic cells, CD4+ T cells, and cytotoxic CD8+ subsets (Fig. 3f) suggests a structurally inert, antigen-silent environment resembling that of so-called “cold tumors”25,26. Thus, both Domains 1 and 3 exhibit resistance modes driven by spatial exclusion and immune invisibility. Taken together, our data in responders and non-responders support that patient-specific distribution of salient domains might serve as an indicator of therapeutic response. Indeed, our principal component analysis (PCA) of salient domain fractions effectively separated patients based on their ORR, a standard clinical metric for immunotherapy outcomes (Fig. 3g). Importantly, Haruka uses only simple, binary labels (pre- vs. post-treatment), highlighting its flexibility and applicability in clinical research settings.
To further explore the biological basis of these salient domains, we integrated the ORR-negative Domain 3 CODEX reference with an independent post-immunotherapy melanoma scRNA-seq datasets27 using MaxFuse28 (Fig. 3h and Methods). In differential gene expression analysis of matched CD8 T cells, we identified transcriptional signatures characterized by inflammatory activation but global translational repression. These included downregulation of biosynthetic and ER-targeting machinery and enrichment of interferon and antigen presentation pathways (Fig. 3i–j and Methods), consistent with known immune exclusion mechanisms29–32. These changes suggest an immune exhaustion driven by chronic cytokine exposure and TGF-β signaling, consistent with fibroblast-mediated immune suppression in the TME (tumor microenvironment)33–36 and cancer-associated fibroblast (CAF) barriers that restrict immune cell infiltration37,38. In RNA-protein correlation analysis (Fig. 3k), we further showed that immunosuppressive markers CD163 and CD206 were correlated with tolerogenic transcripts such as SIGLEC10 and SPON139–41, defining an M2-like macrophage program associated with checkpoint therapy failure.
Together, these findings define a spatially encoded model of immune resistance in melanoma where immune cells persist but exhibit translational suppression and metabolic exhaustion.
3. Haruka captures salient and background representations to map fibrosis progression in human lung
To demonstrate Haruka’s flexibility across spatial omics platforms, we applied Haruka to a large-scale Xenium dataset of human pulmonary lung fibrosis42 (Fig. 4a and Methods). In this setting, 10 normal human lung tissue samples were designated as the control group, while 35 lung tissues from patients with pulmonary fibrosis served as the condition group (Fig. 4a). We found that Haruka's background and salient domains corresponded closely with transcript-based and cell-based niches defined in the original study, suggesting that Haruka can faithfully recover known tissue architecture (Fig. 4b and Extended Data Fig. 3a–b).
Figure 4. Haruka captures lung fibrosis dynamics at niche resolution.

a, Overview of the Haruka pipeline applied to the human lung fibrosis 10x Xenium dataset. b, Visualization of annotated transcript and cell niches, Haruka derived background and salient domains in a representative tissue section. c, Comparison of separation between less and more affected samples using Haruka's salient domain frequency vector (top) versus raw gene expression (bottom). Left: PCA visualization of samples labeled as less or more affected in the original study. Right: Boxplots of PC1 values for the two groups, with rank-sum test p-values shown. d, Diagram of our cross-condition slice alignment benchmarking. We compared the salient background representation with original gene expression, utilized as input for the SLAT alignment tool, to align the cross-condition slices (less-more affected samples) and compare the quality of each representation by the final alignment metrics. e, Quantitative evaluation of comparisons in the three metrics across three less-more slices pairs. f, Matched Sankey plot for the CN niche identity in aligned less affected and more affected slice cells in the representative sections. Cell niches and background domains were also visualized for both slices. g, Potential cell type transition from less affected to more affected situation by the SLAT matched results based on Haruka background representation. h, Volcano plot for the differential expression analysis for the Alveolar FBs in the less affected samples grouped by the label (will transfer to Activated FBs in the future and won’t). X-axis represents the log2 transformed fold change, and y-axis represents −log10 transformed adjusted p-values. Five top genes were highlighted. i, Gene ontology enrichment of upregulated genes in “will transfer to Activated Fibrotic FBs Alveolar FBs” group defined in g.
To evaluate whether salient domains could capture fibrosis progression, we projected samples into low-dimensional spaces derived from Haruka’s salient representations and from raw gene expression (Methods). We found projection of samples using Haruka’s salient embeddings separated mildly affected versus severely fibrotic tissues, a distinction that raw gene expression failed to capture (Fig. 4c). These results demonstrate that Haruka’s salient domains provide a more sensitive representation of disease progression, overcoming the confounding effects of spatial complexity and intra-group variation.
We next tested whether Haruka's background representations could improve tissue slice alignment across conditions. Using the SLAT algoritm43, we compared alignments based on original gene expression profiles versus Haruka-derived background embeddings across fibrosis severity (Fig. 4d and Methods). Haruka substantially improved CNiche-matching and F1 scores (Fig. 4e) indicating more accurate mapping between control and fibrotic slices. This alignment revealed transitions from alveolar fibroblasts (FBs) to inflammatory fibroblasts, a hallmark of lung fibrosis pathology (Fig. 4f–g).
To identify early transcriptional priming events preceding fibroblast activation, we stratified alveolar FBs in mildly affected tissue according to whether their matched cells in severely affected tissue adopted a fibrotic identity (Fig. 4g). Differential gene expression analysis revealed upregulation of extracellular matrix organization and structure pathways in the pre-transition subgroup (Fig. 4h–i), consistent with early activation towards a fibrotic state. These programs also align with single-cell studies that have consistently identified ECM-producing fibroblast subsets as central to fibrotic tissue development44–46.
4. Haruka reveals intra-condition spatial heterogeneity in treatment of KRASG12D-mutated lung cancer with a KRAS inhibitor
To assess the translational applicability of Haruka, we employed a KRASG12D-mutant mouse model of metastatic lung cancer and examined the therapeutic effects of a KRASG12D specific inhibitor (MRTX1133) using spatial transcriptomics (Fig. 5a). Using the 10x Genomics Xenium platform, we generated high-resolution spatial maps of whole lung specimens that contained disseminated KRASG12D-mutant lung tumors. We compared specimens that were treated with vehicle control versus those subjected to MRTX1133 treatment (n = 4 specimens per treatment condition) (Methods and Extended Data Fig. 4a–d).
Figure 5. Haruka reveals intra-condition spatial heterogeneity and macrophage trajectories in KRASG12D-mutated lung cancer.

a, Experimental design for generating the Xenium 5K dataset. KRASG12D-mutant tumor cells were intravenously injected into mice and treated with either vehicle or the KRASG12D inhibitor MRTX1133 for 5 days, followed by 9 day washout and spatial transcriptomic profiling on day 21. b, UMAP visualization of cell type annotations across all samples, highlighting both the cell type identities (left) and treatment groups (right). c, Comparison of cell type proportions between Vehicle and MRTX1133-treated tumors (n = 4 biological replicates per group). P-values were calculated using the Wilcoxon rank-sum test. Treatment with MRTX1133 increases the proportion of epithelial cells (AT1) while decreasing immune cell fractions, including B cells and tumor-associated macrophages (TAM_Mac). d, Spatial maps showing cell type distributions across biological replicates for Vehicle and MRTX1133-treated tumors. Colors correspond to cell types shown in panel b. e, Haruka-derived background and salient spatial domains across replicates, revealing distinct microenvironmental organizations within and between treatment groups. f, Distribution of background and salient spatial domain proportions across vehicle-treated groups. g, Cell type enrichment across salient spatial domains. Dot size and color denote the log-transformed fold change reflecting enrichment significance. Notably, inflammatory macrophages are highly enriched in salient domain 5, highlighted by the red circle. h, Enrichment of neighboring cell types surrounding inflammatory macrophages in salient domains 1 and 5, highlighting distinct spatial interaction patterns across the two domains. i, UMAP visualization of the inflammatory macrophages in salient domain 1 and 5, colored by salient domains, leiden clusters, and slices. j, Expression level of M2-associated macrophage markers (Arg1, Hmox1, and Gpnmb) in inflammatory macrophages, showing elevated expression in salient domain 5. k, UMAP visualization showing MELD-estimated likelihood across inflammatory macrophages, where higher scores indicate stronger association with salient domain 5. l. Violin plot showing MELD likelihood distributions across Leiden clusters, illustrating the continuum and trajectory of inflammatory macrophage states and M2-like macrophages.
We identified diverse epithelial, stromal, and immune populations, including tumor-like AT2 cells, fibroblast subtypes, and multiple immune lineages (Fig. 5b). Stratifying samples by treatment revealed that vehicle- and MRTX1133-treated tumors shared broadly overlapping cellular distributions, confirming consistent capture of major cell types across conditions (Fig. 5b and Extended Data Fig. 4e). We next quantified treatment-associated shifts in cell composition to identify specific populations affected by KRAS inhibition. MRTX1133-treated tumors showed a marked expansion of alveolar type 1 (AT1) cells, endothelial capillaries, proliferating T cells, and pericytes, accompanied by a significant depletion of tumor EMT progenitors and ECM fibroblasts (Fig. 5c and Extended Data Fig. 4f). We also observed a trend toward reduced B cells and tumor-associated macrophages, although these changes did not reach statistical significance.
When designating MRTX1133-treated samples as controls and vehicle-treated samples as conditions, Haruka identified consistent background domains reflecting stable architecture and variant salient domains reflecting localized tumor heterogeneity (Fig. 5d–f and Extended Data Fig. 4g), except for regions dominated by KRAS/TP53 (KP) tumor epithelium, a hallmark of the TP53-deficient subtype. These results indicate that Haruka does not capture technical noise but instead reveals meaningful intra-condition heterogeneity, such as the localized emergence of KP tumor epithelium. We also found that salient domains 1 and 5 were enriched for inflammatory macrophages and TAMs (Fig. 5e–g). Clustering of macrophages within these domains revealed three states: inflammatory monocyte-derived TAMs (cluster 2), Gpnmb+ intermediates (cluster 0), and terminal Arg1+Hmox1+Gpnmb+ M2-like TAMs (cluster 4) (Fig. 5i–l). Haruka’s disentanglement of background and salient variation was essential for resolving these spatial trajectories which define domain-specific macrophage differentiation underlying immunosuppression (Extended Data Fig. 4h and Methods).
Thus, our trajectory analysis recapitulated a continuum from inflammatory precursors to immunosuppressive M2-like TAMs, consistent with macrophage education in KRAS/TP53 tumors. By disentangling salient from background variation, Haruka captured intra-condition spatial heterogeneity that defines remodeling of the immune microenvironment in KRAS/TP53-mutated tumors. These findings highlight Haruka’s ability to uncover cellular trajectories underlying macrophage education and identify spatially resolved mechanisms of myeloid-driven immunotherapy resistance within complex tumor ecosystems.
5. Haruka dissects the microenvironmental basis of KRAS inhibitor resistance in lung cancer
To further demonstrate Haruka’s versatility, we applied it to the same dataset in an inverse problem setting (Fig. 6a). Thus, we designated KRAS inhibitor-treated tumors as the condition and vehicle-treated tumors as the control to investigate mechanisms of KRAS inhibitor (KRASi) resistance in lung adenocarcinoma, with a focus on how spatially complex microenvironments shape treatment response even within the same cell type (Fig. 6b–c, Extended Data Fig. 5a and Methods).
Figure 6. Haruka dissects the microenvironmental basis of KRAS inhibitor resistance in lung cancer.

a, Schematic of the Haruka analysis pipeline for assessing spatially heterogeneous treatment responses to KRAS inhibition. Vehicle-treated tumors were designated as controls, and MRTX1133-treated tumors as the condition group. b, Spatial visualization of Haruka-derived background and salient domains across four MRTX1133-treated replicates, showing distinct domain-specific spatial organization. c, Cell type enrichment across salient domains, with dot size and color representing log-transformed fold change of enrichment significance. d-e, Distribution of pathway activity scores for the MAPK signaling and non–small-cell lung cancer pathways across salient domains, highlighting differential pathway activation patterns. f, Domain-specific colocalization enrichment map showing cell-cell proximity patterns in salient domain 0; higher enrichment values indicate stronger colocalization between corresponding cell-type pairs. g, Cell-cell communication network in salient domain 0 between proliferating T cells and regulatory T cells (Tregs), where arrows indicate ligand-receptor signaling direction. The outer ring color denotes the interacting cell types, while the inner ring color reflects the expression level of the corresponding ligand or receptor genes. h, Differential gene expression analysis of proliferating T cells in domain 0 compared with all other domains, revealing distinct transcriptional programs associated with resistant niches. The top five differentially expressed genes are highlighted. i, Gene Ontology (GO) enrichment analysis of downregulated genes in proliferating T cells within domain 0.
Because effective KRAS inhibition should suppress downstream MAPK signaling, we reasoned that elevated pathway activity would signify a reduced drug response. Comparative analysis revealed that salient domains 0, 2 and 6 maintained higher MAPK and lung cancer pathway activity than other domains, identifying them as potential resistant niches within the tumor microenvironment (Fig. 6d–e). When we examined the TME of each domain by comparing spatial colocalization enrichment against all other domains (Fig. 6f and Extended Data Fig. 5b), we found that Domain 0 exhibited strong colocalization of tumor epithelial cells with tumor EMT progenitors, ciliated epithelial cells, and proliferating T cells (uniquely enriched in domain 0, as Fig. 6c), suggesting an active proliferative and transitional niche (Fig. 6f). We also observed enrichment of Tregs near tumor and stromal elements and enhanced interactions consistent with angiogenic remodeling.
To characterize the immunoregulatory network of domain 0, we performed ligand-receptor analysis focused on proliferating T cells and Tregs (Methods). We revealed a dense adhesion- and trafficking-centered signaling module to support an immunosuppressive microenvironment (Fig. 6g). We found that Tregs contributed key ligands, including LGALS9, SELPLG, and TGFB1, while proliferating T cells expressed complementary receptors such as ITGB1/2, SELL, S1PR1, and CD2. Notably, integrin-mediated activation of latent TGF-β positions Tregs as a central source of TGF-β-driven immunosuppressive signaling22. These paired interactions form a bidirectional integrin-selectin and CD2-CD48 axis, coordinating T-cell retention, positioning, and contact-dependent regulation. Together, this creates a dense adhesion-migration-regulation circuit that stabilizes a spatially cohesive, TGF-β–driven immunosuppressive microenvironment.
To further dissect the transcriptional state of proliferating T cells in domain 0, we identified differentially expressed genes relative to all other domains. Many were downregulated, including key regulators of DNA replication and cell cycle progression (SSRP150, SAMHD151, and RANBP252, Fig. 6h). Gene ontology enrichment analysis revealed broad suppression of T cell receptor signaling, cell cycle transition, protein phosphorylation, and regulation of apoptotic processes (Fig. 6i). Despite their spatial abundance, proliferating T cells exhibit transcriptional repression of proliferative and effector programs, consistent with functional exhaustion and immune suppression within the resistant tumor microenvironment53.
In conclusion, Haruka revealed that KRASi resistance in lung adenocarcinoma emerges from spatially distinct microenvironments that couple proliferative tumor programs and vascular remodeling with coordinated myeloid-T-Treg suppression, while restraining T-cell effector potential. Thus, Haruka identifies these resistant architectures and their signaling features, thereby providing a framework for identifying therapeutic vulnerabilities within complex tumor ecosystems.
Discussion
This study presents spatial contrastive analysis, a computational framework for defining salient (condition-specific) and background (shared) spatial domains. Motivated by the rapid growth of large-scale spatial omics datasets spanning control and perturbed states, our approach addresses a central question in spatial biology: how do perturbations alter tissue architecture and what factors drive these changes.
In contrast to dissociated single-cell data, where each cell is analyzed in isolation, cellular responses within intact tissues are shaped by their spatial context. After a perturbation, a cell's molecular profile reflects both the direct influence of the perturbation and indirect influences from neighboring cells that have themselves been altered. This interdependence makes it nearly impossible to apply conventional single-cell methods, which lack spatial information, to accurately analyze and compare perturbation-induced changes. Understanding such interactions is critical for identifying spatial niches that influence outcomes such as immunotherapy response9, or the neurodegenerative processes in Alzheimer's-related diseases54.
Haruka, however, reframes this problem within the spatial contrastive analysis framework: it separates potential noisy variations induced by neighboring cells (but not by the perturbation itself). This approach forces the model to disentangle the salient part from the background, thereby extracting the changes introduced by the perturbation. Moreover, this approach can reveal perturbation-induced biological processes that are unidentifiable by previous methods. For instance, Haruka can help biologists capture subtle but crucial changes, such as a cell type without significant gene expression but with a completely different microenvironment, a common feature in neurodegeneration or aging processes7,54.
Furthermore, with advancements in current profiling techniques, the co-profiling of gene knockout and spatial transcriptomics are already yielding promising results55. Haruka can be applied to such datasets to handle complex data situations and decode more information about real tissue responses after gene knockout. Additionally, extending Haruka to integrate images from H&E-stained tissues holds promise for improving its performance in clinical pathology settings. Adopting this framework for applications involving continuous conditions (e.g., development, aging, and other temporal situations) instead of binary control conditions also presents a promising avenue for the Haruka framework.
In summary, Haruka provides a unified framework for analyzing multi-slice spatial omics datasets annotated with control and condition information. By defining salient and background spatial domains, it captures both perturbation-induced remodeling and conserved tissue architecture (e.g., brain sections or basic tissue components) across conditions. These representations enable diverse downstream analyses - such as differential cell-cell interactions, niche composition, and communication networks - like general spatial analysis pipelines but with explicit modeling of contrastive context.
As with other deep generative models, Haruka's computational framework depends on high-performance GPUs, which may limit scalability on CPU-only systems. Moreover, as an unsupervised method, biological interpretation still benefits from expert input for domain annotation. Future integration with Large Language Models (LLMs) could greatly enhance this step and has already demonstrated high potential for analyzing and annotating biological entities (given the same input as a human), due to their superior literature survey and inference capability. This integration could make a fully automated pipeline for spatial contrastive analysis possible in the future.
Methods
Haruka Details
Data preprocessing.
The input spatial omics dataset was represented as , where is the gene expression matrix for cells and genes, denotes the condition labels for each cell (), and represents the spatial coordinates of cells. Raw gene expression counts were used as input to fit the modeling of the prior gene likelihood distribution.
Covariance embedding construction.
Haruka adopts the COVET framework16 to encode the spatial niche of each cell. For each cell , the niche is defined as the nearest spatial neighbors based on Euclidean distance in the coordinate space . The gene expression matrix within the niche is denoted , where is the number of selected genes or proteins. To capture the local covariate structure, Haruka computes the shifted covariance matrix as:
where is the global mean expression vector across the entire dataset, following the shifted covariance approach in scenvi16. This global centering ensures that the covariance matrices for different cells are comparable, as they are all constructed relative to the same global mean. The matrix square root of , denoted , is computed via spectral decomposition. The square root matrix is then vectorized to produce the covariance embedding . This vector is concatenated with the original expression vector to form the augmented feature vector:
Latent variable modeling.
The model operates differently for control and condition groups, for condition group cells (), two latent variables are inferred: salient and background
For control group cells (), only the background latent variable is inferred:
Reconstruction loss.
Haruka jointly reconstructs gene/protein expression vector and the covariance embedding vector (derived from ). The reconstruction likelihood decomposes as:
where .denotes the corresponding latent variables.
For gene/protein expression :
- Spatial transcriptomics data: Modeled via a negative binomial distribution:
- Spatial proteomics data: Modeled via a Gaussian distribution:
For covariance embeddings .
-
Modeled via a Gaussian distribution over the matrix square root:where is the predicted mean of the reconstructed matrix square root, and the identity covariance reflects Euclidean space over matrix square roots. This Gaussian likelihood over aligns with the AOT metric formulation in scenvi, ensuring computational efficiency. The total reconstruction loss combines log-likelihoods of expression and covariance embeddings:
This formulation ensures Haruka reconstructs both the expression-level variations and the covariance structures (niche interactions), in accordance with scenvi's principled approach.
Contrastive alignment and optimization.
To ensure disentanglement between salient and background latent spaces, Haruka applies a Wasserstein penalty between background latent distributions of condition and control groups:
The total loss function is the evidence lower bound (ELBO), which includes the reconstruction of both gene/protein expression and covariance embeddings, combined with the Wasserstein penalty:
where is the regularization coefficient.
Spatial neighbor graph construction and latent feature aggregation.
Post-training, salient and background latent representations were extracted for target cells. For each tissue slice, a spatial neighbor graph was constructed using cell coordinates. Aggregated latent features across spatial layers were computed as:
where denotes the neighborhood of cell within layers.
Identification of spatial domains via Gaussian mixture modeling.
Aggregated salient latent representations and background latent representations were utilized to define salient spatial domains and background spatial domains, respectively. For each set of aggregated features, a Gaussian Mixture Model (GMM) clustering approach was applied to capture domain structures while modeling cluster-specific covariance:
Here, denotes either salient or background representations. represents the mixing proportion for the -th component, ensuring that denotes a multivariate normal distribution with mean and covariance . The number of clusters for salient domains and background domains was predefined (e.g., ) based on experimental design or model selection criteria. Cluster assignments were determined via maximum a posteriori (MAP) estimation:
In this context, and denote the salient and background spatial domain labels for cell , respectively.
Simulation Dataset and Benchmarking
Dataset Overview.
To systematically evaluate Haruka’s ability to detect condition-relevant spatial niches under diverse perturbation scenarios, we generated a series of synthetic spatial transcriptomics datasets based on real MERFISH mouse brain data56. The original MERFISH slices were used as the base scaffold. Three non-overlapping synthetic spatial domains, corresponding to circle, square, and triangle shapes, were embedded into the tissue space for each dataset. The domain regions covered approximately 5%, 15%, or 25% of the total area, enabling simulation of varying levels of perturbation severity.
Within each spatial domain, non-negative noise was added to the baseline gene expression matrix to simulate perturbation effects. Different Gamma-distributed noise patterns were assigned to each domain, with the circle region perturbed using a Gamma distribution with shape 1 and scale 0.15, the square region using Gamma with shape 1 and scale 0.1, and the triangle region using Gamma noise with shape values of 2, 4, or 6 and a scale of 0.2 across different simulation settings. By varying both the spatial area proportions and noise parameters, multiple simulated datasets were constructed representing distinct perturbation intensities. Each perturbed slice was paired with the corresponding unmodified control slice to form condition-control experimental pairs, with ground truth spatial region annotations recorded for evaluation.
Comparison Methods and Metrics.
The performance of Haruka was benchmarked against three baseline methods: ContrastiveVI15, CInema-OT17, and CellCharter14. To assess clustering accuracy, we computed the Adjusted Rand Index (ARI) and Normalized Mutual Information (NMI) between the detected salient clusters and the ground truth shape region labels. ARI measures the similarity between predicted clusters and true clusters, adjusting for random chance, and is particularly suitable for evaluating unsupervised clustering methods. Let be the total number of cells, the number of cells in both predicted cluster and true cluster the sum over row , and the sum over column in the contingency table:
NMI quantifies the mutual dependence between cluster assignments and ground truth, providing a normalized score that accounts for differences in cluster size. Let and be the sets of predicted and ground truth clusters, respectively, and let denote mutual information and denote their entropies:
where:
and
In addition to clustering accuracy, we evaluated the spatial coherence of the detected domains by computing CHAOS and PAS scores. CHAOS measures local spatial smoothness based on nearest-neighbor label consistency For each cluster , we compute the average pairwise Euclidean distance between all cells within the same cluster:
where denotes the spatial coordinates of cell and is the size of cluster .
While PAS captures global spatial autocorrelation of cluster labels.
Let be a cell with spatial neighbors , and its cluster label. PAS is defined as:
where is the indicator function and denotes the most frequent label among neighbors.
Lower CHAOS and PAS scores indicate better spatial continuity and less fragmentation. Together, these four metrics comprehensively evaluate both the correctness of salient cluster assignments and the preservation of underlying spatial structure.
Benchmarking on Mouse Brain Aging Dataset
Dataset Overview.
To further evaluate the performance of Haruka and baseline methods in real-world scenarios, we conducted benchmarking experiments on a large-scale spatial transcriptomics dataset profiling mouse brain aging7. Specifically, we utilized the spatial transcriptomic data generated in spatial aging clock dataset, which profiled the mouse brain across 20 different age points throughout the lifespan using MERFISH technology. For our benchmarking, we selected slices corresponding to embryonic day 3.4 (E3.4) and embryonic day 34.5 (E34.5) as the control and condition groups, respectively. This selection reflects early and mid-gestational brain developmental stages, allowing us to assess spatially driven aging responses under well-separated biological conditions.
Label generation of response heterogeneity.
We generated two types of ground-truth labels. Background domain labels were defined based on anatomical subregions annotated in the original study using an unbiased approach. These subregions, considered relatively unaffected by aging, were designated as background domains. Salient domain labels were derived from previously reported correlations between cell types and aging across different brain sections (CTX, STR, VEN, and CC/ACO), based on the full 20-timepoint aging timeline provided in the original study. For each brain section, we identified cell types that were significantly positively correlated with age (Pearson correlation > 0.4, p < 0.05), negatively correlated with age (Pearson correlation < −0.4, p < 0.05), or uncorrelated. This allowed us to define three salient categories per brain section—positive, negative, and uncorrelated—resulting in a total of 12 salient domains (3 per section × 4 sections). For background domains, we used the fine-grained anatomical annotations from the original study, which were generated in an unbiased manner and remained stable throughout the aging process. These subregions served as reliable indicators of the spatial background.
Comparison Methods and Metrics.
We adopted the same baseline methods used in the simulation benchmark—CellCharter, ContrastiveVI, and CINEMA-OT—with identical implementation pipelines, clustering algorithms (GMM), and target cluster numbers to ensure fair comparisons. For evaluation, we reported ARI and NMI metrics only, excluding spatial continuity metrics (CHAOS, PAS). This exclusion was motivated by the nature of our ground-truth domains, which include both spatially contiguous regions and small, spatially disconnected niches. These small niches are particularly important due to their difficulty of detection within the same anatomical subregions, and continuity-based metrics would undervalue their significance.
By using this biologically motivated, region-based ground truth and spatially relevant evaluation framework, we aimed to rigorously assess the ability of Haruka and comparative methods to capture salient spatial responses to aging in complex, heterogeneous brain tissue.
Haruka application on Melanoma Immunotherapy CODEX Dataset
Dataset Overview.
We applied Haruka to a human metastatic melanoma dataset comprising 12 FFPE tumor samples from six patients with Stage IV disease8. Patients received checkpoint inhibitor therapy, with samples harvested at pre-treatment (baseline) and post-treatment timepoints. Tumor tissues were profiled via CODEX multiplexed imaging (58-antibody panel), yielding 5,019,159 segmented cells across immune, stromal, and tumor compartments. In our experiment, we utilized unsupervised clustering to identify 39 major cell types, setting post-treatment as the condition sample and pre-treatment as the control group. In our experiment, we set post-treatment as the condition sample and pre-treatment as the control group
Integration of Salient Spatial Domains with scRNA-seq Using MaxFuse.
To explore downstream utility of Haruka’s salient spatial domains, we performed a cross-modality integration between protein-based spatial domains derived from CODEX imaging and unpaired single-cell RNA sequencing (scRNA-seq) profiles. Specifically, we aimed to assess whether Haruka-identified domains could act as spatial anchors to enrich scRNA-seq data with spatial context and uncover gene expression programs associated with immunotherapy outcomes in melanoma.
We first identified salient domains in CODEX data using Haruka. Among these, salient domain 4 was significantly enriched in samples with no objective response rate to immunotherapy. We thus designated this as the immunotherapy-resistant reference domain. Cells assigned to this domain were used as the “reference anchor” for downstream MaxFuse integration.
To link unpaired scRNA-seq data with this CODEX-defined spatial anchor, we employed MaxFuse57, a modality-agnostic matching algorithm that iteratively aligns two datasets using both cell-cell similarity and cross-modality feature correlation. The scRNA-seq data consisted of a post-immunotherapy melanoma dataset profiling T cell population. We performed feature preprocessing separately for each modality: the CODEX protein panel was normalized via arcsinh transformation, while scRNA-seq gene expression matrices were log-normalized and filtered to retain highly variable genes overlapping with markers in the CODEX panel. The integration was performed with MaxFuse’s default pipeline, which iteratively refines cross-modal similarity through canonical correlation analysis (CCA)-based latent space alignment, followed by nearest neighbor bipartite matching and denoising propagation.
From this process, we obtained one-to-one correspondences between scRNA-seq cells and Haruka/CODEX-defined spatial regions. In particular, scRNA-seq cells matched to salient domain 4 were labeled as “poor immunotherapy responders,” and the rest were considered the control group. We restricted the analysis to CD8+ T cells, based on scRNA-seq cell type annotation, and investigated transcriptional differences between these two subgroups.
Differential Expression and Gene Set Enrichment Analysis.
To characterize molecular signatures associated with immunotherapy resistance, we performed differential gene expression (DE) analysis between the CD8+ T cells assigned to the non-responder salient domain and the remaining CD8+ T cells. The DE was performed using a Wilcoxon rank-sum test implemented in Scanpy, with Benjamini–Hochberg correction applied to control false discovery rate. Genes with adjusted p-value < 0.05 and |log2 fold change| > 0.25 were retained for downstream enrichment. We then conducted Gene Set Enrichment Analysis (GSEA) on the ranked DE gene list using the gseapy implementation with the GO Biological Process database. We used adjusted p-value < 0.05 as cutoff for significant ones.
Multimodal Association Analysis.
To quantify the cross-modality association between a protein marker and a matched gene expression profile , we computed their Pearson correlation coefficient across aligned cells in a given spatial domain. Let denote the protein intensity vector across CODEX cells, and the RNA expression vector across the matched scRNA-seq cells. The correlation is defined as:
where is the covariance between protein and gene signals, and are the standard deviations of and , respectively.
This metric reflects the strength of linear association between CODEX protein signals and RNA expression patterns within aligned spatial domains, with values ranging from −1 (perfect negative correlation) to 1 (perfect positive correlation).
Haruka application on Lung Fibrosis Xenium Dataset
Dataset Overview.
We analyzed spatial transcriptomics data from 45 human lung samples45 (26 pulmonary fibrosis, 9 healthy controls) using the Xenium platform with a 343-gene panel. The dataset included 1.6 million cells, annotated into 12 spatial niches (C1-C12) reflecting fibrotic, inflammatory, and epithelial regions.
Alignment Benchmarking with SLAT Using Haruka-Derived Representations.
To evaluate the fidelity of spatial alignment across fibrotic progression, we applied SLAT, a spatial domain alignment method, to paired tissue slices representing less affected and more affected fibrotic states from a human lung fibrosis spatial transcriptomics dataset. These samples were drawn from a publicly available Xenium-based spatial profiling study, where histopathological assessment had previously stratified regions according to the severity of fibrosis. The evaluation focused on whether Haruka’s learned background domain representations—designed to isolate stable, condition-invariant features—could enhance alignment across varying tissue conditions.
We used two types of input representations for SLAT43: the original gene expression matrices and Haruka-derived background domain embeddings. The background embeddings were obtained through Haruka’s contrastive variational inference framework, which is trained to separate shared, condition-invariant structure from perturbation-specific effects by learning latent representations that reflect stable spatial context. Specifically, Haruka learns background latent solely from control (less affected) conditions, thus retaining architectural consistency while removing condition-induced gene expression variation.
SLAT was then run independently on each pair of slices, once with the original gene expression data and once with the Haruka background representations. Its alignment procedure incorporates both spatial proximity and transcriptomic similarity using a graph-based latent optimization framework, resulting in slice-to-slice alignment of spatial domains. To benchmark alignment quality, we used CNiche domain annotations from the original study as unbiased ground truth references for architectural domains. The performance was quantified using two metrics, F1-score and accuracy.
Formally, Let and denote two spatial transcriptomics slices (e.g., less affected and more affected tissue sections), containing and cells, respectively. Each cell is represented by a feature vector—either the original gene expression or a lower-dimensional embedding (e.g., Haruka background representation).
The SLAT model takes the two slices and outputs a matching matrix
where
indicates that cell in slice is matched to cell in slice .
Each row of contains exactly one non-zero entry, corresponding to the one-to-one matched reference cell.
Let be the ground truth CNiche domain labels for slice .
Using the matching matrix , we define the predicted label for each cell in by propagating the label of its matched counterpart:
This allows us to assign predicted CNiche labels to all cells in the target slice .
To evaluate alignment quality, we compare the predicted labels to the ground truth labels from the original annotation of .
We here utilize three metrics to evaluate the match situation between predicted labels to the ground truth labels . The micro-averaged F1-score is computed globally by counting the total true positives (TP), false positives (FP), and false negatives (FN) across all CNiches by the matched cell CNchihe as prediction and ground truth CNiche as labels:
The macro-averaged F1-score is calculated by first computing the F1-score for each class independently and then taking their unweighted average:
Where is the number of CNiche classes.
Accuracy quantifies the overall proportion of correctly matched cells among all cells:
Where is the total number of cells s and refers to the number of correctly matched cells for CNiche .
Cell State Transition Stratification.
Beyond evaluating alignment performance, we sought to leverage Haruka-SLAT alignment to dissect early molecular events that occur during fibroblast transition in fibrosis. Using aligned slices in the Haruka background space, we identified matched pairs of alveolar fibroblasts (Alv-FBs) between less affected and more affected conditions. In the less affected slice, Alv-FBs were then stratified based on whether their SLAT-aligned counterparts in the more affected slice retained an alveolar identity or had transitioned into an activated fibrotic state. This matching defined two subpopulations within the phenotypically similar Alv-FBs in the less affected tissue: one maintaining a stable identity and one primed for activation. Despite similar spatial localization and cell-type identity, the primed subgroup exhibited gene expression features suggestive of early transition toward fibrotic activation. This observation was leveraged to explore pre-fibrotic transcriptional signatures that might serve as early indicators of disease trajectory.
Differential Expression and Gene Ontology Analysis.
To identify early molecular changes predictive of fibroblast activation, we performed differential gene expression analysis between the stable and primed Alv-FB subgroups using the Wilcoxon rank-sum test. Genes with a Benjamini–Hochberg corrected p-value below 0.05 and an absolute log2 fold change greater than 0.25 were considered significant. The resulting gene list was subjected to Gene Ontology enrichment analysis using the Enrichr58,59 module from the gseapy package. Enriched biological processes in the primed population included extracellular matrix organization, cytoskeletal remodeling, and cell adhesion—processes closely linked to early fibroblast activation and fibrogenesis. These results suggest that even in structurally preserved regions, Haruka’s background-based matching can reveal molecular precursors of pathogenic state transitions.
Haruka analysis of KRAS-inhibitor Xenium 5K dataset
Mouse Model and Ethics Statement.
All animal experiments were performed in accordance with institutional guidelines and approved by the Committee on Animal Care (IACUC for MIT and Whitehead Institute). Mice were housed in the Whitehead Institute Animal Facility under a 12-hour light/dark cycle with ad libitum access to food and water. C57BL/6J Albino (Jackson Labs strain #000058) female mice aged 8 weeks were used for experimentation.
Tumor Cell Preparation and Engraftment.
A murine KRASG12D-mutant lung adenocarcinoma cell line (KP1233, provided as a gift from Dr. Tyler Jacks’ lab, Koch Institute for Integrative Cancer Research at MIT) was cultured in 1X DMEM (ThermoFisher Gibco™ Cat#13345364) supplemented with 10% heat-inactivated (56°C for 30min) ultra-low IgG FBS (ThermoFisher Gibco™ Cat# 16250078) under standard conditions (37°C, 5% CO2). Cells were tested for individual murine pathogens (IMPACT I, Corynebacterium bovis, Mycoplasma pulmonis). Cells were harvested at ~70–80% confluency using TrypLE Express (ThermoFisher), washed with complete media, and resuspended in PBS at a final concentration of 1 × 10^6 cells per 100 μL. For establishment of lung metastases, mice were injected via the lateral tail vein with 100 μL of the tumor cell suspension. Mice were monitored daily for signs of distress and body weight changes.
Treatment.
Seven days post-injection, after confirmation of tumor establishment (based on prior model optimization), mice were randomized into two treatment groups: vehicle control (formulation matching MRTX1133 vehicle); MRTX1133 (KRAS G12D inhibitor; MedChemExpress Cat# HY-134813; dissolved in 10% Captisol and 50mM citrate buffer pH 5.0). MRTX1133 or vehicle was administered by intraperitoneal injection once daily for 5 consecutive days at a dose of 30 mg/kg, as described in Hallin et. al60.
Tissue Collection, Processing and Xenium Experiment.
At the experimental endpoint (day 21 post-injection), mice were euthanized by CO2 inhalation followed by cervical dislocation. Lungs were dissected, visually inspected for tumor burden, and processed. The lung tissues were inflated with fixative (10% formalin) and processed according to the manufacturer’s protocol for the Xenium In Situ platform (10x Genomics). Samples were embedded, sectioned, and mounted such that each slide contained 4 distinct tumor-bearing lung samples from individual mice (n = 4 biological replicates per condition). For spatial profiling, each condition was assigned to a single Xenium slide containing multiple lung samples from different mice. All sample processing and library preparation were performed in parallel to minimize batch effects.
Data Generation Procedure and Preprocessing.
Raw Xenium outputs were processed using the Xenium Onboard Analysis (XOA) pipeline (10x Genomics), which performs image alignment, spot detection, molecule calling, and cell segmentation based on integrated nuclear and membrane stains. Segmentation-derived cell boundaries were quality-checked to remove artifacts, doublets, and low-confidence cells. Gene count matrices were then aggregated across individual lung samples and converted into an AnnData object for downstream analyses. To harmonize data across slides and biological replicates, we applied per-cell quality control filters, excluding cells with extremely low molecule counts (< 50) or high mitochondrial read fractions (> 5%)61,62. Gene expression matrices were normalized to account for sequencing depth, followed by log-transformation. For visualization and exploratory analyses, we generated low-dimensional embeddings using principal component analysis (PCA) and Uniform Manifold Approximation and Projection (UMAP).
Cell Type Annotation.
Following dimensionality reduction, we performed unsupervised clustering using the Leiden algorithm on the neighborhood graph computed from the top 40 principal components (Scanpy’s sc.pp.neighbors, sc.tl.leiden, resolution = 0.6 unless otherwise specified). The resulting clusters were visualized using UMAP and inspected for biological coherence based on known cell type markers. To annotate clusters, we identified differentially expressed genes (DEGs) using the rank_genes_groups function in Scanpy with the Wilcoxon rank-sum test. For each cluster, we extracted the top 50 marker genes and compared them to canonical cell type markers from both lung and immune cell atlases as well as prior publications on KRAS-driven lung cancer models. To resolve T cell heterogeneity, we applied additional Leiden clustering within the T cell compartment to identify finer subtypes. Final cell type annotations were determined by integrating clustering results, marker gene enrichment, and prior biological knowledge. Populations with ambiguous or transitional features (e.g., tumor-associated fibroblasts, proliferative immune cells) were annotated using descriptive qualifiers to reflect their functional or spatial context.
Pathway Activity Score Calculation.
We calculated the pathway activity score for cells annotated as tumor cells (“Tumor EMT Progenitor,” “AT2 TumorLike”) using the drug2cell package. The drug2cell58 package accepts whole gene expression as input and calculates the activity score for a given gene set in each individual cell (a higher score indicates higher gene set activity in that cell). We utilized the KEGG “Non-small cell lung cancer” and “MAPK signaling pathway” as input gene sets for the drug2cell score calculation. We performed this analysis only on tumor cells to eliminate noise from other cell types.
Cell-Cell Communication Analysis.
We utilized the LIANA63 package with the CellPhoneDB64 database for the cell types Treg, and Proliferating T cells within salient domain 0. LIANA infers cell-cell communication by calculating the mean ligand and receptor gene expression values for each group based on the input data. We used the full panel gene expression as input and selected the top 30 ligand-receptor (LR) pairs for downstream analysis. We used CCPlotR65 for visualization.
Leiden Cluster and PAGA Trajectory Inference.
We clustered inflammatory macrophages in both salient domains 0 and 5 using Leiden clustering at a resolution of 0.5. The clustering was performed with neighbor graphs constructed from the original gene expression-derived PCA. Following clustering, we applied scanpy.tl.paga to analyze per-cluster connectivity. Higher connectivity in the PAGA66 results indicates a higher transition probability between two Leiden clusters. For macrophage subtype annotation, we used the scanpy.pl.rank_genes_groups function with a rank-sum test to extract the top 20 markers per Leiden cluster, which were then used to re-annotate them into different subtypes.
Differential Abundance Analysis.
Differential abundance (DA) aims to identify condition-group-enriched subpopulations in single-cell datasets when compared to control groups. In our setting, we used the same cells as in the previous Leiden and PAGA analysis. Salient domain 5 was set as the condition group, and salient domain 0 as the control group. We then utilized MELD67, a density estimation-based method, to estimate the condition-related likelihood value for each cell in these two conditions. The full gene panel was used as input, and PCA served as the input embedding for MELD. Higher MELD density values indicate greater relevance to the condition (salient domain 5), while lower values indicate greater relevance to the control (salient domain 0).
Computational Resource
All experiments were performed on a server running Ubuntu 20.04 with a 72-core Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz and an Nvidia A100 (80 G) GPU.
Extended Data
Extended Data Figure 1. Semi-simulation benchmarking results of Haruka with other comparative methods.

Visualization of the ground truth salient and background spatial domains, and the results from Haruka alongside comparison methods (ContrastiveVI, CellCharter, and CINEMA-OT) across different simulated salient shifts (Poisson signal parameter (alpha=2,4,6) and domain area proportion (0.1, 0.15, 0.2)).
Extended Data Figure 2. Application of Haruka to the CODEX melanoma immunotherapy dataset.

a, Spatial visualization of annotated cell types, cell neighborhoods, and Haruka-derived background and salient spatial domains across all samples. b, Proportion of salient domains in responder and non-responder groups, showing that salient domains 1 and 3 are predominantly enriched in non-responders.
Extended Data Figure 3. Application of Haruka to the human lung fibrosis 10x Xenium dataset.

a, Cell niche, transcript niche and cell type enrichment across background spatial domains. Dot size and color denote the log-transformed fold change reflecting enrichment significance. b, Cell niche, transcript niche and cell type enrichment across salient spatial domains. Dot size and color denote the log-transformed fold change reflecting enrichment significance.
Extended Data Figure 4. Spatial transcriptomics data processing and application of Haruka in KRASG12D-mutated lung cancer.

a, Distribution of total transcript counts and number of detected genes per cell in the Xenium dataset. b-c, UMAP visualization of major cell type annotations and their distribution across individual samples. d, Top three marker genes identified for each major cell type. e, Proportions of cell types across all samples. f, Comparison of cell type proportions between vehicle- and MRTX1133-treated tumors (n = 4 replicates per group). P-values were calculated using the Wilcoxon rank-sum test. g, Cell type proportions across salient domains in vehicle-treated samples, shown per individual tissue slice. h, PAGA trajectory inference of inflammatory macrophages in salient domains 1 and 5, highlighting potential state transitions between Leiden clusters. The width of each edge reflects the PAGA-inferred connectivity strength (transition probability); wider edges indicate stronger evidence of a transition between clusters.
Extended Data Figure 5. Application of Haruka to investigate the microenvironmental basis of KRAS inhibitor resistance.

a, Cell type enrichment across background domains, with dot size and color representing log-transformed fold change of enrichment significance. b, Domain-specific colocalization enrichment map showing cell-cell proximity patterns in salient domains; higher enrichment values indicate stronger colocalization between corresponding cell-type pairs.
Acknowledgements
We thank the Whitehead Institute Animal Facility for expert assistance with mouse husbandry and for maintaining high-quality experimental conditions. We are grateful to the Broad Institute’s Spatial Technology Platform for support with spatial transcriptomics experiments. This work was supported by the Whitehead Institute and the Whitehead Innovation Initiative. N.S. is supported by the Whitehead Institute Fellows Program and the Whitehead Innovation Initiative. K.W. is supported by the Valhalla Foundation, AACR-AstraZeneca Career Development Award for Physician-Scientists in Honor of José Baselga, an anonymous grant, Richard Reisman in honor of Jane Reisman and Lilian Reisman, Department of Defense (W81XWH2210141), National Cancer Institute (R01CA279259), the Research Foundation for the Treatment of Ovarian Cancer, ALK Positive Lung Cancer Foundation, and Torrey Coast Foundation. The content of this manuscript is solely the responsibility of the authors and does not necessarily represent the official views of the NIH or other funding agencies.
Footnotes
Competing interest
K.W. has filed US patent applications related to novel therapies for cancer that are not directly related to this work. KW reports patents/royalties (Stanford University, Whitehead Institute, Forty Seven, Gilead Sciences, ALX Oncology, DEM Biopharma); co-founder, past or present scientific advisory board member, and equity holder (ALX Oncology, DEM Biopharma, Solu Therapeutics), stock ownership (Ginkgo Bioworks). The other authors declare no competing interests.
Data Availability
MERFISH mouse brain aging data can be downloaded from https://zenodo.org/records/13883177. The CODEX melanoma immunotherapy dataset is available at https://datadryad.org/dataset/doi:10.5061/dryad.k0p2ngfcc. The Xenium lung fibrosis dataset can be accessed through GEO (GSE250346). The KRAS inhibitor Xenium cancer dataset will be made available upon publication.
Code Availability
All code required to reproduce the figures, results, and tutorials is publicly available at https://github.com/nasunlab/Haruka.
Reference
- 1.Moffitt J. R. & Zhuang X. RNA imaging with multiplexed error-robust fluorescence in situ hybridization (MERFISH). Methods Enzymol. 572, 1–49 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Eng C.-H. L. et al. Transcriptome-scale super-resolved imaging in tissues by RNA seqFISH. Nature 568, 235–239 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Rodriques S. G. et al. Slide-seq: A scalable technology for measuring genome-wide expression at high spatial resolution. Science 363, 1463–1467 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Goltsev Y. et al. Deep Profiling of Mouse Splenic Architecture with CODEX Multiplexed Imaging. Cell 174, 968–981.e15 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Chang Q. et al. Imaging Mass Cytometry. Cytometry Part A 91, 160–169 (2017). [DOI] [PubMed] [Google Scholar]
- 6.Qian X. et al. Spatial transcriptomics reveals human cortical layer and area specification. Nature 644, 153–163 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Sun E. D. et al. Spatial transcriptomic clocks reveal cell proximity effects in brain ageing. Nature 638, 160–171 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Hickey J. W. et al. T cell-mediated curation and restructuring of tumor tissue coordinates an effective immune response. Cell Rep 42, 113494 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Wang X. Q. et al. Spatial predictors of immunotherapy response in triple-negative breast cancer. Nature 621, 868–876 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Shiao S. L. et al. Single-cell and spatial profiling identify three response trajectories to pembrolizumab and radiation therapy in triple negative breast cancer. Cancer Cell 42, 70–84.e8 (2024). [DOI] [PubMed] [Google Scholar]
- 11.Schürch C. M. et al. Coordinated cellular neighborhoods orchestrate antitumoral immunity at the colorectal cancer invasive front. Cell 182, 1341–1359.e19 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Abid A. & Zou J. Contrastive Variational Autoencoder Enhances Salient Features. (2019).
- 13.James C. Contrastive Analysis. (1980).
- 14.Varrone M., Tavernari D., Santamaria-Martínez A., Walsh L. A. & Ciriello G. CellCharter reveals spatial cell niches associated with tissue remodeling and cell plasticity. Nat Genet 56, 74–84 (2024). [DOI] [PubMed] [Google Scholar]
- 15.Weinberger E., Lin C. & Lee S.-I. Isolating salient variations of interest in single-cell data with contrastiveVI. Nat Methods 20, 1336–1345 (2023). [DOI] [PubMed] [Google Scholar]
- 16.Haviv D. et al. The covariance environment defines cellular niches for spatial inference. Nat. Biotechnol. 43, 269–280 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Dong M. et al. Causal identification of single-cell experimental perturbation effects with CINEMA-OT. Nat Methods 20, 1769–1779 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Siddiqui I. et al. Intratumoral Tcf1PD-1CD8 T Cells with Stem-like Properties Promote Tumor Control in Response to Vaccination and Checkpoint Blockade Immunotherapy. Immunity 50, 195–211.e10 (2019). [DOI] [PubMed] [Google Scholar]
- 19.De León-Rodríguez S. G. et al. TCF1-positive and TCF1-negative TRM CD8 T cell subsets and cDC1s orchestrate melanoma protection and immunotherapy response. J Immunother Cancer 12, (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Di Pietro A. et al. Abstract A006: Tissue resident memory (TRM) T cells and dendritic cells form an in situ archetype for improved response to immune checkpoint therapy in metastatic melanoma. Cancer Immunol Res 12, A006–A006 (2024). [Google Scholar]
- 21.Treg Cells Promote the SREBP1-Dependent Metabolic Fitness of Tumor-Promoting Macrophages via Repression of CD8+ T Cell-Derived Interferon-γ. Immunity 51, 381–397.e6 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Mariathasan S. et al. TGFβ attenuates tumour response to PD-L1 blockade by contributing to exclusion of T cells. Nature 554, 544–548 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Kieffer Y. et al. Single-Cell Analysis Reveals Fibroblast Clusters Linked to Immunotherapy Resistance in Cancer. Cancer Discov 10, 1330–1351 (2020). [DOI] [PubMed] [Google Scholar]
- 24.Combes A. J. et al. Discovering dominant tumor immune archetypes in a pan-cancer census. Cell 185, 184–203.e19 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Cao J. et al. Oncofetal reprogramming in tumor development and progression: novel insights into cancer therapy. MedComm 4, e427 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Varayathu H., Sarathy V., Thomas B. E., Mufti S. S. & Naik R. Combination Strategies to Augment Immune Check Point Inhibitors Efficacy - Implications for Translational Research. Front. Oncol. 11, 559161 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Gondal M. N., Cieslik M. & Chinnaiyan A. M. Integrated cancer cell-specific single-cell RNA-seq datasets of immune checkpoint blockade-treated patients. Sci Data 12, 139 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Chen S. et al. Integration of spatial and single-cell data across modalities with weakly linked features. Nat Biotechnol 42, 1096–1106 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Miao S., Rodriguez B. L. & Gibbons D. L. The Multifaceted Role of Neutrophils in NSCLC in the Era of Immune Checkpoint Inhibitors. Cancers 16, 2507 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Awasthi D. & Sarode A. Neutrophils at the Crossroads: Unraveling the Multifaceted Role in the Tumor Microenvironment. Int J Mol Sci 25, (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Singel K. L. et al. Mature neutrophils suppress T cell immunity in ovarian cancer microenvironment. JCI Insight 4, (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Faget J., Peters S., Quantin X., Meylan E. & Bonnefoy N. Neutrophils in the era of immune checkpoint blockade. J Immunother Cancer 9, (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Angioni R., Sánchez-Rodríguez R., Viola A. & Molon B. TGF-β in Cancer: Metabolic Driver of the Tolerogenic Crosstalk in the Tumor Microenvironment. Cancers 13, 401 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Salmond R. J. Regulation of T Cell Activation and Metabolism by Transforming Growth Factor-Beta. Biology 12, 297 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Heintzman D. R., Fisher E. L. & Rathmell J. C. Microenvironmental influences on T cell immunity in cancer and inflammation. Cellular & Molecular Immunology 19, 316–326 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Jiang Y., Li Y. & Zhu B. T-cell exhaustion in the tumor microenvironment. Cell Death & Disease 6, e1792–e1792 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Tauriello D. V. F., Sancho E. & Batlle E. Overcoming TGFβ-mediated immune evasion in cancer. Nature Reviews Cancer 22, 25–44 (2021). [DOI] [PubMed] [Google Scholar]
- 38.Chen D., Zhang X., Li Z. & Zhu B. Metabolic regulatory crosstalk between tumor microenvironment and tumor-associated macrophages. Theranostics 11, 1016–1030 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Zhao F. et al. LINC01004-SPI1 axis-activated SIGLEC9 in tumor-associated macrophages induces radioresistance and the formation of immunosuppressive tumor microenvironment in esophageal squamous cell carcinoma. Cancer Immunology, Immunotherapy 72, 1835–1851 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Chen Q. et al. Dynamic change in Siglec-15 expression in peritumoral macrophages confers an immunosuppressive microenvironment and poor outcome in glioma. Front. Immunol. 14, 1159085 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.Rakina M., Larionova I. & Kzhyshkowska J. Macrophage diversity in human cancers: New insight provided by single-cell resolution and spatial context. Heliyon 10, e28332 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 42.Vannan A. et al. Spatial transcriptomics identifies molecular niche dysregulation associated with distal lung remodeling in pulmonary fibrosis. Nat. Genet. 57, 647–658 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Xia C.-R., Cao Z.-J., Tu X.-M. & Gao G. Spatial-linked alignment tool (SLAT) for aligning heterogenous slices. Nat Commun 14, 7236 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Tsukui T. et al. Collagen-producing lung cell atlas identifies multiple subsets with distinct localization and relevance to fibrosis. Nature Communications 11, 1–16 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45.Habermann A. C. et al. Single-cell RNA sequencing reveals profibrotic roles of distinct epithelial and mesenchymal lineages in pulmonary fibrosis. Science Advances (2020) doi: 10.1126/sciadv.aba1972. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Liu X. et al. Multiple Fibroblast Subtypes Contribute to Matrix Deposition in Pulmonary Fibrosis. American Journal of Respiratory Cell and Molecular Biology (2023) doi: 10.1165/rcmb.2022-0292OC. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Lau A. P. Y., Khavkine Binstock S. S. & Thu K. L. CD47: The Next Frontier in Immune Checkpoint Blockade for Non-Small Cell Lung Cancer. Cancers (Basel) 15, (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Dehmani S. et al. SIRPγ-CD47 Interaction Positively Regulates the Activation of Human T Cells in Situation of Chronic Stimulation. Front Immunol 12, 732530 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.de Streel G. & Lucas S. Targeting immunosuppression by TGF-β1 for cancer immunotherapy. Biochem Pharmacol 192, 114697 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 50.Marcianò G. et al. Structure-specific recognition protein-1 (SSRP1) is an elongated homodimer that binds histones. J Biol Chem 293, 10071–10083 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Ballana E. & Esté J. A. SAMHD1: at the crossroads of cell proliferation, immune responses, and virus restriction. Trends Microbiol 23, 680–692 (2015). [DOI] [PubMed] [Google Scholar]
- 52.Hashizume C., Kobayashi A. & Wong R. W. Down-modulation of nucleoporin RanBP2/Nup358 impaired chromosomal alignment and induced mitotic catastrophe. Cell Death Dis 4, e854 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 53.Arner E. N. & Rathmell J. C. Metabolic programming and immune suppression in the tumor microenvironment. Cancer Cell 41, 421–433 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 54.Zeng H. et al. Integrative in situ mapping of single-cell transcriptional states and tissue histopathology in a mouse model of Alzheimer’s disease. Nat. Neurosci. 26, 430–446 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55.Saunders R. A. et al. Perturb-Multimodal: A platform for pooled genetic screens with imaging and sequencing in intact mammalian tissue. Cell 0, (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 56.Moffitt J. R. et al. Molecular, spatial, and functional single-cell profiling of the hypothalamic preoptic region. Science 362, (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 57.MaxFuse enables data integration across weakly linked spatial and single-cell modalities. Nat Biotechnol 42, 1036–1037 (2024). [DOI] [PubMed] [Google Scholar]
- 58.Kanemaru K. et al. Spatially resolved multiomics of human cardiac niches. Nature 619, 801–810 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59.Xie Z. et al. Gene Set Knowledge Discovery with Enrichr. Current Protocols 1, e90 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60.Hallin J. et al. Anti-tumor efficacy of a potent and selective non-covalent KRAS inhibitor. Nat Med 28, 2171–2182 (2022). [DOI] [PubMed] [Google Scholar]
- 61.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]
- 62.Palla G. et al. Squidpy: a scalable framework for spatial omics analysis. Nat Methods 19, 171–178 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 63.Dimitrov D. et al. Comparison of methods and resources for cell-cell communication inference from single-cell RNA-Seq data. Nature Communications 13, 1–13 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 64.Efremova M., Vento-Tormo M., Teichmann S. A. & Vento-Tormo R. CellPhoneDB: inferring cell-cell communication from combined expression of multi-subunit ligand-receptor complexes. Nat Protoc 15, 1484–1506 (2020). [DOI] [PubMed] [Google Scholar]
- 65.Ennis S., Ó Broin P. & Szegezdi E. CCPlotR: an R package for the visualization of cell-cell interactions. Bioinform Adv 3, vbad130 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 66.Wolf F. A. et al. PAGA: graph abstraction reconciles clustering with trajectory inference through a topology preserving map of single cells. Genome Biol 20, 59 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 67.Burkhardt D. B. et al. Quantifying the effect of experimental perturbations at single-cell resolution. Nat. Biotechnol. 39, 619–629 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
MERFISH mouse brain aging data can be downloaded from https://zenodo.org/records/13883177. The CODEX melanoma immunotherapy dataset is available at https://datadryad.org/dataset/doi:10.5061/dryad.k0p2ngfcc. The Xenium lung fibrosis dataset can be accessed through GEO (GSE250346). The KRAS inhibitor Xenium cancer dataset will be made available upon publication.
All code required to reproduce the figures, results, and tutorials is publicly available at https://github.com/nasunlab/Haruka.
