Paper2MCP v2 Verified Deliverable

Topography-aware optimal transport for alignment of spatial omics data

期刊:Cell Reports Methods (2026-03-30) · DOI:10.1016/j.crmeth.2026.101373 · 开源许可:MIT (allowed)

上游仓库:https://github.com/cecca46/TOAST @ 43929c04545a

Pytest: passed MCP Stdio Selftest: passed Relocated Fresh Install: passed

一、一键安装与 MCP 接入(本地 / 远程统一接口)

# 1. 解压并自动构建隔离环境 + 运行真实数据自测
unzip toast-mcp.zip && cd toast-mcp
bash install.sh
.venv/bin/python selftest.py

# 2. 接入 Claude Code / Antigravity / Cursor (Stdio MCP)
claude mcp add toast -- "$PWD/.venv/bin/python" "$PWD/server.py"

# 3. 或启动远程 Streamable HTTP MCP 服务端供团队/网页直接调用
.venv/bin/python server.py --transport http --host 0.0.0.0 --port 8000

二、已验证科学工具清单(4 个工具)

align_slices_csv MCP Verified ✓

Align two spatial-omics slices stored as CSV tables with TOAST and return the transport plan, best-match table and alignment metrics.

Selftest Summary: TOAST aligned 624 source cells to 624 target cells (alpha=0.5, epsilon=0.1, spatial terms on): argmax label accuracy 1.000, mass-weighted mapping accuracy 0.819, neighbourhood JSD 0.0599.
Metrics: {"accuracy_max_prob": 1.0, "mapping_accuracy": 0.8193180500826073, "JSD": 0.059864692809047215, "n_source": 624, "n_target": 624, "alpha": 0.5, "epsilon": 0.1, "use_spatial_terms": true, "transport_mass": 1.0000000000000002, "align_runtime_sec": 4.032}
align_slices_anndata MCP Verified ✓

Align two AnnData (.h5ad) spatial slices with TOAST using obsm spatial coordinates and obs cell labels.

Selftest Summary: TOAST aligned 624 source cells to 624 target cells from AnnData (alpha=0.5, epsilon=0.1, spatial terms on): argmax label accuracy 1.000, mass-weighted mapping accuracy 0.819, neighbourhood JSD 0.0599.
Metrics: {"accuracy_max_prob": 1.0, "mapping_accuracy": 0.8193180500826073, "JSD": 0.059864692809047215, "n_source": 624, "n_target": 624, "alpha": 0.5, "epsilon": 0.1, "use_spatial_terms": true, "transport_mass": 1.0000000000000002, "align_runtime_sec": 3.231}
compare_toast_variants MCP Verified ✓

Ablate TOAST on a slice pair: full model, no spatial terms, expression only and an alpha sweep, with a comparison table and bar chart.

Selftest Summary: Compared 4 TOAST variants on 624 x 624 cells. Neighbourhood JSD: full model 0.0599 vs no spatial terms 0.1177 (reduction 0.0579).
Metrics: {"variants": {"TOAST_full": {"accuracy_max_prob": 1.0, "mapping_accuracy": 0.8193180500826073, "JSD": 0.059864692809047215, "alpha": 0.5, "use_spatial_terms": true, "runtime_sec": 2.42}, "no_spatial_terms": {"accuracy_max_prob": 1.0, "mapping_accuracy": 0.8125471768147838, "JSD": 0.1177496090259288, "alpha": 0.5, "use_spatial_terms": false, "runtime_sec": 2.403}, "expression_only_alpha0": {"accuracy_max_prob": 0.9967948717948718, "mapping_accuracy": 0.8281150784103385, "JSD": 0.11874255062188069, "alpha": 0.0, "use_spatial_terms": false, "runtime_sec": 3.369}, "alpha_0.2": {"accuracy_max_prob": 1.0, "mapping_accuracy": 0.8272425487105951, "JSD": 0.058806443421814444, "alpha": 0.2, "use_spatial_terms": true, "runtime_sec": 3.593}}, "jsd_full": 0.059864692809047215, "jsd_no_spatial_terms": 0.1177496090259288, "jsd_reduction_from_spatial_terms": 0.05788491621688159}
plot_alignment_mapping MCP Verified ✓

Plot source and target slices and show which source cells map to a target cell with the same label under the TOAST transport plan.

Selftest Summary: Plotted TOAST mapping of 624 source cells onto 624 target cells; 100.0 percent of source cells map to a target cell with the same label.
Metrics: {"label_match_fraction": 1.0, "n_mismatch": 0, "n_source": 624, "n_target": 624}

三、实测复现结果图展示

toast_2d_sim_ablation_metrics.png
toast_2d_sim_spatial_mapping.png
toast_2d_sim_transport_plan.png