Inferensys

Glossary

Spatial Trajectory Inference

A computational method that orders cells based on their spatial coordinates and gene expression profiles to reconstruct dynamic biological processes like differentiation in situ.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
COMPUTATIONAL BIOLOGY

What is Spatial Trajectory Inference?

Spatial trajectory inference is a computational method that reconstructs dynamic biological processes by ordering cells based on their gene expression profiles and physical coordinates within a tissue.

Spatial trajectory inference is a computational framework that orders individual cells or spatial spots along a pseudotemporal path by simultaneously modeling gene expression similarity and physical proximity in a tissue section. Unlike traditional trajectory inference, which relies solely on transcriptomic similarity to reconstruct differentiation, this method constrains the ordering with spatial coordinates to ensure the inferred process respects anatomical boundaries and migratory patterns.

The core algorithm typically constructs a spatial neighborhood graph where edges connect physically adjacent cells, then applies a dimensionality reduction or graph-learning technique to identify smooth transcriptional transitions across this spatial manifold. This enables the identification of origin and terminal states in situ, revealing how stem cells differentiate into specialized cell types while migrating through distinct tissue niches.

MECHANISMS AND METHODOLOGIES

Core Characteristics of Spatial Trajectory Inference

Spatial trajectory inference reconstructs dynamic biological processes by ordering cells based on both their gene expression profiles and their physical coordinates within a tissue. These core characteristics define how the computational models capture differentiation, migration, and signaling in situ.

01

Pseudotime Ordering with Spatial Constraints

The foundational algorithm assigns each cell a pseudotime value representing its progress along a biological continuum. Unlike non-spatial methods, the ordering is constrained by a spatial neighborhood graph, ensuring that transitions between states are physically proximal. This prevents biologically implausible leaps across tissue compartments. The process typically involves constructing a graph where edges connect spatially adjacent cells, then finding a minimum spanning tree or principal curve through the high-dimensional expression space that respects these spatial adjacencies.

02

Vector Field Reconstruction

Instead of a static ordering, this approach learns a velocity vector for each cell, predicting its future transcriptional state. Techniques like RNA velocity are adapted to the spatial context, modeling the rate of change in gene expression as a function of both the cell's current state and its local neighborhood. The resulting vector field visualizes the flow of differentiation across the tissue, identifying sources (progenitor zones), sinks (terminally differentiated regions), and potential attractor states.

03

Optimal Transport for Cellular Transitions

This probabilistic framework models the coupling between cells in different spatial regions or time points. Optimal transport calculates the most efficient way to map the distribution of cells from an earlier state to a later state, minimizing a cost function that incorporates both transcriptional dissimilarity and physical distance. The resulting transition matrix quantifies the probability of a cell at location x differentiating into a cell type at location y, providing a rigorous, mass-preserving model of spatiotemporal dynamics.

04

Spatial Differential Geometry for Curvature Analysis

Advanced methods borrow concepts from differential geometry to analyze the shape of the inferred trajectory manifold. By calculating the curvature and torsion of the principal curve through the spatial-expression space, researchers can identify sharp bends that represent critical fate decision points. High curvature regions often correspond to branching points where a progenitor population diverges into two distinct lineages, providing a quantitative geometric signature of cell fate commitment within the tissue architecture.

05

Ligand-Receptor Driven Trajectory Bias

This characteristic integrates cell-cell communication directly into the trajectory model. The algorithm weights the probability of a differentiation transition based on the co-expression of cognate ligand-receptor pairs between neighboring cells. A cell's pseudotime progression is thus influenced by the signaling molecules it receives from its niche. This moves beyond descriptive trajectory inference to a mechanistic model where the tissue microenvironment actively shapes the differentiation path.

06

Topological Feature Extraction

Persistent homology, a tool from topological data analysis, is used to identify robust, multiscale features of the spatial trajectory. This method tracks the birth and death of connected components, loops, and voids in the spatial-expression data as a resolution parameter changes. It can detect cyclic trajectories (e.g., the cell cycle in a germinal center) or bifurcating structures that are invariant to noise, providing a coordinate-free summary of the dynamic process's global architecture.

SPATIAL TRAJECTORY INFERENCE

Frequently Asked Questions

Addressing common questions about the computational reconstruction of dynamic biological processes from static spatial transcriptomics data.

Spatial trajectory inference is a computational method that orders individual cells or tissue spots into a continuous developmental path based on their gene expression profiles and physical spatial coordinates. Unlike traditional pseudotime algorithms that rely solely on transcriptomic similarity, this technique integrates spatial context to reconstruct dynamic processes like differentiation, migration, or tumor invasion directly in situ. The process typically involves constructing a spatial neighborhood graph where nodes represent cells and edges represent physical proximity. Algorithms then find a path through this graph that minimizes transcriptional change between adjacent steps, often using optimal transport or minimum spanning tree approaches. The output is a spatially constrained pseudotime ordering that reveals how cells transition through states while respecting tissue architecture. Key implementations include SpaceFlow, which uses a graph neural network to learn a low-dimensional embedding that encodes both expression and spatial similarity, and stLearn's PSTS (pseudo-space-time) module, which leverages diffusion pseudotime on a spatially regularized manifold.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.