sc-ambient-removal
БесплатноБез исполняемых скриптовНе проверенLoad when removing ambient RNA contamination from droplet-based scRNA-seq using a simple subtraction path, CellBender, or SoupX. Skip when the contamination…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-ambient-removal
When to use
The user has filtered (or raw + filtered) droplet-based scRNA-seq counts
and suspects ambient RNA from cell-free droplets is inflating per-cell
expression — typical for 10X data with high droplet density. Three
backends share the CLI: simple (a deterministic ambient-profile
subtraction, default), cellbender (Python, requires GPU for sensible
runtime), and soupx (R via rpy2; needs raw + filtered matrices).
Doublets are a different problem — use sc-doublet-detection for
multiplet barcodes.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Filtered single-cell AnnData | .h5ad |
yes (unless --demo) |
| Raw matrix (SoupX) | 10X mtx dir via --raw-matrix-dir |
only for --method soupx |
| Output | Path | Notes |
|---|---|---|
| Cleaned AnnData | processed.h5ad |
adata.X overwritten with corrected counts; layers["counts"] preserves the pre-correction matrix; uns["ambient_correction"] (simple) / uns["soupx"] / uns["cellbender"] carries diagnostics |
| Diagnostic figures | figures/counts_comparison.png, figures/count_distribution.png, figures/barcode_rank.png |
always rendered |
| Report | report.md + result.json |
always written |
Flow
- Load filtered AnnData; optionally load raw matrix (SoupX requires both).
- Validate
--contaminationis in[0, 1)and--expected-cellsis positive when set. - Run the chosen
--methodagainstMETHOD_REGISTRY. - If the requested backend is unavailable, fall back deterministically to
simple. - Stash the pre-correction matrix in
layers["counts"]and overwriteadata.Xwith the corrected counts; record the run params inuns["ambient_correction"|"soupx"|"cellbender"]. - Render diagnostic figures + emit
report.md+result.json.
Gotchas
- Unavailable backend silently falls back to
simple.sc_ambient.py:207-208logs"Requested method '%s' is unavailable (...). Falling back to simple subtraction."when CellBender is not installed or SoupX cannot reach R/rpy2. After every non-simplerun, confirmresult.json["summary"]["method_used"]matches what you passed via--method— the flag is a request, not a guarantee. --contaminationis bounded to[0, 1)(left-inclusive).sc_ambient.py:133-134checks0 <= float(args.contamination) < 1and raisesValueError("--contamination must be between 0 and 1 (for example 0.05).")otherwise.0is allowed (degenerate no-op);1and5.0(the common typo for0.05) both fail loudly.--expected-cellsmust be a positive integer.sc_ambient.py:136raisesValueError. Zero or negative values fail loudly here rather than producing a degenerate run.- SoupX without both
--raw-matrix-dirand--filtered-matrix-dirsilently falls back tosimple.sc_ambient.py:851-857logs"SoupX requires --raw-matrix-dir and --filtered-matrix-dir. Falling back to simple subtraction."and continues with the simple path.result.jsonrecords the fallback insummary["fallback_reason"]; CellBender uses just the filtered matrix and the simple path uses neither.
Key CLI
# Demo (simple subtraction)
python omicsclaw.py run sc-ambient-removal --demo --output /tmp/sc_ambient_demo
# CellBender on a 10X-filtered AnnData
python omicsclaw.py run sc-ambient-removal \
--input filtered.h5ad --output results/ \
--method cellbender --expected-cells 8000 --contamination 0.05
# SoupX with explicit raw + filtered matrices
python omicsclaw.py run sc-ambient-removal \
--input filtered.h5ad --output results/ \
--method soupx \
--raw-matrix-dir cellranger_out/raw_feature_bc_matrix \
--filtered-matrix-dir cellranger_out/filtered_feature_bc_matrix
See also
references/parameters.md— every CLI flag and per-method tuning hintreferences/methodology.md— when each backend wins, ambient profile derivation, R/Python tradeoffsreferences/output_contract.md—layers["counts"](pre-correction) and.X(corrected) semantics, per-methodunsdiagnostics- Adjacent skills:
sc-doublet-detection(parallel — multiplet barcodes, complementary contamination class),sc-filter(upstream — cell QC),sc-preprocessing(downstream — normalise/HVG/PCA on the cleaned counts)
Установить sc-ambient-removal в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-ambient-removal?
Load when removing ambient RNA contamination from droplet-based scRNA-seq using a simple subtraction path, CellBender, or SoupX. Skip when the contamination is multiplet barcodes (use sc-doublet-detection) or before counts exist (use sc-count).
Как установить скилл sc-ambient-removal?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-ambient-removal запускает скрипты?
Нет, скилл состоит только из инструкций (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