Paper2MCP v2 Verified Deliverable

NicheTrans: spatial-aware cross-omics translation.

期刊:Nature Methods (2026-07-09) · DOI:10.1038/s41592-026-03153-3 · 开源许可:MIT (allowed)

上游仓库:https://github.com/YSTLab/NicheTrans @ 85fab4722f9b

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

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

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

# 2. 接入 Claude Code / Antigravity / Cursor (Stdio MCP)
claude mcp add nichetrans -- "$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_niche_graph MCP Verified ✓

Preprocess spatial omics AnnData files and construct NicheTrans 8-neighbor spatial niche graphs (Radius or KNN) wrapping upstream Cal_Spatial_Net_row_col.

Selftest Summary: Built Radius spatial niche graph for 347 spots (200 source genes, 31 target markers; mean 7.38 neighbors/spot).
Metrics: {"n_spots": 347, "n_source_features": 200, "n_target_features": 31, "n_edges_ring1": 0, "n_edges_ring2": 2560, "mean_neighbors_per_spot": 7.3775}
train_nichetrans MCP Verified ✓

Train a spatial-aware NicheTrans (standard or high_dim) cross-omics translation Transformer on paired spatial multi-omics slices.

Selftest Summary: Trained NicheTrans (standard) for 5 epochs on 347 spots (200 -> 31 features); final train MSE=0.8934.
Metrics: {"n_train_spots": 347, "n_source_features": 200, "n_target_features": 31, "epochs": 5, "final_train_loss": 0.89344, "val_mean_pearson": 0.1166, "val_mean_spearman": 0.1416, "val_mean_rmse": 1.0966}
translate_and_evaluate MCP Verified ✓

Translate spatial source omics to target omics with a trained NicheTrans checkpoint, compute per-target correlations/RMSE, and identify multi-omics spatial domains.

Selftest Summary: Translated 347 spots into 31 target markers (mean Pearson r=0.1594, best=CD3E)
Metrics: {"n_query_spots": 347, "n_targets": 31, "silhouette_source_only": 0.0364, "silhouette_multiomics": 0.0532, "mean_pearson": 0.1594, "mean_spearman": 0.178, "mean_rmse": 1.1019, "best_target": "CD3E", "best_target_pearson": 0.5102}
attribute_spatial_niche MCP Verified ✓

Compute Integrated Gradients attributions across center and spatial niche neighbor spots to identify microenvironment genes driving a translated marker.

Selftest Summary: Attributed CD3E across 48 spatial niches: center share=52.4%, neighbor share=47.6%; top gene=IGKC.
Metrics: {"target_marker": "CD3E", "n_spots_attributed": 48, "center_contribution_share": 0.5239, "neighbor_contribution_share": 0.4761, "top_gene": "IGKC", "top_gene_score": 17.1394}

三、实测复现结果图展示

fig1_spatial_translation_markers.png
fig2_cross_omics_correlation.png
fig3_niche_attribution_and_domains.png