sc-clustering
БесплатноБез исполняемых скриптовНе проверенLoad when building the neighbour graph, embedding (UMAP/t-SNE/diffmap/PHATE), and clustering (Leiden/Louvain) on a normalised single-cell AnnData. Skip when…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-clustering
When to use
The user has a normalised AnnData with PCA / integrated embedding
already populated and wants the standard scRNA neighbour-graph →
embedding → cluster workflow. Combinable in one call: pick an
embedding method (umap default, also tsne / diffmap / phate)
and a clustering method (leiden default, also louvain), with an
explicit resolution or auto-resolution search. Designed to read from
obsm["X_pca"] / obsm["X_harmony"] / etc. via --use-rep.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Normalised AnnData | .h5ad with obsm["X_pca"] (or --use-rep <key>) |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Clustered AnnData | processed.h5ad |
adds obs["leiden"] / obs["louvain"], obsm["X_<embedding>"] |
| Per-cluster summary | tables/cluster_summary.csv |
cells per cluster |
| Run-level summary | tables/clustering_summary.csv |
resolution, n_clusters, modularity |
| Embedding points | tables/embedding_points.csv |
per-cell embedding coordinates |
| Diagnostic figures | embedding gallery (always); figures/auto_resolution_search.png only when --resolution auto |
gallery + conditional sweep figure |
| Report | report.md + result.json |
always written |
Flow
- Load AnnData; pick embedding source (
--use-repor default). - If
--resolutionisauto, run the auto-resolution search and writefigures/auto_resolution_search.png; otherwise parse it as a single float. - Build the neighbour graph (
--n-neighbors×--n-pcs). - Compute the chosen
--embedding-methodlow-dim embedding. - Cluster with
--cluster-methodat the chosen--resolution. - Render the embedding gallery + cluster-summary tables; emit
report.md+result.json.
Gotchas
- No embedding source → hard fail.
sc_cluster.py:336raisesValueError("No embedding available for clustering.")when neitherobsm["X_pca"]is present nor--use-repis set to a validobsmkey. Runsc-preprocessing(orsc-batch-integrationfor a multi-sample dataset) before this skill, or pass--use-rep X_pcaexplicitly when the input has a non-default embedding name. --inputis required without--demo.sc_cluster.py:851raisesValueError("--input required when not using --demo"). Common when running in a pipeline where the upstream step didn't write a valid path.--resolutionis either a single float or the literalauto.sc_cluster.py:856-857parsesargs.resolution: iflower() == "auto"it triggers the auto-resolution search; otherwise it callsfloat(args.resolution). Comma-separated values ("0.3,0.6,1.0") raiseValueErrorfromfloat()— there is no built-in multi-value sweep mode beyondauto.- The skill writes the chosen
--cluster-methodcolumn verbatim intoobs.obs["leiden"](orobs["louvain"]) overwrites any pre-existing column with that name. Save the input separately if you need to compare the new clustering against a prior one.
Key CLI
# Demo (built-in PBMC3K, Leiden + UMAP)
python omicsclaw.py run sc-clustering --demo --output /tmp/sc_cluster_demo
# Default Leiden on integrated embedding
python omicsclaw.py run sc-clustering \
--input integrated.h5ad --output results/ \
--use-rep X_harmony --resolution 1.0
# Auto-resolution search with t-SNE embedding
python omicsclaw.py run sc-clustering \
--input preprocessed.h5ad --output results/ \
--embedding-method tsne --resolution auto
# PHATE embedding + Louvain
python omicsclaw.py run sc-clustering \
--input preprocessed.h5ad --output results/ \
--embedding-method phate --cluster-method louvain --n-neighbors 30
See also
references/parameters.md— every CLI flag and per-method tuning hintreferences/methodology.md— embedding choice guide, auto-resolution heuristicreferences/output_contract.md—obs/obsmkeys + table schemas- Adjacent skills:
sc-preprocessing(upstream — normalise/HVG/PCA before this),sc-batch-integration(parallel — produces the integrated embedding--use-repreads from),sc-markers(downstream — rank cluster markers fromobs["leiden"])
Установить sc-clustering в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-clustering?
Load when building the neighbour graph, embedding (UMAP/t-SNE/diffmap/PHATE), and clustering (Leiden/Louvain) on a normalised single-cell AnnData. Skip when QC/normalisation/HVG/PCA have not run yet (use sc-preprocessing) or for marker ranking after clustering (use sc-markers).
Как установить скилл sc-clustering?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-clustering запускает скрипты?
Нет, скилл состоит только из инструкций (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