一、什麼叫「Spatial Domain」?
Spatial domain 是 ST 才有的概念,指「表達 profile 相似且在組織上連續成片」的 spot 集合。在腦皮層上,這對應到 cortical layer L1–L6;在腎臟,對應到腎絲球與腎小管;在腫瘤,對應到核心 / 邊界 / 基質區。
跟 scRNA cluster 的差別:scRNA 只看 expression similarity,「空間連續」是無從定義的。在 ST,同一個 cell type 在不同空間區域可能行使不同功能,所以用 cell type 取代 spatial domain 會丟失關鍵資訊。
A spatial domain is an ST-specific concept: spots that are both expression-similar and spatially contiguous. In the cortex, domains map to cortical layers L1–L6; in kidney, to glomeruli vs tubules; in tumor, to core / margin / stroma.
How does this differ from scRNA clusters? scRNA only knows expression similarity; "spatial contiguity" is undefined. In ST, the same cell type can perform different roles in different spatial regions — replacing domains with cell types loses key information.
二、五大主流演算法
| 工具 | 原理 | 語言 | 優缺 | ||
|---|---|---|---|---|---|
| BayesSpace | Bayesian + Markov Random Field 強制空間連續 | R | 在 Visium、原始 ST 上表現穩定;Markov 假設下會「太平滑」 | Bayesian + Markov Random Field for spatial smoothness | Robust on Visium / original ST; can over-smooth |
| SpaGCN | GCN + 組織影像顏色一起當特徵 | Python | 能整合 H&E;Stereo-seq 表現很好 | GCN + H&E color as features | Integrates H&E; strong on Stereo-seq |
| STAGATE | Adaptive graph attention auto-encoder | Python | 在 Visium 表現次於 GraphST;對 STARmap 也較友善 | Adaptive graph-attention autoencoder | 2nd on Visium; friendlier on STARmap |
| GraphST | Self-supervised contrastive GNN | Python | 2025 benchmark Visium 第一名(mean ARI 0.55) | Self-supervised contrastive GNN | Top method on Visium in 2025 benchmark (mean ARI 0.55) |
| BANKSY | 把 self / nbr-mean / nbr-azimuthal 串接做特徵 | R / Python | 超快、無需 GPU、Seurat v5 內建 | Concatenates self / nbr-mean / nbr-AGF features | Very fast, no GPU needed, built into Seurat v5 |
互動:smoothing 強度與 cluster 數
下方是模擬皮層 5 層結構。左側為 raw expression(含噪),中間是「弱平滑」(似 Leiden),右側是「強平滑」(似 BayesSpace)。觀察邊界平滑度與 cluster 數的取捨。
Below: simulated 5-layer cortex. Left = raw expression (noisy); middle = weak smoothing (Leiden-like); right = strong smoothing (BayesSpace-like). Watch the trade-off between boundary sharpness and cluster count.
三、選工具決策樹
🌳 先看你用哪個平台
實作
# BayesSpace library(BayesSpace) spe <- spatialPreprocess(spe, n.PCs = 15, n.HVGs = 2000) spe <- qTune(spe, qs = 3:10) # 選最佳 cluster 數 spe <- spatialCluster(spe, q = 7, nrep = 10000) clusterPlot(spe) # BANKSY (Seurat v5 內建) vis <- RunBanksy(vis, lambda = 0.2, k_geom = 15, dimx = "x", dimy = "y") vis <- RunPCA(vis, assay = "BANKSY") |> FindNeighbors() |> FindClusters(resolution = 0.5) SpatialDimPlot(vis)
# GraphST from GraphST import GraphST from GraphST.utils import clustering model = GraphST(adata, device="cuda") adata = model.train() clustering(adata, n_clusters=7, method="mclust") sq.pl.spatial_scatter(adata, color=["domain"]) # SpaGCN import SpaGCN as spg adj = spg.calculate_adj_matrix(x=adata.obs["x"], y=adata.obs["y"], x_pixel=adata.obs["x_pix"], y_pixel=adata.obs["y_pix"], image=img, beta=49, alpha=1, histology=True) clf = spg.SpaGCN() clf.set_l(0.5); clf.train(adata, adj, n_clusters=7)
📝 自我檢測
1. 為什麼 spatial domain 不能用 scRNA cluster 取代?
1. Why can't spatial domains simply be replaced by scRNA clusters?
2. 2025 NAR benchmark 中,Visium 上整體表現最佳的是?
2. Best-performing method on Visium in the 2025 NAR benchmark?
3. SpaGCN 跟其他方法最特別的不同是?
3. What is unique about SpaGCN?