Fgsea preranked enrichment
Skill ma-compbio-lab/SkillFoundry/skills/systems-biology/fgsea-preranked-enrichment
Use this skill to run deterministic toy or local custom preranked gene-set enrichment with Bioconductor fgsea. Do not use it for remote annotation lookups or large cohort-scale pathway workflows.From its SKILL.md
npx -y skills add ma-compbio-lab/SkillFoundry --skill fgsea-preranked-enrichmentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
2.5 KB, 550 tokens by cl100k_base, as published. Nobody here has run it
Purpose
Run preranked enrichment with a local ranked-statistics table and local pathway definitions through Bioconductor fgsea.
When to use
- You already have a ranked gene statistics vector from a differential expression or scoring workflow.
- You want a deterministic enrichment example that depends only on local pathway definitions.
When not to use
- You need remote MSigDB, Reactome, or annotation downloads.
- You need large production enrichment workflows with reporting layers.
Inputs
- Ranked stats TSV with columns
geneandscore - Pathway membership TSV with columns
pathwayandgene - Optional local R library path and
--install-missing
Outputs
- Compact JSON summary of fgsea results with ES, NES, p-values, adjusted p-values, and leading-edge genes
Requirements
Rscriptjsonlite- Bioconductor
fgseafor package-backed execution
Procedure
- Inspect the toy files in
examples/toy_ranked_stats.tsvandexamples/toy_pathways.tsv. - Optionally prepare a temp Bioconductor library, then run
Rscript skills/systems-biology/fgsea-preranked-enrichment/scripts/run_fgsea_preranked.R --lib-dir /tmp/bioc-skill-lib --install-missing --out fgsea_summary.json. - Review
resultsforpathway,NES,padj, andleadingEdge.
Validation
--describe-toyreturns the expected toy gene and pathway counts.- A package-backed run returns at least one enriched pathway for the bundled toy example.
Failure modes and fixes
- Missing
fgsea: rerun with--install-missing --lib-dir <path>. - Empty results: lower
--min-sizeor inspect the ranked-statistics directionality. - Non-deterministic values: keep the input files fixed and set
--seed.
Safety and limits
- Uses only local custom pathways and local ranked statistics.
- Does not fetch or infer biological annotations from remote services.
Example
Rscript skills/systems-biology/fgsea-preranked-enrichment/scripts/run_fgsea_preranked.R --describe-toy
Provenance
- Bioconductor fgsea package page: https://bioconductor.org/packages/fgsea
- fgsea tutorial: https://bioconductor.org/packages/release/bioc/vignettes/fgsea/inst/doc/fgsea-tutorial.html
Related skills
reactome-identifiers-enrichmentclusterprofiler-custom-enrichment
What ships with it: 11 files
13.6 KB alongside SKILL.md, 1 of them executable
assets/
- fgsea_toy_summary.json1.1 KB
- README.md157 B
- toy_fgsea_summary.json1.1 KB
examples/
- README.md198 B
- toy_pathways.tsv305 B
- toy_ranked_stats.tsv161 B
scripts/
- run_fgsea_preranked.R7.4 KB
tests/
- README.md182 B
- test_fgsea_preranked_enrichment.pyruns2.0 KB
- metadata.yaml911 B
- refs.md199 B