Abstract
Spatial omics technologies revolutionize our view of biological processes within tissues. However, existing methods fail to capture localized, sharp changes characteristic of critical events (e.g. tumor development). Here, we present StarTrail, a novel gradient based method that powerfully defines rapidly changing regions and detects "cliff genes", genes exhibiting drastic expression changes at highly localized or disjoint boundaries. StarTrail, the first to leverage spatial gradients for spatial omics data, also quantifies directional dynamics. Across multiple datasets, StarTrail accurately delineates boundaries (e.g., brain layers, tumor-immune boundaries), and detects cliff genes that may regulate molecular crosstalk at these biologically relevant boundaries but are missed by existing methods. For instance, StarTrail precisely pinpointed the cancer-immune interface in a HER2+ breast cancer dataset, unveiled key cliff genes including a potential prognostic biomarker IGSF3, highlighting NK-, B-cell mediated immunity, and B cell receptor signaling pathways missed by all spatial variable gene methods attempted. StarTrail, filling important gaps in current literature, enables deeper insights into tissue spatial architecture.
Introduction: The Challenge of Spatial Edges
Spatial omics technologies like 10x Visium and MERFISH have transformed our ability to map gene expression within the complex architecture of tissues. However, a significant gap remains in current analytical frameworks. Most tools are designed to identify Spatially Variable Genes (SVGs) that exhibit broad, tissue-wide patterns. Yet, many critical biological events—such as tumor invasion, immune cell infiltration, or the formation of distinct brain layers—occur at sharp, localized boundaries.
These "cliffs" in expression are often missed by standard tools because the signal is diluted across the entire sample. Furthermore, existing methods lack directionality; they can identify where a gene is expressed but cannot quantify the vector of its change. Modeling these spatial gradients has historically been a computational challenge, often requiring days of processing time for a single slide.
Methods: Mapping the Topography of Gene Expression
To address these limitations, we introduce StarTrail, a novel framework that treats gene expression as a continuous surface and calculates its mathematical derivative—the gradient. StarTrail leverages scalable Nearest-Neighbor Gaussian Processes (NNGP) to reduce computational complexity from $O(n^3)$ to $O(nm^3)$, enabling a massive 1200x speedup in processing time (reducing a 40-hour task to just 2 minutes).
The framework employs finite difference approximations to estimate gradients ($\nabla Z$) and curvature ($\nabla^2 Z$) at "super-resolution." By analyzing the magnitude of these gradients, StarTrail can pinpoint areas of most rapid change and fit Principal Curves to automatically delineate tissue boundaries. Additionally, a technique called "Spatial Wombling" allows for the calculation of directional dynamics across these defined boundaries, providing a "weather map" of gene activity.
Key Insights: Cliff Genes and Directional Dynamics
A central contribution of StarTrail is the concept of the "Cliff Gene." Unlike traditional SVGs, cliff genes are defined by their sharp, localized behavior at tissue boundaries. These genes are often key coordinators of molecular crosstalk at biological junctions. By quantifying the gradient flow map, StarTrail adds a new dimension to spatial analysis: directionality. This allows researchers to see whether expression gradients converge or diverge, indicating areas of maximal or minimal activity. Furthermore, the inclusion of gradient information as a feature in standard clustering algorithms (such as BayesSpace or K-Means) significantly improves the delineation of tissue domains.
Results: Sharper Boundaries and Novel Biomarkers
StarTrail was validated across several complex datasets, including the human dorsolateral prefrontal cortex (DLPFC) and HER2+ breast cancer samples. In the DLPFC dataset, StarTrail accurately mapped the transition between White Matter and Layer 6, identifying genes like MBP and PLP1 with high precision.
In the breast cancer study, StarTrail identified IGSF3 as a top cliff gene at the tumor-immune interface. This potential prognostic biomarker was completely missed by four other state-of-the-art SVG methods (Spark-X, SpatialDE, etc.). The analysis revealed that IGSF3 is involved in NK- and B-cell mediated immunity pathways, highlighting its role in the cancer-immune interface. Quantitatively, incorporating the $L^2$ norm of gradients consistently improved the Adjusted Rand Index (ARI) across multiple clustering methods, demonstrating that gradient-aware analysis leads to more pathologically accurate tissue segmentation.
Conclusion
StarTrail fills a critical gap in spatial omics analysis by focusing on the "topography" of gene expression. By identifying cliff genes and quantifying directional dynamics with unprecedented speed, it provides a powerful tool for uncovering the molecular mechanisms driving localized biological transitions. Future work will focus on extending this framework to multivariate spatial gradient processes to capture simultaneous interactions between groups of genes at tissue boundaries.
Summary updated