scatac-preprocessing
БесплатноБез исполняемых скриптовНе проверенLoad when preprocessing a single-cell ATAC peak × cell AnnData via Signac-style TF-IDF + LSI + Leiden, producing a clustered UMAP-ready object. Skip when…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
scatac-preprocessing
When to use
The user has a peak × cell scATAC AnnData (raw-count-like accessibility
matrix in .X) and wants the standard "filter → TF-IDF → LSI → graph →
UMAP → Leiden" pipeline in one shot. Currently a single backend:
tfidf_lsi (Signac-style). The skill stops at clustered UMAP — no
fragment QC, no peak calling, no motif / gene-activity scoring, no
multi-sample integration. For scRNA preprocessing use sc-preprocessing.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Peak × cell AnnData | .h5ad (.X non-negative count-like) |
yes (unless --demo) |
| Alternates | .h5 (10x), .loom, .csv/.tsv, 10x directory |
yes (loaded via smart_load) |
| Output | Path | Notes |
|---|---|---|
| Processed AnnData | processed.h5ad |
retained peak space; obsm["X_lsi"], obsm["X_umap"], obs["leiden"]; raw counts kept in layers["counts"] |
| Run summary | tables/preprocess_summary.csv |
always |
| Cluster sizes | tables/cluster_summary.csv |
always |
| Top peaks | tables/peak_summary.csv |
most accessible retained peaks |
| LSI variance | tables/lsi_variance_ratio.csv |
per-component |
| Per-cell QC | tables/qc_metrics_per_cell.csv |
always |
| Figures | figures/umap_leiden.png, figures/qc_violin.png, figures/top_accessible_peaks.png, figures/lsi_variance.png |
always |
| Report | report.md + result.json |
always |
Flow
- Load the peak × cell input via the shared
smart_load(AnnData / 10x H5 / loom / CSV / 10x dir). - Validate
.Xis present, non-empty, non-negative. - Compute per-cell
n_peaks_by_counts/total_counts; filter cells by--min-peaksand peaks by--min-cells. - Retain the globally most accessible peaks up to
--n-top-peaks. - Run Signac-style TF-IDF (
--tfidf-scale-factor); truncated-SVD LSI to--n-lsicomponents. - Build neighbour graph (
--n-neighbors), UMAP, Leiden (--leiden-resolution). - Save
processed.h5ad, tables, figures,report.md,result.json.
Gotchas
- Filtering can wipe everything.
scatac_preprocessing.py:149raisesRuntimeError("All cells were removed bymin_peaks. Lower the threshold.")and:154raisesRuntimeError("All peaks were removed bymin_cells. Lower the threshold.")— both are hard fails. Inspectn_peaks_by_countsdistribution before tightening these thresholds;--min-peaks 200(default) assumes a typical 10x scATAC depth. - LSI hard-fails on a degenerate matrix.
scatac_preprocessing.py:228raisesRuntimeError("Not enough cells or peaks remain to compute a stable LSI embedding.")when the matrix is too sparse / small after filtering. Either lower QC thresholds or feed a richer dataset. - Input must be non-negative count-like in
.X.scatac_preprocessing.py:118raisesValueError("Input AnnData has no matrix in adata.X.");:122raisesValueError("Input matrix is empty.");:124raisesValueError("scATAC preprocessing requires a non-negative accessibility matrix."). Already-TF-IDF-transformed data will fail the non-negativity check. processed.h5adkeeps only retained peaks.scatac_preprocessing.py:176doesadata = adata[:, keep].copy()—varis filtered to the topn_top_peaksaccessible. The original peak universe is not preserved inX(the deleted peaks are gone). Snapshot the input before running if you need the full peak space later.--inputmandatory unless--demo.scatac_preprocessing.py:809raisesValueError("--input required when not using --demo").- Single backend only.
scatac_preprocessing.py:272raisesValueError(f"Unknown preprocessing method '{method}'")for anything other thantfidf_lsi. The--methodflag exists for forward compatibility; today it's effectively a no-op.
Key CLI
# Demo (built-in synthetic scATAC)
python omicsclaw.py run scatac-preprocessing --demo --output /tmp/scatac_demo
# Standard run on a 10x scATAC h5
python omicsclaw.py run scatac-preprocessing \
--input atac_peaks.h5 --output results/
# Tune QC + feature budget
python omicsclaw.py run scatac-preprocessing \
--input atac_peaks.h5ad --output results/ \
--min-peaks 300 --min-cells 10 --n-top-peaks 20000
# Tune latent space + clustering
python omicsclaw.py run scatac-preprocessing \
--input atac_peaks.h5ad --output results/ \
--n-lsi 40 --n-neighbors 20 --leiden-resolution 1.0
See also
references/parameters.md— every CLI flag, per-method tunablesreferences/methodology.md— TF-IDF + LSI math; Signac alignmentreferences/output_contract.md—obsm/varschema + table layouts- Adjacent skills:
sc-preprocessing(parallel — scRNA, NOT scATAC),sc-clustering(downstream — re-cluster onobsm["X_lsi"]if you want a different resolution without re-running TF-IDF)
Установить scatac-preprocessing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл scatac-preprocessing?
Load when preprocessing a single-cell ATAC peak × cell AnnData via Signac-style TF-IDF + LSI + Leiden, producing a clustered UMAP-ready object. Skip when input is fragments or BAM (peak calling not implemented here) or for scRNA preprocessing (use sc-preprocessing).
Как установить скилл scatac-preprocessing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scatac-preprocessing запускает скрипты?
Нет, скилл состоит только из инструкций (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