sc-preprocessing
БесплатноБез исполняемых скриптовНе проверенLoad when normalising QC'd scRNA into a PCA-ready AnnData via scanpy / Seurat / SCTransform / Pearson residuals. Skip when QC thresholds are still undecided…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-preprocessing
When to use
The user has a filtered, QC-annotated AnnData and wants the standard
"normalise → HVG → PCA" pipeline before clustering or batch
integration. Four interchangeable backends are available: scanpy
(default; CP10k log + HVG seurat flavour), seurat (R-backed
LogNormalize / CLR / RC), sctransform (R-backed regularised NB), and
pearson_residuals (raw-count HVG selection plus Pearson residual
transformation). The skill stops at PCA — UMAP / clustering live in
sc-clustering, multi-sample correction in sc-batch-integration.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Filtered AnnData | .h5ad (raw-count-like or QC-annotated) |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Processed AnnData | processed.h5ad |
X = normalised, layers["counts"] = raw, obsm["X_pca"], var["highly_variable"], adata.raw populated |
| Run summary | tables/preprocess_summary.csv |
always |
| HVG table | tables/hvg_summary.csv |
top-N HVGs |
| PCA variance | tables/pca_variance_ratio.csv |
per-PC variance + cumulative |
| PCA embedding | tables/pca_embedding.csv |
first 5 PCs per cell |
| Per-cell QC | tables/qc_metrics_per_cell.csv |
retained QC metrics |
| Report | report.md + result.json |
always |
Flow
- Load AnnData; infer species; canonicalise gene-name / expression layout via the shared single-cell standardiser.
- Reuse existing QC if
n_genes_by_counts/total_counts/pct_counts_mtare present inobs; otherwise compute them. - Apply shared filtering (
--min-genes,--min-cells,--max-mt-pct); drop doublets whenpredicted_doublet/doublet_scorecolumns are present (opt out via--no-remove-doublets). - Run the chosen normalisation backend (
scanpy/seurat/sctransform/pearson_residuals). - Select HVGs (
--n-top-hvg) and compute PCA (--n-pcs). - Save
processed.h5ad, tables, figures,report.md,result.json.
Gotchas
result.json["n_pcs_used"]may be smaller than the requested--n-pcs.sc_preprocess.py:876readsobsm["X_pca"].shape[1]after PCA — small matrices cap the count below the request. Trustn_pcs_used, not the input flag, when handing off tosc-clustering --n-pcs.- R-backed
seurat/sctransformneed a workingRscriptenv.sc_preprocess.py:271raisesRuntimeError("Seurat preprocessing returned no overlapping cells or genes")when the R round-trip empties the matrix;sc_preprocess.py:296raisesRuntimeError("Seurat preprocessing returned PCA rows that do not align with exported cells")when the R-side PCA shape disagrees with the cell list. ConfirmSeurat,SingleCellExperiment,zellkonverter(andsctransformfor that method) are installed before picking these methods. - Doublet filter is on-by-default whenever
sc-doublet-detectionran.sc_preprocess.py:510-511passesfilter_doublets=Trueanddoublet_score_threshold=0.25when those columns exist inobs. To keep the called-doublet rows, pass--no-remove-doublets. figure_data/gene_expression.csvwrite failures are silent.sc_preprocess.py:670-672catches the exception and only logs a warning —figure_data/manifest.jsonis the source of truth for which figure-data files actually landed.--inputis mandatory unless--demo.sc_preprocess.py:1013raisesValueError("--input required when not using --demo").
Key CLI
# Demo (built-in synthetic data)
python omicsclaw.py run sc-preprocessing --demo --output /tmp/sc_preprocess_demo
# Default scanpy backend
python omicsclaw.py run sc-preprocessing \
--input filtered.h5ad --output results/
# R-backed Seurat LogNormalize
python omicsclaw.py run sc-preprocessing \
--input filtered.h5ad --output results/ \
--method seurat --seurat-normalize-method LogNormalize
# Pearson residuals (recommended for very sparse / heterogeneous data)
python omicsclaw.py run sc-preprocessing \
--input filtered.h5ad --output results/ \
--method pearson_residuals --n-top-hvg 3000
See also
references/parameters.md— every CLI flag and per-method tuning hintreferences/methodology.md— when each backend wins; canonicalisation contractreferences/output_contract.md—obs/obsm/layers/unsschema + table layouts- Adjacent skills:
sc-qc/sc-filter(upstream — produce the input),sc-batch-integration(parallel — multi-sample alternative path; consumesobsm["X_pca"]),sc-clustering(downstream — consumesobsm["X_pca"]for neighbour-graph + UMAP + Leiden)
Установить sc-preprocessing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-preprocessing?
Load when normalising QC'd scRNA into a PCA-ready AnnData via scanpy / Seurat / SCTransform / Pearson residuals. Skip when QC thresholds are still undecided (use sc-qc) or for batch correction across samples (use sc-batch-integration).
Как установить скилл sc-preprocessing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-preprocessing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic