Paper2MCP v2 Verified Deliverable

HRCHY-CytoCommunity identifies hierarchical tissue organization in cell-type spatial maps

期刊:Nature Communications (2026-02-28) · DOI:10.1038/s41467-026-70069-z · 开源许可:MIT (allowed)

上游仓库:https://github.com/huBioinfo/HRCHY-CytoCommunity @ 19a62cef9968

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

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

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

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

Convert a cell-type annotated spatial map (CSV/TSV with x, y, cell_type columns, or an h5ad with obsm spatial) into the HRCHY-CytoCommunity input folder using the repository preprocessing code: coordinates, cell-type labels, one-hot node attributes and a symmetric KNN edge list.

Selftest Summary: Built HRCHY-CytoCommunity input for 5926 cells, 15 cell types, symmetric KNN graph with k=20.
Metrics: {"sample_id": "bregma-0.14", "n_cells": 5926, "n_cell_types": 15, "cell_types": ["Astrocyte", "Endothelial 1", "Endothelial 2", "Endothelial 3", "Ependymal", "Excitatory", "Inhibitory", "Microglia", "OD Immature 1", "OD Immature 2", "OD Mature 1", "OD Mature 2", "OD Mature 3", "OD Mature 4", "Pericytes"], "k": 20, "n_directed_edges": 129852, "mean_degree": 21.91, "has_fine_gt": true, "has_coarse_gt": false}
run_hrchy_cytocommunity MCP Verified ✓

Train the HRCHY-CytoCommunity graph neural network (MinCut pooling, edge pruning, consistency and balance regularisation) on one prepared sample and return per-cell fine-grained neighbourhood (CN) and coarse-grained tissue compartment (TC) assignments, with AMI/ARI against ground truth when provided.

Selftest Summary: Trained HRCHY-CytoCommunity (full) for 60 epochs on 5926 cells; used 4/12 fine CNs and 1/2 coarse TCs.
Metrics: {"sample_id": "bregma-0.14", "mode": "full", "device": "cpu", "epochs": 60, "seed": 0, "n_cells": 5926, "n_fine_used": 4, "n_coarse_used": 1, "train_sec": 23.69, "nesting": "coarse labels are derived from fine-cluster membership, so nesting holds by construction", "ami_fine_vs_gt": 0.2135, "ari_fine_vs_gt": 0.0919, "first_logged_loss": 0.3191, "final_logged_loss": 0.2179}
plot_hierarchy_maps MCP Verified ✓

Draw side-by-side spatial maps of the ground-truth annotation (if present), the fine-grained CNs and the coarse-grained TCs.

Selftest Summary: Saved hierarchy spatial maps.
Metrics: {"n_cells": 5926, "n_fine": 12, "n_coarse": 2, "panels": ["Annotated regions (fine GT)", "Fine-grained CNs (n=12)", "Coarse-grained TCs (n=2)"]}
summarize_hierarchy MCP Verified ✓

Characterise a discovered hierarchy: cell-type composition and log2 enrichment per fine CN, parent TC, CN purity, nesting-consistency check and AMI/ARI against ground truth when present.

Selftest Summary: Summarised 12 fine CNs nested in 2 coarse TCs.
Metrics: {"n_cells": 5926, "n_fine": 12, "n_coarse": 2, "nesting_consistent": true, "weighted_cn_purity": 0.5192, "largest_cn_fraction": 0.1507, "smallest_cn_fraction": 0.0027, "ami_fine_vs_gt": 0.2448, "ari_fine_vs_gt": 0.1467}
如何阅读本页的数字

三、实测复现结果图展示

merfish_cn_composition.png
merfish_hierarchy_maps.png
merfish_training_curves.png