期刊:Nature Communications (2026-02-28) ·
DOI:10.1038/s41467-026-70069-z ·
开源许可:MIT (allowed)
上游仓库:https://github.com/huBioinfo/HRCHY-CytoCommunity @ 19a62cef9968
# 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
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.
{"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.
{"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.
{"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.
{"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}

