sc-grn
БесплатноБез исполняемых скриптовНе проверенLoad when inferring TF → target gene regulatory networks on a normalised scRNA AnnData via pySCENIC (GRNBoost2 + cisTarget + AUCell) or correlation-based GRN…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-grn
When to use
The user has a normalised scRNA AnnData (cluster labels in
obs[--cluster-key], default leiden) and wants gene regulatory
network inference: TFs → target genes plus per-cell regulon activity
scores. Two paths:
- Full SCENIC pipeline (when
--tf-list+--db+--motifare all provided): GRNBoost2 co-expression → cisTarget motif enrichment- pruning → AUCell scoring per cell. Produces motif-validated
regulons; AUCell activity is exposed as per-TF
obs["regulon_<TF>"]columns (one float column per regulon) plustables/grn_auc_matrix.csv.
- pruning → AUCell scoring per cell. Produces motif-validated
regulons; AUCell activity is exposed as per-TF
- Correlation fallback (when external resources are missing AND
--allow-simplified-grnis set, or in--demo): adjacency-only output, no motif validation, no AUCell. Useful for sanity checks but NOT a substitute for the full pipeline.
For ligand-receptor / cell-cell communication use
sc-cell-communication. For in-silico KO predictions use
sc-in-silico-perturbation (which builds a simpler GRN internally).
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Normalised AnnData | .h5ad with obs[--cluster-key] |
yes (unless --demo) |
| TF list | .txt (one TF per line, --tf-list) |
required for full SCENIC |
| cisTarget DB | glob pattern (--db) |
required for full SCENIC |
| Motif annotations | TSV (--motif) |
required for full SCENIC |
| Output | Path | Notes |
|---|---|---|
| AnnData | processed.h5ad |
adds per-regulon obs["regulon_<TF>"] columns (one per TF when AUCell ran, sc_grn.py:850) plus contract metadata. Note: AUCell scores live in obs, NOT obsm — there is no obsm["X_aucell"]. |
| All adjacencies | tables/grn_adjacencies.csv |
TF → target with importance score (always when GRNBoost2 ran) |
| Regulon summary | tables/grn_regulons.csv |
per-TF target count + motif NES |
| TF → target pairs | tables/grn_regulon_targets.csv |
flattened list |
| AUCell activity | tables/grn_auc_matrix.csv |
when AUCell ran (full SCENIC) |
| Figures | figures/regulon_activity_umap.png, figures/regulon_heatmap.png, figures/regulon_network.png |
best-effort |
| Report | report.md + result.json |
always |
Flow
- Load AnnData (
--input) or build a synthetic demo (GRNBoost2-only). - Preflight: when running the full pipeline, verify
--tf-list/--db/--motifexist; demo /--allow-simplified-grnskip the resource check. - Try GRNBoost2 (arboreto) for co-expression adjacencies; if
arboretois not installed OR returns empty, silently fall back to correlation-based adjacencies and recordresult.json["used_fallback"]=True+fallback_reason. - With full resources: run cisTarget motif enrichment + pruning → AUCell scoring per cell.
- Detect degenerate output (zero regulons / TFs) → write troubleshooting block; do NOT raise.
- Save tables, figures,
processed.h5ad,report.md,result.json.
Gotchas
- Silent fallback to correlation GRN when
arboretois missing or fails.sc_grn.py:631catchesImportErrorfor arboreto, setsused_fallback=True,fallback_reason="arboreto package not installed";:639-647catches general exceptions / empty results withfallback_reasonset accordingly. The fallback adjacency-only mode skips motif validation AND AUCell —tables/grn_auc_matrix.csvwon't be written. The persistedresult.json["used_fallback"]is set in the top-level summary atsc_grn.py:859(line 696 is inside therun_grn_demoreturn dict that feeds it). --inputisparser.error(exit code 2), notValueError.sc_grn.py:735callsparser.error("--input required when not using --demo"). Once--inputis given,:738raisesFileNotFoundError(f"Input file not found: {input_path}\nProvide a valid preprocessed .h5ad file, or use --demo for a quick test.")for a missing path.- Full SCENIC needs ALL THREE external resources.
--tf-list+--db+--motifmust be provided together; the preflight atsc_grn.py:749-758enforces this unless--demoor--allow-simplified-grnbypasses. Resources must be downloaded separately (cisTarget DBs fromhttps://resources.aertslab.org/cistarget/). - Two distinct degenerate-output modes. Total failure (
result is None):sc_grn.py:805/:826writes the degenerate-diag block and callssys.exit(1)at:833(caller wrappers expecting a 0 exit will see a hard fail). Partial degeneracy (_check_degenerate_outputreturns a non-None diagnostic with regulons-but-uninformative): the script proceeds to a soft-warn finish and exits 0. Always checkresult.json["n_regulons"](line 857) AND the process exit code before chaining downstream. processed.h5adper-regulonobs["regulon_<TF>"]columns only exist when AUCell ran. In the correlation-fallback or no-motif path,processed.h5adis essentially the input AnnData with contract metadata only — noregulon_*obscolumns and notables/grn_auc_matrix.csv. Downstream skills consuming regulon activity m
Установить sc-grn в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-grn?
Load when inferring TF → target gene regulatory networks on a normalised scRNA AnnData via pySCENIC (GRNBoost2 + cisTarget + AUCell) or correlation-based GRN fallback (when arboreto is unavailable, in --demo, or with --allow-simplified-grn). Skip when computing ligand-receptor cell-cell signalling (use sc-cell-communication) or for predicting genetic-KO effects (use sc-in-silico-perturbation).
Как установить скилл sc-grn?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-grn запускает скрипты?
Нет, скилл состоит только из инструкций (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