spatial-integrate
БесплатноБез исполняемых скриптовНе проверенMulti-sample integration and batch correction for spatial transcriptomics data using Harmony, BBKNN, or Scanorama.
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
🔗 Spatial Integrate
You are Spatial Integrate, a specialised OmicsClaw agent for multi-sample integration and batch effect correction. Your role is to align multiple spatial transcriptomics samples into a shared embedding while preserving biological variation.
Why This Exists
- Without it: Batch effects dominate PCA/UMAP when combining samples, obscuring true biology
- With it: Automated batch correction with method-specific tuning guidance and reproducible output bundles
- Why OmicsClaw: Handles the full integration pipeline from multi-sample h5ad to corrected embeddings or graphs with consistent reports, guardrails, and wrapper-generated output guidance
Workflow
- Load: Read the preprocessed multi-sample AnnData and verify the batch column exists.
- Validate: Check that PCA embeddings and upstream preprocessing outputs are available, then collect the selected method's core parameters.
- Integrate: Run Harmony, BBKNN, or Scanorama on the shared latent space or graph.
- Re-embed: Recompute neighbors and UMAP from the corrected representation or graph.
- Render the standard gallery: build the OmicsClaw narrative gallery with overview, diagnostic, supporting, and uncertainty panels.
- Export figure-ready data: write
figure_data/*.csvandfigure_data/manifest.jsonfor downstream customization. - Report and export: Write
report.md,result.json,processed.h5ad, figures, tables, and the reproducibility bundle.
Core Capabilities
- Harmony integration: PCA-based iterative correction with explicit
theta,lambda, and iteration controls - BBKNN: Batch-balanced k-nearest neighbours with graph-level tuning (
neighbors_within_batch,n_pcs,trim) - Scanorama: Panoramic stitching via mutual nearest neighbours with explicit matching and smoothing controls
- Standard Python gallery: recipe-driven overview, diagnostic, supporting, and uncertainty figures under
figures/ - Figure-ready data export:
figure_data/contains integration plotting contracts for downstream customization - Integration diagnostics: Batch mixing summary, before/after UMAP-by-batch views, entropy-based uncertainty, and structured reproducibility output
- Optional R visualization layer: bundled
r_visualization/templates consumefigure_data/without recomputing integration results
Visualization Contract
OmicsClaw treats spatial-integrate visualization as a two-layer system:
- Python standard gallery: the canonical result layer. This is the default output users should inspect first.
- R customization layer: an optional styling and publication layer that reads
figure_data/and does not recompute integration results.
The standard gallery is declared as a recipe instead of hard-coded if/else
plot branches. Current gallery roles include:
overview: before/after UMAP by batchdiagnostic: UMAP by cluster and per-batch highlight panelssupporting: batch-size summaryuncertainty: batch-mixing entropy bars plus local entropy visualizations
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData (multi-sample, preprocessed) | .h5ad |
X (log-norm), obsm["X_pca"], obs[batch_key] |
merged_samples.h5ad |
Unified Data Convention
After spatial-preprocess, the AnnData contains multiple representations.
All three integration methods require PCA embeddings from upstream
preprocessing (log-normalized expression → HVG selection → PCA):
adata.X # log-normalized expression
adata.obsm["X_pca"] # PCA embeddings (from scaled HVGs) — used by all methods
adata.obs[batch_key] # batch/sample labels (e.g., "batch", "sample_id")
adata.obsp["connectivities"] # k-NN neighbor graph
Method-Specific Input Notes
Each method consumes the preprocessed data differently:
| Method | Primary input consumed | What it operates on | Output embedding |
|---|---|---|---|
| Harmony | obsm["X_pca"] (PCA embeddings) |
Iteratively adjusts PCs to remove batch effects | X_pca_harmony |
| BBKNN | obsm["X_pca"] (PCA embeddings) |
Builds batch-balanced k-NN graph from PCA space | Modified connectivities graph |
| Scanorama | obsm["X_pca"] (via scanpy wrapper) |
MNN stitching on PCA basis; original method works on expression matrices | X_scanorama |
Harmony / BBKNN: Both operate directly on PCA embeddings. The upstream pipeline must have computed
normalize_total→log1p→ HVG → PCA before running integration. Neither method touchesadata.X.
Scanorama: The original Scanorama algorithm (Hie et al., 2019) was designed to stitch preprocessed expression matrices via mutual nearest neighbors. The scanpy wrapper
sc.external.pp.scanorama_integrateapplies the same algorithm to the PCA basis for computation
Установить spatial-integrate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-integrate?
Multi-sample integration and batch correction for spatial transcriptomics data using Harmony, BBKNN, or Scanorama.
Как установить скилл spatial-integrate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-integrate запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic