Command Palette

Search for a command to run...

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

sc-preprocessing

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

Base scRNA preprocessing after QC: QC-aware filtering, normalization, highly variable gene selection, and PCA.

mdbabumiamssmот mdbabumiamssm★ 36 звёзд на GitHub

Об этом скилле

🧫 Single-Cell Base Preprocessing

This skill is the base preprocessing stage for scRNA data. It stops at a normalized, PCA-ready object so that users can choose the next branch explicitly:

  • go to sc-batch-integration if multiple batches need correction
  • or go directly to sc-clustering if batch correction is not needed

Why This Exists

  • Without it: users manually chain QC-aware filtering, normalization, HVG selection, and PCA with inconsistent defaults.
  • With it: one run produces a stable normalized, PCA-ready AnnData plus standard OmicsClaw outputs.
  • Why OmicsClaw: the wrapper reuses shared single-cell canonicalization, QC, and filtering logic, and keeps a stable downstream contract.

Scope Boundary

Implemented methods:

  1. scanpy
  2. seurat
  3. sctransform
  4. pearson_residuals

Method-specific wrapper controls:

  • scanpy: normalization_target_sum, scanpy_hvg_flavor
  • seurat: seurat_normalize_method, seurat_scale_factor, seurat_hvg_method
  • sctransform: sctransform_regress_mt
  • pearson_residuals: pearson_hvg_flavor, pearson_theta

This skill does:

  1. reuse existing QC state when available, otherwise compute the minimum needed QC metrics
  2. filter cells and genes through the shared filtering logic
  3. normalize or transform the expression matrix
  4. select highly variable genes
  5. compute PCA
  6. export a normalized, PCA-ready processed.h5ad

This skill does not:

  1. remove ambient RNA
  2. remove doublets
  3. perform batch integration
  4. build the final neighbor graph, UMAP, or clusters
  5. annotate cells or run DE

Input Expectations

  • preferred input: raw-count-like AnnData or a QC-annotated count-oriented object
  • if QC metrics already exist, they are reused instead of recomputed
  • if the user has not reviewed QC yet and does not provide filtering thresholds, the recommended path is sc-qc first
  • the public output contract is:
    • X = normalized_expression
    • layers["counts"] = raw_counts
    • adata.raw = raw_counts_snapshot
    • obsm["X_pca"] available for downstream sc-clustering or sc-batch-integration

Workflow

  1. Load input through the shared single-cell loader.
  2. Preflight the matrix state, QC state, and method-specific requirements.
  3. Reuse existing QC metrics or canonicalize count-like input and compute the minimum needed QC metrics.
  4. Apply shared cell/gene filtering.
  5. Run the selected normalization / transformation backend.
  6. Select HVGs and compute PCA.
  7. Export processed.h5ad, figures, tables, figure_data/, report.md, and result.json.

Downstream Branching

After this skill:

  • if batch/sample effects are expected: run sc-batch-integration
  • otherwise: run sc-clustering
  • doublet removal: sc-preprocessing removes doublets automatically during filtering when predicted_doublet or doublet_score columns (from sc-doublet-detection) are present. Pass --no-remove-doublets to opt out. Run sc-doublet-detection → sc-preprocessing to activate.

Output Contract

Successful runs write:

  • processed.h5ad
  • report.md
  • result.json
  • figures/manifest.json
  • figure_data/manifest.json
  • tables/preprocess_summary.csv
  • tables/hvg_summary.csv
  • tables/pca_variance_ratio.csv
  • tables/pca_embedding.csv
  • tables/qc_metrics_per_cell.csv

Workflow Position

  • Upstream step: sc-filter (recommended) or directly from sc-count / sc-qc
  • Usual next step: sc-batch-integration (multiple batches) or sc-clustering (single batch)

CLI Parameters

Flag Type Default Description Validation
--input path — Input AnnData file (.h5ad); required unless --demo —
--output path — Output directory (required) —
--demo flag false Run with built-in demo data —
--method enum scanpy Preprocessing backend: scanpy, seurat, sctransform, pearson_residuals —
--min-genes int 200 (per method default) Minimum detected genes per retained cell Must be >= 0
--min-cells int 3 (per method default) Minimum cells expressing a retained gene Must be >= 0
--max-mt-pct float 20.0 (per method default) Maximum mitochondrial percentage Must be in [0, 100]
--n-top-hvg int 2000 (per method default) Number of highly variable genes to select Must be >= 1
--n-pcs int 50 (per method default) Number of principal components Must be >= 1
--normalization-target-sum float 10000.0 Total counts per cell after normalization (scanpy only) Must be >= 1
--scanpy-hvg-flavor enum seurat HVG selection flavor: seurat, cell_ranger, seurat_v3 (scanpy only) —
--pearson-hvg-flavor enum seurat_v3 HVG flavor for Pearson residuals: seurat_v3, seurat (pearson_residuals only) —
--pearson-theta float 100.0 Negative binomial theta for Pearson residuals (pearson_resi
Полный SKILL.md на GitHub

Установить sc-preprocessing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл sc-preprocessing?

Base scRNA preprocessing after QC: QC-aware filtering, normalization, highly variable gene selection, and PCA.

Как установить скилл sc-preprocessing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sc-preprocessing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить sc-preprocessing с