Paper2MCP v2 Verified Deliverable

SOFisher: reinforcement learning-guided experiment designs for spatial omics

期刊:Nature Communications (2026-05-25) · DOI:10.1038/s41467-026-73404-6 · 开源许可:MIT (allowed)

上游仓库:https://github.com/Heathcliff-Ng/SOFisher @ 7f072dc80e1b

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

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

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

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

sofisher_train_policy MCP Verified ✓

Train a SOFisher Deep Q-Network (DQN) FOV-selection policy on a spatial omics slice CSV containing cell coordinates, cell-type annotations, and target tissue landmark labels.

Selftest Summary: Trained SOFisher DQN policy for 80 steps (4 episodes) on 2128 cells (19 cell types, 825 'Follicle' targets); best eval reward=170.00, mean eval hits=23.75.
Metrics: {"total_steps": 80, "episodes_completed": 4, "final_train_reward": -134.8, "best_eval_reward": 170.0, "mean_eval_hits": 23.75, "obs_dim": 494, "n_cell_types": 19, "n_cells": 2128, "n_targets": 825}
sofisher_plan_fov_sequence MCP Verified ✓

Plan sequential spatial omics FOV coordinates on an unseen tissue slice using a trained SOFisher or SOFisherWR (With Restart) policy without exposing unobserved landmarks.

Selftest Summary: Planned 25 sequential FOVs using SOFisher (ad_dual, rs=500.0): total_target_hits=30.70, first_hit_step=3, unique_cell_coverage=9.2%.
Metrics: {"n_fovs_planned": 25, "total_target_hits": 30.7, "mean_hits_per_fov": 1.228, "first_hit_step": 3, "unique_coverage_fraction": 0.0921, "scenario": "ad_dual", "use_restart": false}
sofisher_benchmark_policies MCP Verified ✓

Statistically benchmark SOFisher (and SOFisherWR) against Random Sampling across Monte Carlo trajectories with Wilcoxon rank-sum testing.

Selftest Summary: Benchmarked SOFisher vs Random over 8 trials (25 FOVs each, crc): SOFisher=199.88±77.36 vs Random=83.88±30.42 (2.38x, Wilcoxon p=8.65e-03).
Metrics: {"sofisher_mean_hits": 199.875, "sofisher_std_hits": 77.3554, "random_mean_hits": 83.875, "random_std_hits": 30.4238, "sofisher_wr_mean_hits": 176.375, "improvement_ratio_vs_random": 2.383, "wilcoxon_p_value": 0.008651541533947532, "sofisher_mean_first_hit_step": 3.25, "random_mean_first_hit_step": 1.88, "sofisher_mean_steps_to_goal": 12.5, "random_mean_steps_to_goal": 23.88}
sofisher_evaluate_niche_capture MCP Verified ✓

Evaluate downstream biological representativeness by comparing cell-type proportions captured in SOFisher vs Random FOVs against ground-truth target niches.

Selftest Summary: Evaluated niche capture (crc, 25 FOVs × 5 trials): SOFisher Pearson r=0.969 vs Random r=0.939; target-niche cell fraction=55.1% vs Random 48.0%.
Metrics: {"scenario": "crc", "sofisher_niche_pearson_r": 0.9694, "sofisher_niche_pearson_p": 3.705631853165852e-06, "random_niche_pearson_r": 0.939, "random_niche_pearson_p": 5.635595652072958e-05, "sofisher_target_cell_fraction": 0.5512, "random_target_cell_fraction": 0.4804, "ground_truth_target_cell_fraction": 0.3877, "n_cells_captured_sofisher": 976, "n_cells_captured_random": 868}

三、实测复现结果图展示

ad_dual_landmark_sampling.png
crc_tls_benchmark.png
niche_capture_and_generalization.png