Abstract
Understanding how transcriptional programs are organized across biological contexts is essential for deciphering tissue development, disease progression, and species-specific adaptations. Spatial transcriptomic atlases spanning patients, developmental stages, and species provide an opportunity to resolve gene expression programs (GEPs) that are sample-specific, group-shared, or region-associated, yet strong sample-specific variation can obscure weaker shared programs. Here we introduce SORT, a matrix factorization framework that jointly recovers multilevel GEPs and their spatial activities, using orthogonality to reduce program redundancy and graph total variation to preserve spatial boundaries. In simulations with strong patient variation, SORT more accurately recovered patient-specific, subtype-shared, and region-associated programs than existing methods. Across 108 pancreatic ductal adenocarcinoma sections, SORT resolved tumor and stromal programs with distinct and overlapping activities and linked these activities to survival across four external cohorts. In a cross-species cerebellar atlas, SORT distinguished conserved layer-associated programs from species-specific activity variation. Across eight stages of mouse organogenesis, SORT revealed GEPs with anatomical redeployment and graded spatial activity, as well as stage-dependent local co-deployment of distinct programs.