New Algorithm Maps Complex Tissue Microenvironments With Single-Cell Precision
By integrating cell type composition into spatial graphs, a new computational tool uncovers hidden subdomains in brain and cancer tissues.
A new computational method named CASTLE helps scientists map the microscopic architecture of tissues by integrating spatial gene expression data with cell type information, overcoming a long-standing challenge in spatial biology.
How Cell Type Awareness Sharpens Tissue Boundaries
Spatially resolved transcriptomics allows researchers to measure gene activity within tissues while keeping the physical location of cells intact. A central step in analyzing these datasets is spatial clustering, which groups neighboring cells or measurement spots into distinct regions, such as cortical layers in the brain or specific tumor microenvironments in cancer. Many existing graph-based methods rely only on physical proximity to build networks of neighboring cells, which can blur sharp boundaries where different tissue compartments meet. To solve this, a team of researchers developed CASTLE, short for Cell-type Aware SpaTial domain detection via contrastive Learning Embedding.
The method is described in a study published in PLOS Genetics by Lai Wei, Aoqi Xie, and Yuehua Cui from Michigan State University. Instead of relying purely on spatial distance, CASTLE builds a biologically informed network by combining physical coordinates with cell type compositions derived from deconvolution techniques or direct single-cell annotations. When cell type labels are missing, the algorithm falls back on gene expression similarity to maintain robust performance across different types of experimental platforms.
Testing Performance Across Diverse Tissues and Platforms
The authors evaluated CASTLE against nine other computational methods using datasets from various technologies, including 10x Visium, MERFISH, STARmap, Stereo-seq, and Slide-seqV2. Across 12 sections of the human dorsolateral prefrontal cortex, CASTLE achieved the highest median Adjusted Rand Index, a statistical measure of agreement with expert annotations, and showed lower variability across samples than competing approaches. In mouse main olfactory bulb data, the algorithm accurately separated concentric layers, such as the granule cell layer and the rostral migratory stream, which were frequently conflated by other tools.

When applied to human breast cancer tissue, CASTLE not only recovered broad architectural regions like invasive ductal carcinoma and ductal carcinoma in situ, but also uncovered functionally distinct subdomains within those categories. Pathway enrichment analyses revealed that these subdomains reflected underlying biological differences, such as extracellular matrix remodeling, oxidative phosphorylation, and translation control programs.
Limitations and Future Directions
Despite its strong performance, the authors note several limitations. The current framework assumes that tissue domains are reflected in local cell type composition, meaning it may provide less benefit in tissues where boundaries are driven strictly by subtle transcriptional states rather than cellular mixing. Furthermore, inaccuracies in upstream cell type deconvolution or annotation can propagate into the graph construction step and influence final clustering outcomes. Future improvements could incorporate histology images, uncertainty estimates, and multi-slice batch integration to further enhance spatial domain mapping.
The research was published in PLOS Genetics on November 17, 2026.
This article has been fact checked for accuracy, with information verified against reputable sources. Learn more about us and our editorial process.
Last reviewed on .
Article history
- Latest version
Cite this page:
- Posted by Elizabeth Taylor