Paper2MCP v2 Verified Deliverable

Visual LLM-guided consensus spatial domain detection with L-STAR

期刊:Nature Communications (2026-11-03) · DOI:10.1038/s41467-026-78923-w · 开源许可:MIT (allowed)

上游仓库:https://github.com/Williamzcy0929/L-STAR @ 6b6d2b59d4ce

Pytest: passed MCP Stdio Selftest: passed Relocated Fresh Install: passed
复现范围说明:本次复现只覆盖 L-STAR 中不依赖 LLM 的环节(出图、比较记录汇总排名、EAC 共识聚类、ARI 评估),调用的是上游 lstar 0.8.0 的真实函数。LLM 比较与域注释需要 OPENAI_API_KEY,未运行。基准数据为合成的 20x20 组织(5 个层状域、6 个模拟方法),比较记录由合成评委(带噪声的 ARI)生成,不是 LLM 输出,也不是论文数据。在该合成基准上,共识 ARI 为 0.722,最佳单方法 GraphST 为 0.804,6 个方法平均 0.477。R/Palo 不可用,出图使用上游 matplotlib 备用路径,并带有 get_cmap 兼容垫片。

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

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

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

generate_domain_images MCP Verified ✓

Render one spatial-domain map per candidate method plus a montage (L-STAR step 1, via lstar.image_generation).

Selftest Summary: Rendered 6 spatial-domain maps for 400 spots (renderer: matplotlib).
Metrics: {"n_methods": 6, "n_spots": 400, "methods": ["GraphST", "STAGATE", "SpaGCN", "BayesSpace", "SEDR", "stLearn"]}
rank_methods_from_comparisons MCP Verified ✓

Aggregate recorded LLM comparison results (all-wise or pairwise JSONL) into a method ranking; makes no LLM call.

Selftest Summary: Ranked 6 methods from allwise comparisons; top method: GraphST (score=4.800).
Metrics: {"mode": "allwise", "score_column": "score", "n_methods": 6, "ranking": [{"model": "GraphST", "score": 4.8}, {"model": "STAGATE", "score": 4.2}, {"model": "SpaGCN", "score": 2.8}, {"model": "SEDR", "score": 2.0}, {"model": "BayesSpace", "score": 1.2}, {"model": "stLearn", "score": 0.0}]}
build_consensus_domains MCP Verified ✓

Select top-ranked methods and build the L-STAR EAC consensus domain map (lstar.consensus.run_consensus_clustering).

Selftest Summary: Consensus of 3 methods (GraphST, STAGATE, SpaGCN) gave 5 domains over 400 spots.
Metrics: {"selected_methods": ["GraphST", "STAGATE", "SpaGCN"], "n_domains": 5, "n_spots": 400, "domain_sizes": {"0": 88, "1": 81, "2": 89, "3": 75, "4": 67}}
evaluate_domain_consensus MCP Verified ✓

Score the consensus and each candidate method against a reference annotation with ARI and plot the comparison.

Selftest Summary: Consensus ARI 0.722; best single method GraphST ARI 0.804; mean of all methods 0.477.
Metrics: {"consensus_ari": 0.7220982287353311, "method_ari": {"GraphST": 0.8044822297032979, "STAGATE": 0.7260627515283177, "SpaGCN": 0.4660623901687422, "BayesSpace": 0.34846380412868005, "SEDR": 0.3284887145793607, "stLearn": 0.18814335790373068}, "best_method": "GraphST", "mean_method_ari": 0.4769505413353548, "n_spots": 400}

三、实测复现结果图展示

ari_consensus_vs_methods.png
candidate_method_domain_maps.png
reference_vs_consensus_vs_best.png