Paper2MCP v2 Verified Deliverable

Spatially resolved host and microbiota RNA profiling in the mouse gut using microDBiT

期刊:Nature Communications (2026-10-19) · DOI:10.1038/s41467-026-78852-8 · 开源许可:unknown (restricted)

上游仓库:https://github.com/edicliuyang/Microbiome @ 752c0adcd1fc

Pytest: passed MCP Stdio Selftest: passed Relocated Fresh Install: passed
请先读这里:验证数据是合成的。上游仓库(edicliuyang/Microbiome)只提供 notebook、R 脚本与 st_pipeline 脚本,没有计数矩阵、GTF 注释或物种映射表,因此无法在论文原始数据上复现。本包把 notebook 中的 Python 分析函数移植为工具,并在由模拟器生成的“宿主 + 3 种细菌”切片(及一张无菌切片)上完成 pytest、MCP 自测和换目录重装自测。下方的指标与图片只证明工具链路与计算逻辑正确;例如免疫基因在定植切片某个簇中上调,是模拟器预先埋入的信号,不是生物学发现。与论文流程的差异:sctransform 以文库大小归一化 + log1p + 缩放替代;GTF 查询以 gene,biotype CSV 替代;Harmony 参考批次 GF 在本次安装的 harmonypy 中不可用,整合时未使用参考批次;FASTQ 到矩阵(st_pipeline)、R 脚本、MATLAB 图像处理未封装。上游许可证未声明,工具包不内置仓库代码。

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

# 1. 解压并自动构建隔离环境 + 运行合成夹具自测
unzip microdbit-mcp.zip && cd microdbit-mcp
bash install.sh
.venv/bin/python selftest.py

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

annotate_host_microbe_counts MCP Verified ✓

把 spot × 基因计数表拆成宿主与细菌 UMI,按物种和 mRNA/rRNA/tRNA 分类汇总,输出带注释的 h5ad、逐 spot UMI 表和空间 UMI 图(移植自 notebook 的 get_spatialmeta / get_varmeta / get_umi)。

Selftest Summary: Annotated 256 spots: 124 host genes, 60 bacterial genes from 3 species; bacteria are 12.6% of UMIs; 116 spots exceed 5 bacterial UMIs.
Metrics: {"n_spots": 256, "n_host_genes": 124, "n_bacterial_genes": 60, "n_bacterial_species": 3, "host_umi_total": 33805.0, "bac_umi_total": 4873.0, "bac_umi_fraction": 0.126, "spots_with_bac_umi_above_threshold": 116, "top_species": "Bovatus"}
summarize_bacterial_composition MCP Verified ✓

统计细菌 UMI 的物种占比、biotype 占比以及各物种的 RNA 类别构成(对应 umi_barplot / var_barplot / circle_chart)。

Selftest Summary: Bacterial UMIs span 3 species; B. ovatus dominates with 44.1% of bacterial UMIs. Biotype shares: protein_coding 57.4%, rRNA 39.1%, tRNA 3.5%.
Metrics: {"n_species": 3, "top_species": "B. ovatus", "top_species_fraction": 0.4414, "species_fractions": {"B. ovatus": 0.4414, "L. reuteri": 0.2984, "A. muciniphila": 0.2602}, "biotype_fractions": {"protein_coding": 0.5736, "rRNA": 0.3913, "tRNA": 0.0351}, "bacterial_rrna_fraction": 0.3913}
integrate_condition_sections MCP Verified ✓

在共有宿主基因上整合定植切片与无菌(GF)切片:归一化、PCA、Harmony、UMAP、Leiden(对应 vis_comparison;以文库大小归一化替代 sctransform,且本次安装的 harmonypy 不支持参考批次)。

Selftest Summary: Integrated 452 spots (BacteriaMix + GF) over 124 shared host genes with Harmony; Leiden (resolution 0.35) found 3 clusters.
Metrics: {"n_spots": 452, "n_shared_genes": 124, "n_pcs": 10, "n_clusters": 3, "cluster_by_condition": {"0": {"BacteriaMix": 64, "GF": 56}, "1": {"BacteriaMix": 80, "GF": 70}, "2": {"BacteriaMix": 112, "GF": 70}}, "harmony_reference_values_supported": false}
test_condition_differential_expression MCP Verified ✓

对整合结果按簇比较 BacteriaMix 与 GF 的差异表达(t-test,对应 diffgenes)。

Selftest Summary: Tested 3 clusters (BacteriaMix vs GF): 6 genes up and 0 down at adj. p < 0.05 and |logFC| > 0.5.
Metrics: {"n_clusters_tested": 3, "clusters_skipped": [], "n_up": 6, "n_down": 0, "per_cluster": {"0": {"up": 0, "down": 0}, "1": {"up": 6, "down": 0}, "2": {"up": 0, "down": 0}}, "top_up_genes": [{"cluster": "1", "gene": "Jchain", "logfc": 6.291}, {"cluster": "1", "gene": "Cxcl13", "logfc": 5.757}, {"cluster": "1", "gene": "Igkc", "logfc": 5.894}, {"cluster": "1", "gene": "Cd79a", "logfc": 5.211}, {"cluster": "1", "gene": "Ighm", "logfc": 5.178}]}
map_species_colocalization MCP Verified ✓

计算细菌物种 mRNA 或 rRNA UMI 在 spot 间的 Pearson 相关并绘制聚类热图(对应 correlationmap)。

Selftest Summary: Correlated 3 species on mRNA UMIs over 256 spots: most co-localised Bovatus/Akkermansia (r=0.51), most segregated Bovatus/Lreuteri (r=-0.21).
Metrics: {"rna_class": "mRNA", "n_species": 3, "n_spots": 256, "most_colocalized_pair": {"pair": ["Bovatus", "Akkermansia"], "r": 0.5099}, "most_segregated_pair": {"pair": ["Bovatus", "Lreuteri"], "r": -0.2061}, "mean_pairwise_r": 0.2486}

三、复现结果图展示(合成夹具生成,非论文数据)

bacterial_composition.png
integrated_umap.png
spatial_umi_maps.png
species_mRNA_colocalization.png