期刊:Nature Methods (2026-07-09) ·
DOI:10.1038/s41592-026-03153-3 ·
开源许可:MIT (allowed)
上游仓库:https://github.com/YSTLab/NicheTrans @ 85fab4722f9b
# 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
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.
{"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.
{"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.
{"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.
{"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}

