bioRxiv · 10.64898/2026.02.12.705478
CASTLE: Cell-type Aware SpaTial domain detection via contrastive Learning Embedding
Abstract
With advances in spatially resolved transcriptomics across platforms and resolutions, it is now possible to measure gene-expression profiles while preserving the tissue microenvironment. Spatial clustering is central to these analyses, and recent graph neural network (GNN)-based approaches have greatly improved their accuracy. Nevertheless, precisely delineating spatial domain boundaries remains a significant challenge. Here we present a novel method CASTLE (Cell-type Aware SpaTial domain detection via contrastive Learning Embedding) by leveraging cell type information for improved spatial domain detection. CASTLE first integrates spatial proximity to construct a spatial graph, refined from cell-type similarity or expression similarity when cell type information is unavailable. Then, a self-supervised, local-context contrastive objective aligns embeddings with their immediate microenvironments. Evaluated across multiple tissues and technology resolutions, CASTLE outperforms state-of-the-art methods and detects more accurate and stable spatial domains. In downstream analyses, it resolves fine-grained tissue structures and differentiates functional subtypes, supporting more nuanced biological interpretation.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Xie, A., Cui, Y.. 2026-02-13. CASTLE: Cell-type Aware SpaTial domain detection via contrastive Learning Embedding. https://doi.org/10.64898/2026.02.12.705478
Cite the original work for its findings. Save a collection to share your selection of sources.