Paper2MCP v2 Verified Deliverable

Integrative cross-sample alignment and spatially differential gene analysis for spatial transcriptomics

期刊:Nature Communications (2026-06-25) · DOI:10.1038/s41467-026-72862-2 · 开源许可:GPL-3.0 (allowed)

上游仓库:https://github.com/xiaojierzi/CODA @ 712fba55c2d1

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

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

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

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

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

coda_preprocess_and_embed MCP Verified ✓

Batch-integrate two spatial transcriptomics slices (BBKNN/ComBat), project into a shared 3D UMAP/PCA latent space, and cluster communities.

Selftest Summary: Integrated slices (240 & 239 spots, 120 shared genes) using bbknn+umap into 3D space with 10 clusters.
Metrics: {"n_cells_1": 240, "n_cells_2": 239, "n_shared_genes": 120, "n_hvgs_used": 80, "n_clusters": 10, "embedding_dims": 3}
coda_global_align MCP Verified ✓

Perform global point-cloud spatial alignment across two ST slices in Mode I (G1 rigid), Mode II (G2 similarity), or Mode III (G2+ weak-affine).

Selftest Summary: Global alignment (G2+, route=labels) completed: mean NN dist 0.0743 -> 0.0542, SCI 0.129 -> 0.783.
Metrics: {"mode": "G2+", "route": "labels", "mean_nn_dist_before": 0.0743, "mean_nn_dist_after": 0.0542, "one_to_one_coverage": 0.2167, "crowding_ratio": 1.92, "sci_before": 0.1292, "sci_after": 0.7833, "ecs_before": 0.3679, "ecs_after": 0.6195}
coda_common_domain_match MCP Verified ✓

Rasterize latent embeddings onto a joint RGB grid and identify overlapping spatial domains via SuperPoint + LightGlue keypoint matching.

Selftest Summary: Matched 36 SuperPoint+LightGlue keypoints on 36x36 RGB grids; common domain retains 135/240 source and 129/239 target spots.
Metrics: {"canvas_height": 36, "canvas_width": 36, "n_matched_keypoints": 36, "src_common_cells": 135, "dst_common_cells": 129, "src_overlap_fraction": 0.5625, "dst_overlap_fraction": 0.5397}
coda_local_lddmm_align MCP Verified ✓

Perform nonlinear local diffeomorphic alignment using CODA multi-channel LDDMM on interpolated latent feature grids.

Selftest Summary: LDDMM registration on 36x36 grid (T=6, K=6) reduced energy 13815.83 -> 7903.46; injectivity_violated=False.
Metrics: {"img_side": 36, "T": 6, "K": 6, "energy_initial": 13815.8282, "energy_final": 7903.4573, "deformation_length": 33.1778, "injectivity_violated": false, "ecs_before": 0.611, "ecs_after": 0.6129, "sci_before": 0.7583, "sci_after": 0.7458, "sci_gain": -0.0125}
coda_spatial_cross_correlation MCP Verified ✓

Quantify cross-sample spatial expression concordance per gene to identify Spatially Consistent Genes (SCGs) and Spatially Differential Genes (SDGs).

Selftest Summary: Evaluated spatial cross-correlation across 120 shared genes: top SCG=MBP (0.6450), top SDG=KRT17 (0.0581).
Metrics: {"n_genes_evaluated": 120, "top_scg": "MBP", "top_scg_score": 0.645, "top_sdg": "KRT17", "top_sdg_score": 0.0581, "mean_index": 0.2328, "n_scgs": 10, "n_sdgs": 10}

三、实测复现结果图展示

coda_alignment_progression.png
coda_common_domain_matching.png
coda_spatial_cross_correlation.png