Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

spatial-integrate

БесплатноБез исполняемых скриптовНе проверен

Multi-sample integration and batch correction for spatial transcriptomics data using Harmony, BBKNN, or Scanorama.

mdbabumiamssmот 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

  1. Load: Read the preprocessed multi-sample AnnData and verify the batch column exists.
  2. Validate: Check that PCA embeddings and upstream preprocessing outputs are available, then collect the selected method's core parameters.
  3. Integrate: Run Harmony, BBKNN, or Scanorama on the shared latent space or graph.
  4. Re-embed: Recompute neighbors and UMAP from the corrected representation or graph.
  5. Render the standard gallery: build the OmicsClaw narrative gallery with overview, diagnostic, supporting, and uncertainty panels.
  6. Export figure-ready data: write figure_data/*.csv and figure_data/manifest.json for downstream customization.
  7. Report and export: Write report.md, result.json, processed.h5ad, figures, tables, and the reproducibility bundle.

Core Capabilities

  1. Harmony integration: PCA-based iterative correction with explicit theta, lambda, and iteration controls
  2. BBKNN: Batch-balanced k-nearest neighbours with graph-level tuning (neighbors_within_batch, n_pcs, trim)
  3. Scanorama: Panoramic stitching via mutual nearest neighbours with explicit matching and smoothing controls
  4. Standard Python gallery: recipe-driven overview, diagnostic, supporting, and uncertainty figures under figures/
  5. Figure-ready data export: figure_data/ contains integration plotting contracts for downstream customization
  6. Integration diagnostics: Batch mixing summary, before/after UMAP-by-batch views, entropy-based uncertainty, and structured reproducibility output
  7. Optional R visualization layer: bundled r_visualization/ templates consume figure_data/ without recomputing integration results

Visualization Contract

OmicsClaw treats spatial-integrate visualization as a two-layer system:

  1. Python standard gallery: the canonical result layer. This is the default output users should inspect first.
  2. 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 batch
  • diagnostic: UMAP by cluster and per-batch highlight panels
  • supporting: batch-size summary
  • uncertainty: 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 touches adata.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_integrate applies the same algorithm to the PCA basis for computation

Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить spatial-integrate с