sc-pathway-scoring
БесплатноБез исполняемых скриптовНе проверенLoad when computing per-cell pathway / gene-set scores on a normalised scRNA AnnData via AUCell (R or Python) or Scanpy score_genes. Skip when running…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
sc-pathway-scoring
When to use
The user has a normalised scRNA AnnData and a gene-set library (GMT
file or one of the built-in DB aliases: hallmark, kegg, reactome,
go_bp, ...) and wants per-cell scores quantifying how active each
gene set is. Three methods:
aucell_r(default) — R-backed AUCell viadecoupler-py-style bridge. Best statistical foundation; requires R env.aucell_py— Python AUCell (--aucell-py-auc-threshold). Pure Python.score_genes_py— Scanpytl.score_genesper gene set. Lightest and fastest.
Output: tables/enrichment_scores.csv (cells × gene_sets), plus
group-mean / group-high-fraction tables when --groupby is provided.
For bulk-style condition-vs-control GSEA / ORA on a DE table use
sc-enrichment. For de-novo gene-program discovery use
sc-gene-programs.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Normalised AnnData | .h5ad |
yes (unless --demo) |
| Gene sets | .gmt (--gene-sets) OR library alias (--gene-set-db hallmark/kegg/reactome/go_bp) |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Annotated AnnData | processed.h5ad |
adds per-cell pathway scores in obs (one column per gene set) |
| Per-cell scores | tables/enrichment_scores.csv |
cells × gene_sets |
| Gene-set overlap | tables/gene_set_overlap.csv |
how many input genes survived the feature mapping |
| Top pathways | tables/top_pathways.csv |
top---top-pathways ranked gene sets |
| Group means | tables/group_mean_scores.csv |
when --groupby is provided |
| Group high-fraction | tables/group_high_fraction.csv |
when --groupby is provided |
| Figures | top_gene_sets.png, group_mean_heatmap.png, group_mean_dotplot.png, top_pathway_distributions.png, embedding_top_pathways.png |
rendered via skills/singlecell/_lib/viz/enrichment.py; group-aware ones require --groupby |
| Report | report.md + result.json |
always |
Flow
- Load AnnData (
--input) or build a demo. - Load gene sets: parse
--gene-setsGMT, OR fetch via--gene-set-db <alias>and write a resolved GMT. - Validate: at least one gene-set member overlaps the input features (
feature_label_sourcechosen fromvar_names/var["gene_symbol"]/ etc.). - Run preflight; resolve
--groupby(auto-pick fromleiden/louvain/cell_typeif unset). - Dispatch to method:
aucell_r: shell out to bundled R script viaRScriptRunner.aucell_py: AUCell-Python with--aucell-py-auc-threshold.score_genes_py: Scanpytl.score_genesper gene set.
- Compute group-aware aggregates if
--groupbyis set. - Save tables, figures,
processed.h5ad,report.md,result.json.
Gotchas
- Zero-overlap between gene sets and input features is a hard fail.
sc_pathway_scoring.py:171raisesValueError(f"No valid gene sets were parsed from {gene_sets_path}")for malformed GMT files;:435raisesValueError("No gene sets had any overlap with the input features, so no enrichment scores could be computed.")and:885-887raisesValueError("None of the supplied gene-set members matched the input features. ...")when the merged overlap table sums to 0. Runsc-standardize-inputupstream if gene names need canonicalisation, or pass--gene-setswith matching ID space. score_genes_pyrequires.Xto be normalised expression.sc_pathway_scoring.py:413raisesValueError("score_genes_pyrequires normalized expression inadata.X. Runsc-preprocessingfirst."). The other two methods (aucell_r,aucell_py) use rank-based scoring and are tolerant of raw counts.--gene-set-dblibrary lookup can fail in three ways (gseapy / Python side).sc_pathway_scoring.py:354raisesImportError("--gene-set-db requires gseapy. ...")when gseapy isn't installed;:363raisesRuntimeError("Failed to download or resolve gene-set library ...")on a network / unknown-library failure;:368raisesValueError("Gene-set library ... returned no gene sets ...")when gseapy returns an empty dict. All three are pre-AUCell — fix gseapy or supply a local--gene-setsGMT.aucell_rR environment is validated separately (R side).sc_pathway_scoring.py:381callsvalidate_r_environment(required_r_packages=["AUCell", "GSEABase"])which raises if the R bridge is missing AUCell / GSEABase. After the R subprocess returns,:400raisesValueError("AUCell output is missing the required 'Cell' column")when the R-Python data round-trip drops the cell index.- One of
--gene-setsor--gene-set-dbis required.sc_pathway_scoring.py:858raisesValueError("--input required when not using --demo");:860raisesValueError("--gene-sets or --gene-set-db is required unless --demo is used")when both are unset on a real run. Library aliases are:hallmark,kegg,reactome,go_bp— others are passed through to the EnrichR library API. - **
--gene-setsfile existence is checked, f
Установить sc-pathway-scoring в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-pathway-scoring?
Load when computing per-cell pathway / gene-set scores on a normalised scRNA AnnData via AUCell (R or Python) or Scanpy score_genes. Skip when running condition-vs-control bulk-style enrichment on top of a DE table (use sc-enrichment) or for de-novo gene-program discovery (use sc-gene-programs).
Как установить скилл sc-pathway-scoring?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-pathway-scoring запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic