一、為什麼 ST 的 trajectory 不只是 scRNA pseudotime?
scRNA 的 trajectory(Monocle3、Slingshot、scVelo)是「狀態空間」裡的一條線:把細胞從一個狀態變到另一個狀態的順序排出來。在 ST 上我們有一個天然的物理軸——例如「離血管多遠」、「距腫瘤邊緣多遠」、「沿皮層的深度」。
因此 ST trajectory 有兩個層次:
- cell-level trajectory:跟 scRNA 一樣的 pseudotime,但事後可以投回空間。
- niche-level trajectory:把 niche 排序成一條空間連續的「微環境演進」(ONTraC、SpaceFlow)。
scRNA trajectories (Monocle3, Slingshot, scVelo) live in "state space" — order cells from one state to another. ST gives us a natural physical axis: distance from a vessel, distance from a tumor margin, depth across cortical layers.
So ST trajectory has two levels:
- Cell-level trajectory: like scRNA pseudotime, projected back to space afterwards.
- Niche-level trajectory: order niches into a spatially-contiguous "microenvironment progression" (ONTraC, SpaceFlow).
二、主流工具
| 工具 | 層級 | 原理 | ||
|---|---|---|---|---|
| Monocle3 / Slingshot | cell | scRNA 標準 pseudotime;事後投回空間 | cell | Standard scRNA pseudotime; project back to space |
| scVelo (with SpatialVelocity) | cell | RNA velocity 加上空間平滑 | cell | RNA velocity with spatial smoothing |
| SpaceFlow | cell + spatial | deep GNN + diffusion model 計算 pseudo-spatiotemporal map | cell + spatial | deep GNN + diffusion → pseudo-spatiotemporal map |
| stLearn PSTS | cell | 把 SME normalization + Diffusion pseudotime 合併 | cell | SME normalization + Diffusion pseudotime |
| ONTraC | niche | GNN 學 niche 連續軸;2025 Genome Biology | niche | GNN learns continuous niche axis; 2025 Genome Biology |
| VIA | cell | scalable + 多分支軌跡 | cell | Scalable + multi-branch trajectory |
互動:沿空間軸的 pseudotime 漸變
下方為模擬「傷口邊緣的修復細胞」場景。中央紅色為傷口;周圍細胞表達會根據與傷口距離形成漸變。切換不同模式觀察 pseudotime 投回空間後的 pattern。
Simulated "wound-margin healing cells" scene. Central red region = wound; surrounding cells express genes graded by distance to the wound. Switch modes to see pseudotime projected back into space.
實作
# 把 ST 物件轉到 cell 層級(image-based 直接;spot-based 先 deconvolution) library(monocle3) cds <- new_cell_data_set(counts(spe), cell_metadata = colData(spe)) cds <- preprocess_cds(cds) |> reduce_dimension() |> cluster_cells() cds <- learn_graph(cds); cds <- order_cells(cds) spe$pseudotime <- pseudotime(cds) # 投回空間 SpatialFeaturePlot(as.Seurat(spe), features = "pseudotime")
# SpaceFlow from SpaceFlow import SpaceFlow sf = SpaceFlow.SpaceFlow(adata=adata) sf.preprocessing_data(n_top_genes=3000) sf.train(spatial_regularization_strength=0.1); sf.segmentation(domain_label_save_filepath="d.tsv") sf.pseudo_Spatiotemporal_Map() # pSM array in adata.obs # ONTraC: niche-level trajectory # ontrac CLI: ontrac --meta meta.tsv --st st.h5ad --output out/
📝 自我檢測
1. ST trajectory 跟 scRNA pseudotime 最大的不同是?
1. Biggest difference between ST trajectory and scRNA pseudotime?
2. ONTraC 的核心特色?
2. Defining feature of ONTraC?
3. SpaceFlow 主要的輸出是?
3. Main output of SpaceFlow?