Paper2MCP v2 Verified Deliverable

Celcomen: spatial causal disentanglement for single-cell and tissue perturbation modeling

期刊:Nature Communications (2026-03-18) · DOI:10.1038/s41467-026-69856-5 · 开源许可:GPL-3.0 (allowed)

上游仓库:https://github.com/Teichlab/celcomen @ 4165b5620cd6

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

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

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

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

prepare_spatial_graph MCP Verified ✓

Log-normalise, gene-centre and unit-norm scale a spatial AnnData, then build the k=6 spatial graph with Celcomen get_dataset_loaders.

Selftest Summary: Prepared 196 cells x 16 genes in 1 sample(s); repo loader built 1176 directed edges (k=6), mean feature norm 1.000.
Metrics: {"n_cells": 196, "n_genes": 16, "n_samples": 1, "n_edges_total": 1176, "mean_degree": 6.0, "cells_dropped": 0, "mean_feature_norm": 1.0, "k_neighbors": 6}
train_celcomen_model MCP Verified ✓

Train Celcomen on a prepared dataset and export the learned intercellular and intracellular gene-gene matrices.

Selftest Summary: Trained Celcomen for 100 epochs: loss 718.37 -> 119.07; non-zero off-diagonal weights intercellular=0, intracellular=64.
Metrics: {"epochs": 100, "loss_first": 718.365234375, "loss_last": 119.07048797607422, "loss_drop_fraction": 0.8342479810013784, "n_genes": 16, "inter_offdiag_nonzero": 0, "intra_offdiag_nonzero": 64, "collapsed_to_identity": false, "inter_offdiag_mean": 0.0, "intra_offdiag_mean": 0.06826440244913101}
predict_perturbation_counterfactual MCP Verified ✓

Predict the spatial counterfactual of a single-cell gene knockout with Simcomen, subtracting a paired control run.

Selftest Summary: IFITM3 knockout in cell cell88: effect 0.00825 at the perturbed cell, 0.00056 in its 6 neighbours, 0.00035 in distal cells (control-subtracted).
Metrics: {"gene": "IFITM3", "perturbed_cell_index": 88, "n_neighbors_of_perturbed": 6, "effect_perturbed": 0.008248630911111832, "effect_neighbors": 0.000561432505492121, "effect_distal": 0.00035245108301751316, "perturbed_over_distal": 23.40361913628156, "neighbors_over_distal": 1.5929373820770005, "target_gene_initial_gap": -0.5470561981201172, "target_gene_final_gap": -0.5064554810523987, "steps": 50}
rank_gene_interactions MCP Verified ✓

Rank the strongest gene pairs in a trained Celcomen model and group genes into intracellular modules.

Selftest Summary: Found 31 intracellular and 0 intercellular pairs above 0.010; 2 intracellular module(s) of sizes [8, 8]. Top intracellular pairs: STAT1-GBP1 (0.69), VIM-MKI67 (0.55), OLIG2-PDGFRA (0.54).
Metrics: {"n_genes": 16, "intra_pairs_above_threshold": 31, "inter_pairs_above_threshold": 0, "n_intra_modules": 2, "intra_module_sizes": [8, 8], "max_intra_weight": 0.685032844543457, "max_inter_weight": 0.0}

三、实测复现结果图展示

celcomen_loss_curve.png
训练损失:100 个 epoch,约 718.4 降到约 119.1
learned_g2g_heatmaps.png
学到的胞内(左)与胞间(右)基因-基因权重
counterfactual_spatial_effect.png
IFITM3 敲除的反事实效应(扣除对照)
spatial_graph.png
k=6 空间近邻图(196 个细胞)