sc-filter
FreeNo executable scriptsNot checkedLoad when removing low-quality cells and lowly-detected genes from a single-cell AnnData using QC-derived thresholds or tissue presets. Skip for the full…
by mdbabumiamssm★ 36 GitHub starsAbout this skill
sc-filter
When to use
The user has reviewed sc-qc output and now wants to actually drop
low-quality cells and lowly-detected genes — by per-cell thresholds
(--min-genes, --max-genes, --max-mt-percent, --min-counts,
--max-counts, --min-cells) or tissue-specific presets (--tissue brain / pbmc / etc.). This skill removes cells; it does not
normalise, cluster, or annotate.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Single-cell AnnData | .h5ad |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Filtered AnnData | processed.h5ad |
post-filter, contract preserved |
| Filter stats | tables/filter_stats.csv |
per-rule keep/drop counts |
| Retention summary | tables/filter_summary.csv |
workflow + threshold metadata + cells/genes-retained pct |
| Diagnostic figures | figures/filter_comparison.png, figures/filter_summary.png |
before/after panels |
| Provenance | result.json |
summary includes expression_source, warnings |
| Report | report.md |
always written |
Flow
- Load AnnData via shared loader; persist
expression_sourceinresult.json. - If
--tissueis set, apply preset thresholds (overrides any matching CLI flag silently). - Compute per-cell metrics; mark cells / genes failing each rule.
- Drop cells failing any active rule; drop genes detected in fewer than
--min-cellscells. - Emit before/after retention tables and figures.
- Save
processed.h5ad+report.md+result.json.
Gotchas
--tissuepresets silently override matching CLI flags. Passing--tissue pbmcplus--max-mt-percent 30resolves to whatever the PBMC preset declares formax_mt_percent, not 30. When mixing, omit the explicit flag or override the preset by editing it inreferences/methodology.md. Result tables record the effective thresholds, not the user-passed ones.- QC metrics are computed on demand if missing.
sc_filter.py:617-622callsensure_qc_metrics(...)when the AnnData lacksn_genes_by_counts/pct_counts_mt, so this skill works without a priorsc-qcrun. Runningsc-qcfirst is still recommended for diagnostic figures, but it's not a hard prerequisite — the routing description used to overstate this. - Input file missing → hard fail.
sc_filter.py:573raisesFileNotFoundErroron a non-existent--input. Common in batch pipelines when an upstream output dir was renamed. expression_sourceis recorded but does not gate the filter.result.json["summary"]["expression_source"]carries which matrix the metrics came from (layers.counts/adata.raw/adata.X). Filtering still runs even if the source is log-normalised — buttotal_counts/ mt% interpretations become meaningless. Check the source before relying on the thresholds.processed.h5adis contract-preserving, not contract-canonical. The skill keeps whatever layers /raw/unsthe input had; if upstream skippedsc-standardize-input, downstream skills may still mis-classify the count source. Runsc-standardize-inputbeforesc-filterwhen input came from outside OmicsClaw.
Key CLI
# Demo
python omicsclaw.py run sc-filter --demo --output /tmp/sc_filter_demo
# Threshold-based (typical PBMC defaults)
python omicsclaw.py run sc-filter \
--input qc_output.h5ad --output results/ \
--min-genes 200 --max-mt-percent 20 --min-cells 3
# Tissue preset (overrides matching CLI flags)
python omicsclaw.py run sc-filter \
--input qc_output.h5ad --output results/ --tissue pbmc
See also
references/parameters.md— every CLI flag and tuning hintreferences/methodology.md— tissue preset definitions, threshold semanticsreferences/output_contract.md—processed.h5ad+ table schemas- Adjacent skills:
sc-qc(upstream — produces metrics; recommended before this),sc-doublet-detection(parallel — drops doublets),sc-preprocessing(downstream — normalise/HVG/PCA on the filtered AnnData)
Install sc-filter in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the sc-filter skill do?
Load when removing low-quality cells and lowly-detected genes from a single-cell AnnData using QC-derived thresholds or tissue presets. Skip for the full normalize→HVG→PCA→cluster pipeline (use sc-preprocessing) or when reads are still raw FASTQ (use sc-fastq-qc → sc-count first).
How do I install the sc-filter skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the sc-filter skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
ci-review
The scan that the plugin's GitHub Action runs.
by Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
by GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
by GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
by GitHub