Description
Spatial transcriptomics datasets, comprising slides from various subjects and conditions, facilitate the exploration of gene expression changes in health and disease within their spatial context. Despite this potential, statistical methods for analyzing differential spatial expression across subject groups are missing. Addressing this need, we introduce BayeSDX, a Bayesian test for Spatial Differential Expression in these datasets. BayeSDX utilizes a Bayesian multiple instance learning model to effectively model the spatial organization of data. Employing a simple yet effective attention mechanism, it pinpoints regions exhibiting differential expression patterns between the analyzed groups. Applied to a mouse brain dataset comprising 70 Visium slides from stressed and control groups, BayeSDX marks a significant improvement over a baseline model, assessing differential expression in pseudobulk from 19 brain regions. Furthermore, we validate BayeSDX's utility and robustness through extensive simulations, introducing the first-ever developed benchmark for differential spatial expression in this domain.