Paper2MCP v2 Verified Deliverable

Accurate trajectory inference in time-series spatial transcriptomics with structurally-constrained optimal transport

期刊:Nature Communications (2026-06-29) · DOI:10.1038/s41467-026-74927-8 · 开源许可:MIT (allowed)

上游仓库:https://github.com/algo-bio-lab/SOCS @ bbf474a1827e

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

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

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

# 2. 接入 Claude Code / Antigravity / Cursor (Stdio MCP)
claude mcp add socs -- "$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 个工具)

infer_socs_trajectory MCP Verified ✓

Infer a structurally-constrained FUGW optimal transport map between two spatial transcriptomics timepoints using SOCSModel.

Selftest Summary: Inferred SOCS transport map (197 -> 210 cells, method=fugw_cpu, alpha=0.1) with median cell Hill #=1.7001 and median structure ancestor Hill #=1.0.
Metrics: {"n_source_cells": 197, "n_target_cells": 210, "total_mass": 0.990102, "median_cell_hill_number": 1.7001, "median_struct_ancestor_hill": 1.0, "median_struct_descendant_hill": 1.0, "method": "fugw_cpu", "alpha": 0.1, "epsilon": 0.001}
evaluate_trajectory_coherence MCP Verified ✓

Evaluate structural coherence (Hill number), pairwise spatial distance correlation, and cell-type lineage transitions of an inferred transport map.

Selftest Summary: Evaluated transport map (197 -> 210): geometric distance corr=0.7184, median ancestor structure Hill #=1.0, mean cell-type self-consistency=0.6713.
Metrics: {"geometric_distance_corr": 0.7184, "median_ancestor_struct_hill": 1.0, "median_descendant_struct_hill": 1.0, "mean_celltype_self_consistency": 0.6713, "mean_cell_hill_number": 1.8371}
analyze_structure_morphology MCP Verified ✓

Compute per-structure cell counts, spatial centroids, convex-hull diameters, and boundary distances for spatial transcriptomics structures.

Selftest Summary: Quantified morphology across 1 structures (174 cells): mean size=174.0, mean diameter=155.323.
Metrics: {"n_structures": 1, "total_cells_in_structures": 174, "mean_struct_size": 174.0, "mean_struct_diameter": 155.323, "mean_edge_dist": 99.364}
sweep_socs_alpha MCP Verified ✓

Sweep SOCS alpha hyperparameter to profile the tradeoff between spatial/structural coherence and gene-expression alignment.

Selftest Summary: Swept alpha=[0.05, 0.25, 0.75]: best geometric corr=0.7463 at alpha=0.05, min median ancestor structure Hill #=1.0.
Metrics: {"alphas_tested": [0.05, 0.25, 0.75], "recommended_alpha": 0.05, "best_geometric_corr": 0.7463, "best_structural_hill": 1.0}

三、实测复现结果图展示

fig1_lung_airway_coherence.png
fig2_lung_geometry_and_celltypes.png
fig3_alpha_tradeoff_and_follicle.png