sc-perturb
БесплатноБез исполняемых скриптовНе проверенLoad when classifying perturbed vs non-perturbed cells in a Perturb-seq / CRISPR-screen scRNA AnnData via the pertpy Mixscape workflow. Skip when guide labels…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-perturb
When to use
The user has a scRNA AnnData from a CRISPR perturbation screen
(Perturb-seq style) where each cell already carries a perturbation
label in obs[--pert-key] plus a control category. The skill runs
pertpy's Mixscape workflow to:
- Compute a per-cell perturbation signature (subtracts the matched
control profile in
obsm["X_pca"]). - Classify cells as
KO/NT/NP(non-perturbed / escapers). - Report responder vs non-responder structure per perturbation +
--split-bygroup.
Single backend: mixscape (forward-compatible CLI choice). For
attaching guide labels to expression first, use sc-perturb-prep. For
predicting perturbation effects on unperturbed data, use
sc-in-silico-perturbation.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Perturb-seq AnnData | .h5ad with obs[--pert-key] containing perturbation labels + --control value |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Annotated AnnData | processed.h5ad |
adds Mixscape obs["mixscape_class"] / obs["mixscape_class_global"] / obs["mixscape_class_p_<lower(perturbation_type)>"] (one column per perturbation type, e.g. mixscape_class_p_ko for --perturbation-type KO) |
| Per-perturbation × class | tables/mixscape_class_counts.csv |
always |
| Global class totals | tables/mixscape_global_class_counts.csv |
always |
| Per-cell class | tables/mixscape_cell_classes.csv |
always |
| Figure | figures/mixscape_global_classes.png |
always |
| Report | report.md + result.json |
always |
Flow
- Load AnnData (
--input) or generate demo Perturb-seq data. - Validate
obs[--pert-key]exists and--controlis a real category in that column. - Warn-and-disable
--split-byif the column is absent (does NOT raise). - Compute
obsm["X_pca"]if missing (auto-runssc.pp.pca). - Run
pertpy.tools.Mixscape(perturbation signature + KO/NT/NP classification). - Detect degenerate output (e.g., everything classified as
NP) and write troubleshooting hints. - Save
processed.h5ad, tables, figure,report.md,result.json.
Gotchas
- All preflight failures
raise SystemExit, notValueError.sc_perturb.py:228raisesSystemExit("Provide --input or use --demo");:235raisesSystemExit("Perturbation column '<key>' not found in adata.obs. ...")with multi-option fix hints;:246raisesSystemExit("Control label '<label>' not found in adata.obs['<key>']. Available labels: <list>"). Wrappers expecting standardValueErrorneed to catchSystemExithere. --split-bymissing is a soft warning, not a fail. When--split-by(defaultreplicate) doesn't exist inobs,sc_perturb.py:255-261logs a warning and silently disables the split. The Mixscape run continues without replicate awareness —result.json["params"]["split_by"]will reflect the disablement.- PCA is computed automatically when missing.
sc_perturb.py:264-266callssc.pp.pca(adata)ifobsm["X_pca"]is absent — no upstreamsc-preprocessingstrictly required, but the implicit PCA uses defaults (no batch correction, no HVG). For real screens prefer runningsc-preprocessingfirst so the PCA reflects HVG-selected normalised data. - Degenerate output (everything
NP) is a soft fail.sc_perturb.py:85defines_detect_degenerate_outputwhich records diagnostics and writes troubleshooting hints toreport.md(seesc_perturb.py:141+); the script does NOT raise. Always inspectresult.json["n_classes"](:382) — if it's 1, Mixscape didn't separate populations and the run is uninformative. --method mixscapeis the only choice.sc_perturb.py:72argparsechoices=["mixscape"].--methodexists for forward-compatibility; today any other value is rejected by argparse before the script runs.
Key CLI
# Demo (synthetic Perturb-seq)
python omicsclaw.py run sc-perturb --demo --output /tmp/sc_perturb_demo
# Default: input has standard column names (perturbation / NT)
python omicsclaw.py run sc-perturb \
--input perturb_prep_output/processed.h5ad --output results/
# Custom column / control names
python omicsclaw.py run sc-perturb \
--input data.h5ad --output results/ \
--pert-key guide_target --control non-targeting --split-by donor
# Tune Mixscape DE thresholds
python omicsclaw.py run sc-perturb \
--input data.h5ad --output results/ \
--logfc-threshold 0.5 --pval-cutoff 0.01 --n-neighbors 30
See also
references/parameters.md— every CLI flag, Mixscape tunablesreferences/methodology.md— Mixscape signature subtraction; KO/NT/NP semanticsreferences/output_contract.md—obs["mixscape_class"]/obs["mixscape_class_global"]schema + table layouts- Adjacent skills:
sc-perturb-prep(upstream — attaches guide labels to the expression object),sc-de(downstream — DE between perturbed and control),sc-in-silico-perturbation(parallel — predicts perturbation effects WITHOUT a real s
Установить sc-perturb в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-perturb?
Load when classifying perturbed vs non-perturbed cells in a Perturb-seq / CRISPR-screen scRNA AnnData via the pertpy Mixscape workflow. Skip when guide labels are not yet attached to the expression object (run sc-perturb-prep first) or for in-silico KO predictions on unperturbed data (use sc-in-silico-perturbation).
Как установить скилл sc-perturb?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-perturb запускает скрипты?
Нет, скилл состоит только из инструкций (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