Abstract
Spatial transcriptomics enables the contextualization of gene expression with spatial organization, advancing our understanding of development, disease, and tissue architecture. However, existing analysis pipelines require multiple tools to explore spatial domains, and few methods can jointly analyse spatial data from annotation-free and annotation-guided perspectives with high interpretability. We therefore propose the Spatial Topic Model (SpaTM), a topic-modelling framework capable of annotation-guided and annotation-free analysis of spatial transcriptomes. SpaTM can learn gene programs that represent histology-based annotations while also inferring spatial domains with an annotation-free approach if manual annotations are limited or noisy. In benchmarking experiments, SpaTM achieves competitive performance at spatial label prediction and clustering when compared with existing state-of-the-art methods. We demonstrate SpaTM's interpretability by using topic mixtures to capture transcriptional programs in dorsolateral prefrontal cortex and ductal carcinoma samples and show how its intuitive framework facilitates the integration of spatial transcriptomics tasks. Finally, we showcase how SpaTM can extend the analysis of large-scale snRNA-seq atlases in human brains with Major Depressive Disorder. Overall, SpaTM provides a unified and interpretable analysis framework for spatial transcriptomics, enabling competitive performance in multiple tasks while inferring biologically informed gene programs.