ContextFlow: Context-Aware Flow Matching For Trajectory Inference From Spatial Omics Data
About
Inferring trajectories from longitudinal spatially-resolved omics data is fundamental to understanding the dynamics of structural and functional tissue changes in development, regeneration and repair, disease progression, and response to treatment. We propose ContextFlow, a novel context-aware flow matching framework that incorporates prior knowledge to guide the inference of structural tissue dynamics from spatially resolved omics data. Specifically, ContextFlow integrates local tissue organization and ligand-receptor communication patterns into a transition plausibility matrix that regularizes the optimal transport objective. By embedding these contextual constraints, ContextFlow generates trajectories that are not only statistically consistent but also biologically meaningful, making it a generalizable framework for modeling spatiotemporal dynamics from longitudinal, spatially resolved omics data. Evaluated on three datasets, ContextFlow consistently outperforms state-of-the-art flow matching methods across multiple quantitative and qualitative metrics of inference accuracy and biological coherence. Our code is available at: \href{https://github.com/santanurathod/ContextFlow}{ContextFlow}
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Trajectory Extrapolation | Axolotl Brain Regeneration Extrapolation (last holdout time point) | Weighted W25.277 | 12 | |
| Trajectory Interpolation | Axolotl Brain Regeneration (middle holdout time point) | Weighted W22.316 | 12 | |
| Trajectory Generation | Mouse Organogenesis Spatiotemporal Atlas (MOSTA) Stereo-seq Interpolation (time 5) | Weighted W21.865 | 12 | |
| Transcriptomic Alignment | Brain Regeneration | Coupled Transcriptomic Distance33.58 | 8 | |
| Trajectory Interpolation | Liver Regeneration (middle holdout time point) | W232.682 | 7 | |
| Trajectory Generation | Mouse Organogenesis Spatiotemporal Atlas (MOSTA) Stereo-seq (Extrapolation (time 8)) | Weighted W21.505 | 6 | |
| Spatiotemporal OT Alignment | Brain Regeneration Static Pair (1, 2) | Migration Metric231.4 | 4 | |
| Spatiotemporal OT Alignment | Brain Regeneration Static Pair (2, 3) | Migration Metric289.5 | 4 | |
| Spatiotemporal OT Alignment | Brain Regeneration Static Pair (4, 5) | Migration Metric1.76e+3 | 4 | |
| Transcriptomic Alignment | Brain Regeneration (2, 3) | Coupled Transcriptomic Distance18.01 | 4 |