sc-batch-integration
БесплатноБез исполняемых скриптовНе проверенLoad when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects. Skip…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-batch-integration
When to use
The user has a merged multi-sample AnnData (post-sc-multi-count or
similar) and needs to remove batch effects so downstream clustering /
annotation isn't dominated by per-sample technical variation. Seven
backends share one CLI: harmony (default), scvi, scanvi (requires
labels), bbknn, scanorama, simba, plus R-backed methods (e.g.
Seurat integration anchors). Quality is reported as LISI / ASW
diagnostics when available.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Merged multi-sample AnnData | .h5ad with obs["batch"] (or via --batch-key) |
yes (unless --demo) |
| Cell-type labels | obs["<labels-key>"] for scanvi |
only for --method scanvi |
| Output | Path | Notes |
|---|---|---|
| Integrated AnnData | processed.h5ad |
adds obsm["X_<method>"] for embedding-based methods (Harmony / scVI / scANVI / Scanorama / SIMBA); BBKNN modifies the neighbour graph and leaves obsm["X_pca"] as the embedding |
| Run summary | tables/integration_summary.csv |
parameters + run mode |
| Batch composition | tables/batch_sizes.csv, tables/batch_mixing_matrix.csv |
per-batch / per-cluster mixing |
| Cluster sizes | tables/cluster_sizes.csv |
cells per integrated cluster |
| Diagnostics | tables/integration_metrics.csv |
LISI + ASW when available |
| Report | report.md + result.json |
always written |
Flow
- Load merged AnnData; resolve
--batch-key(defaultbatch). - Validate backend prerequisites (e.g.
scanvineeds--labels-key). - Run the chosen
--method; write the integrated embedding toobsm["X_<method>"](BBKNN is the exception — it adjusts the neighbour graph in-place and leaves the embedding asobsm["X_pca"]). - Compute LISI / ASW diagnostics (best-effort; non-fatal if unavailable).
- Emit summary + batch-composition + diagnostics tables.
- Save
processed.h5ad+report.md+result.json.
Gotchas
scanvisilently falls back toscviwhen labels are missing.sc_integrate.py:189-193logs"scANVI requires labels; falling back to scVI latent integration"and writesresult["requested_method"] = "scanvi",result["executed_method"] = "scvi",result["fallback_used"] = True. After every--method scanvirun, verifyresult.json["executed_method"]matches the request;--labels-keymust be set and contain valid labels to actually get scANVI.simbamissing → hard fail.sc_integrate.py:242raisesImportErrorwhen--method simbaruns without thesimbapackage installed. Install viapip install simba/conda install -c bioconda simba/ from-source per the message. scvi-tools failures surface separately with their own ImportError further downstream.- Scanorama can return zero overlapping cells.
sc_integrate.py:349raisesRuntimeError("Scanorama did not produce 'X_scanorama' embeddings")when batches share no genes (typical: gene-namespace mismatch). Pre-runsc-standardize-inputon each batch. - R-backed methods can produce zero-overlap returns too.
sc_integrate.py:400raisesRuntimeError(f"R integration method '{method}' returned no overlapping cells")for the same root cause. - LISI / ASW diagnostics are best-effort.
sc_integrate.py:514and:529log"LISI diagnostics unavailable"/"ASW diagnostics unavailable"and continue when scIB or its dependencies are missing. Absence of metric rows intables/integration_metrics.csvdoes not imply integration quality is bad — it means the diagnostics could not be computed.
Key CLI
# Demo (Harmony on built-in two-batch dataset)
python omicsclaw.py run sc-batch-integration --demo --output /tmp/sc_integrate_demo
# Default Harmony on real data
python omicsclaw.py run sc-batch-integration \
--input merged.h5ad --output results/ \
--method harmony --batch-key sample_id
# scVI with explicit n_latent
python omicsclaw.py run sc-batch-integration \
--input merged.h5ad --output results/ \
--method scvi --batch-key sample_id --n-latent 30 --n-epochs 200
# scANVI (requires labels)
python omicsclaw.py run sc-batch-integration \
--input merged_with_labels.h5ad --output results/ \
--method scanvi --batch-key sample_id --labels-key cell_type
# BBKNN (graph-based — modifies neighbours, no obsm["X_bbknn"])
python omicsclaw.py run sc-batch-integration \
--input merged.h5ad --output results/ \
--method bbknn --batch-key sample_id
See also
references/parameters.md— every CLI flag and per-method tuning hintreferences/methodology.md— when each backend wins, GPU/CPU tradeoffs, label-aware vs label-free integrationreferences/output_contract.md—obsmkey conventions, diagnostic semantics- Adjacent skills:
sc-multi-count(upstream — produces the merged input),sc-clustering(downstream — runs on the integrated embedding via--use-rep X_<method>),sc-cell-annotation(downstream — label propagation across batches)
Установить sc-batch-integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-batch-integration?
Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects. Skip when the data is one sample (no batch effect to integrate) or for upstream merging only (use sc-multi-count).
Как установить скилл sc-batch-integration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-batch-integration запускает скрипты?
Нет, скилл состоит только из инструкций (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