期刊:Cell Reports Methods (2026-07-17) ·
DOI:10.1016/j.crmeth.2026.101530 ·
开源许可:MIT (allowed)
上游仓库:https://github.com/JiazhangCai/SpaDiff @ 0145bdd0278f
# 1. 解压并自动构建隔离环境 + 运行真实数据自测
unzip spadiff-mcp.zip && cd spadiff-mcp
bash install.sh
.venv/bin/python selftest.py
# 2. 接入 Claude Code / Antigravity / Cursor (Stdio MCP)
claude mcp add spadiff -- "$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
denoise_spatial_counts
MCP Verified ✓
Run SpaDiff mass-conserving score-guided reverse diffusion denoising on spatial transcriptomics count matrices (.h5ad or .npz).
{"n_spots": 600, "n_genes": 18, "mass_before": 14754.0, "mass_after": 14753.9970703125, "mass_retention": 0.9999998014309611, "max_gene_mass_delta": 0.00091552734375, "nonzero_before": 8192, "nonzero_after": 10477, "runtime_seconds": 0.8121790059994964}evaluate_spatial_quality
MCP Verified ✓
Quantify spatial autocorrelation (Moran's I via compute_gene_alpha_morans), expression concentration (Gini), regional separability (F-ratio, marker enrichment), and clustering Silhouette/ARI before vs after SpaDiff denoising.
{"n_spots": 600, "n_genes": 18, "moran_improved_pct": 100.0, "mean_moran_raw": 0.37842828035354614, "mean_moran_denoised": 0.7849109768867493, "gini_improved_pct": 0.0, "mean_gini_raw": 0.3664703315717473, "mean_gini_denoised": 0.27724246034144256, "enrichment_improved_pct": 28.57142857142857, "mean_enrichment_raw": 1.9774119028396044, "mean_enrichment_denoised": 1.770858241255197, "silhouette_raw": 0.13118236843312725, "silhouette_denoised": 0.47431699086485785}inspect_score_field
MCP Verified ✓
Detect tissue boundary and mirror ghost spots, trace the reverse-diffusion trajectory, and plot global and gene-specific KDE score vector fields.
{"n_spots": 600, "n_boundary_spots": 81, "n_ghost_spots": 81, "mean_global_score_norm": 0.29780787229537964, "initial_mass_entropy": 6.3646934035338445, "final_mass_entropy": 6.357107313641297}benchmark_spot_swapping
MCP Verified ✓
Simulate particle-level spot-swapping contamination (Gaussian, Laplace, or Cauchy kernel), apply SpaDiff denoising, and benchmark expression recovery via per-gene JSD and Pearson correlation.
{"n_spots": 600, "n_genes": 18, "median_jsd_contaminated": 0.3006207148044592, "median_jsd_denoised": 0.13204758433501693, "jsd_reduction_pct": 56.075021503122905, "mean_gene_corr_contaminated": 0.18067391860397097, "mean_gene_corr_denoised": 0.37719703640887947, "mass_retention": 0.9999997352412837}

