期刊:Nature Communications (2026-03-27) · DOI:10.1038/s41467-026-70821-5 · 开源许可:GPL-3.0
上游仓库:https://github.com/Xubin-s-Lab/SMART-main @ b534965ce056
# 1. 解压并构建隔离环境(含 R 的 mclust)+ 运行真实数据自测
unzip smart-mcp.zip && cd smart-mcp
bash install.sh
.venv/bin/python selftest.py
# 2. 接入 Claude Code / Antigravity / Cursor (Stdio MCP)
claude mcp add smart -- "$PWD/.venv/bin/python" "$PWD/server.py"
说明:SMART 融合 RNA 与蛋白后 ARI 比仅用 RNA 提高,但在这张切片上幅度有限,未做调参。教程 2 使用 A1 切片,本次为 D1,数值不可直接与论文最佳结果比较。仓库 smart.utils.clustering 的 kmeans/gmm 分支在当前 numpy 下会抛 TypeError,工具包已绕过,未修改上游代码。
preprocess_multiomics_dataMCP Verified ✓Prepare spatial RNA + protein data for SMART: HVG selection, normalisation, CLR for protein, PCA of both modalities and a spatial KNN graph.
{"n_spots": 3359, "n_genes_used": 1000, "n_proteins": 31, "rna_pcs": 30, "adt_pcs": 30, "n_edges": 20154, "mean_neighbors_per_spot": 6.0}train_smart_embeddingMCP Verified ✓Train the SMART graph autoencoder with triplet metric learning and return the shared multi-omic embedding.
{"epochs_run": 30, "epochs_requested": 30, "total_loss_first": 4.594939231872559, "total_loss_last": 3.412400484085083, "reconstruction_loss_last": 3.3936171531677246, "triplet_loss_last": 0.018783297389745712, "n_triplets_rna": 1350, "n_triplets_adt": 3180, "embedding_shape": [3359, 64]}cluster_spatial_domainsMCP Verified ✓Cluster the SMART embedding into spatial domains (mclust by default) and score ARI/NMI against an optional annotation.
{"method": "mclust", "n_clusters_requested": 7, "n_clusters_found": 7, "n_spots": 3359, "ari": 0.27866275072049124, "nmi": 0.3775188161556066, "n_annotated_spots": 3359}plot_spatial_domainsMCP Verified ✓Plot SMART domains on tissue coordinates next to the manual annotation and a UMAP of the embedding.
{"n_panels": 3, "n_spots": 3359, "n_domains": 7}

