Spatially resolved transcriptomics technologies provide high-throughput measurements of gene expression in a tissue slice, but the sparsity of these data complicates analysis of spatial gene expression patterns. We address this issue by deriving a topographic map of a tissue slice-analogous to a map of elevation in a landscape-using a quantity called the isodepth. Contours of constant isodepths enclose domains with distinct cell type composition, while gradients of the isodepth indicate spatial directions of maximum change in expression. We develop GASTON (gradient analysis of spatial transcriptomics organization with neural networks), an unsupervised and interpretable deep learning algorithm that simultaneously learns the isodepth, spatial gradients and piecewise linear expression functions that model both continuous gradients and discontinuous variation in gene expression. We show that GASTON accurately identifies spatial domains and marker genes across several tissues, gradients of neuronal differentiation and firing in the brain, and gradients of metabolism and immune activity in the tumor microenvironment.
© 2025. The Author(s), under exclusive licence to Springer Nature America, Inc.