Paper2MCP v2 Verified Deliverable

SpaCEy links spatial tissue patterns to clinical outcomes using explainable graph neural networks

期刊:Nature Communications (2026-09-26) · DOI:10.1038/s41467-026-77924-z · 开源许可:GPL-3.0 (allowed)

上游仓库:https://github.com/saezlab/SpaCEy @ 2811c531b6b2

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

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

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

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

build_spatial_graphs MCP Verified ✓

Construct SpaCEy PyTorch Geometric spatial tissue graphs from single-cell spatial proteomics CSV/TSV or .h5ad data using Delaunay triangulation or kNN.

Selftest Summary: Constructed 32 SpaCEy spatial graphs (18 markers, 2727 cells, 15014 edges) via delaunay.
Metrics: {"n_graphs": 32, "n_patients": 32, "n_markers": 18, "total_nodes": 2727, "total_edges": 15014, "mean_edges_per_graph": 469.19}
train_spacey_survival MCP Verified ✓

Train SpaCEy CustomGCN graph neural network with Cox proportional hazards loss using patient-stratified cross-validation or full-cohort refit.

Selftest Summary: Trained SpaCEy GATV2 (cv) on 32 graphs (32 patients): C-index=0.8447, log-rank p=6.00e-09.
Metrics: {"overall_patient_ci": 0.8447, "mean_fold_ci": 0.8407, "train_patient_ci": 0.8447, "logrank_p_value": 1e-08, "n_graphs": 32, "n_patients": 32, "model_type": "GATV2"}
predict_clinical_risk MCP Verified ✓

Score spatial tissue graphs with a trained SpaCEy CustomGCN checkpoint to predict patient clinical risk and extract intermediate graph embeddings.

Selftest Summary: Scored 32 spatial graphs (32 patients): patient C-index=0.8447, embedding dim=32.
Metrics: {"patient_ci": 0.8447, "graph_ci": 0.8447, "n_graphs": 32, "n_patients": 32, "mean_risk": 0.1387, "risk_std": 2.9898, "embedding_dim": 32}
explain_spatial_motifs MCP Verified ✓

Explain predictive spatial tissue motifs via PyG GNNExplainer, k-hop node importance scoring, Voronoi spatial maps, and Wilcoxon marker enrichment.

Selftest Summary: Explained 2 spatial graphs (181 cells, 46 motif cells); top enriched marker=CD31 (z=2.28).
Metrics: {"n_explained_graphs": 2, "n_total_cells": 181, "n_motif_cells": 46, "top_marker": "CD31", "top_marker_zscore": 2.2842, "mean_motif_importance": 0.1627}

三、实测复现结果图展示

fig1_cv_survival_stratification.png
fig2_spatial_motif_explanation.png
fig3_motif_marker_and_embeddings.png