sc-filter
Filter cells and genes from single-cell RNA-seq AnnData objects using QC-derived thresholds or tissue presets. This wrapper removes low-quality cells/genes…
от mdbabumiamssm★ 36 звёзд на GitHub
Установить sc-filter в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Single-Cell Filter
Why This Exists
- Without it: downstream clustering and DE are distorted by low-quality droplets and low-information genes.
- With it: one run applies explicit QC cutoffs and records how many cells/genes were removed.
- Why OmicsClaw: tissue presets and a stable output contract make filtering easier to reproduce.
Core Capabilities
- Threshold-based filtering: gene-count, count-depth, and mitochondrial cutoffs in one wrapper.
- Tissue-aware presets: wrapper-level heuristics for common tissues.
- QC-aware operation: reuses existing QC metrics or computes the minimum needed metrics first.
- Standard gallery contract: before/after QC comparison and retention summary under
figures/. - Downstream-ready export:
processed.h5ad, filter-stat tables, result JSON, README, and notebook artifacts.
Scope Boundary
This skill currently exposes one public workflow: threshold_filtering.
This skill does:
- use existing QC metrics or compute the ones needed for thresholding
- filter cells by genes, counts, and mitochondrial percentage
- filter genes by minimum detected-cell count
- export filtered AnnData, figures, tables, and a report
This skill does not:
- normalize counts
- run HVG, PCA, UMAP, or clustering
- remove doublets or ambient RNA
Input Formats
| Format | Extension / form | Current wrapper support | Notes |
|---|---|---|---|
| AnnData | .h5ad |
yes | preferred input path |
| Demo | --demo |
yes | bundled fallback |
Input Expectations
- Accepted input:
.h5ad - Expected data state: either count-oriented AnnData or QC-annotated AnnData
- Important columns when present:
n_genes_by_counts,total_counts,pct_counts_mt - If QC metrics are missing but raw counts are still recoverable, the wrapper canonicalizes the object and computes the minimum needed QC metrics automatically
- If the object already has QC metrics, the wrapper reuses them instead of forcing the user back through
sc-qc
Workflow
- Load AnnData and inspect available QC columns plus matrix state.
- Reuse existing QC metrics when present; otherwise canonicalize count-like input and compute the minimum needed QC metrics.
- Apply optional tissue preset and resolve effective thresholds.
- Filter cells by configured thresholds.
- Filter genes by
min_cells. - Write
processed.h5ad, figures, figure-data CSVs, summary tables,report.md, andresult.json.
CLI Reference
python skills/singlecell/scrna/sc-filter/sc_filter.py \
--input <data.h5ad> --output <dir>
python skills/singlecell/scrna/sc-filter/sc_filter.py \
--input <data.h5ad> --tissue pbmc --output <dir>
python skills/singlecell/scrna/sc-filter/sc_filter.py \
--input <data.h5ad> --min-genes 200 --max-genes 6000 \
--max-mt-percent 15 --min-cells 3 --output <dir>
Public Parameters
| Flag | Default | Meaning |
|---|---|---|
--min-genes |
200 |
Minimum detected genes per retained cell |
--max-genes |
none | Optional upper gene-count cap |
--min-counts |
none | Optional lower UMI-count cap |
--max-counts |
none | Optional upper UMI-count cap |
--max-mt-percent |
20.0 |
Maximum mitochondrial percentage |
--min-cells |
3 |
Minimum number of cells expressing a retained gene |
--tissue |
none | OmicsClaw preset thresholds such as pbmc, brain, or tumor |
Algorithm / Methodology
Current OmicsClaw threshold_filtering always:
- loads the AnnData object
- checks whether QC metrics already exist
- resolves optional tissue presets into effective thresholds
- filters cells by genes, counts, and mitochondrial percentage
- filters genes by
min_cells - exports filtered data plus summary artifacts
Important implementation note:
tissueis an OmicsClaw wrapper preset, not an upstream Scanpy parameter.
Output Contract
Successful runs write:
processed.h5adreport.mdresult.jsonfigures/tables/filter_stats.csvtables/filter_summary.csvtables/retention_summary.csvfigure_data/reproducibility/commands.sh
Visualization Contract
The current wrapper writes a standard recipe-driven gallery:
figures/filter_comparison.pngfigures/filter_summary.png
What Users Should Inspect First
report.mdfigures/filter_comparison.pngtables/filter_stats.csvfigures/filter_summary.pngprocessed.h5ad
Current Limitations
- This wrapper now writes
README.mdand notebook-style reproducibility artifacts when notebook export dependencies are available. - Threshold presets are OmicsClaw wrapper defaults, not upstream standard recommendations for every tissue.
Safety And Guardrails
- Explain the effective thresholds before running, especially when
--tissuepresets are used. - Treat tissue presets as wrapper heuristics rather than universal biology rules.
- Doublet removal is automatic when `p
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-filter?
Filter cells and genes from single-cell RNA-seq AnnData objects using QC-derived thresholds or tissue presets. This wrapper removes low-quality cells/genes but does not normalize, cluster, or annotate the dataset.
Как установить скилл sc-filter?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-filter запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet 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…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…