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.
SKILL.mdskills/systems-biology/fgsea-preranked-enrichment/SKILL.md
GitHubPurpose
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