agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/rnaseq-functional-enrichment/SKILL.md

rnaseq-functional-enrichment

Skill4 starsChanged 12 days agoMITView on GitHub

Gene set enrichment and over-representation analysis using clusterProfiler, gseapy, or fgsea, with GO, KEGG, and Reactome pathway databases.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read DE results; extract gene IDs of significant genes (ORA) or rank all genes by -log10(padj)*sign(log2FoldChange) (GSEA).

    line 32
  2. Distinctive:

    Write all enrichment result tables as TSV and plots as PDFs to the output directory.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: RNA-seq Functional Enrichment

Use When

  • User has a DE results table and wants to know which biological processes, pathways, or functions are enriched in up- or down-regulated genes
  • User wants GO (biological process, molecular function, cellular component) enrichment
  • User wants KEGG or Reactome pathway enrichment
  • User wants gene set enrichment analysis (GSEA) using a ranked gene list
  • User wants to compare enrichment across multiple contrasts or conditions

Inputs

  • Required:
    • DE results table (TSV with gene_id and padj or p-value columns) OR pre-ranked gene list (gene_id, ranking metric such as -log10(p)*sign(log2FC))
  • Optional:
    • Organism database (default: org.Hs.eg.db for human)
    • Gene ID type: SYMBOL, ENSEMBL, or ENTREZID (default: SYMBOL)
    • FDR cutoff (default: 0.05)
    • Analysis type: ora or gsea (default: ora for DE table input, gsea for ranked list)
    • Pathway databases: go, kegg, reactome, msigdb (default: go,kegg)
    • Minimum/maximum gene set size (default: min=5, max=500)
    • Output directory (default: enrichment_results)
    • Tool: clusterProfiler or gseapy (default: clusterProfiler for R environments; gseapy for Python-only environments)

Workflow

  1. Read DE results; extract gene IDs of significant genes (ORA) or rank all genes by -log10(padj)*sign(log2FoldChange) (GSEA). Strip Ensembl version suffixes (e.g., ENSG00000123.5 → ENSG00000123) if present.
  2. Map gene IDs to ENTREZID using bitr() (clusterProfiler) or an annotation database. Deduplicate any genes that map to multiple Entrez IDs.
  3. For ORA: run enrichGO() (BP, CC, MF), enrichKEGG(), and optionally enrichPathway() (Reactome) on the significant gene list.
  4. For GSEA: run gseGO() (BP) and gseKEGG() on the full ranked gene vector.
  5. Filter results by FDR threshold and gene set size limits.
  6. Generate plots: dotplot (top 20 terms), barplot (top 20 pathways), network/emapplot (pathway overlap), gene-concept network (cnetplot).
  7. Write all enrichment result tables as TSV and plots as PDFs to the output directory.
  8. Report the top enriched terms per database.

Output Contract

  • GO enrichment table (TSV: ID, Description, GeneRatio, BgRatio, pvalue, p.adjust, geneID) — one file per ontology (BP, CC, MF)
  • KEGG enrichment table (same format)
  • Reactome enrichment table (same format, if requested)
  • Dotplot PDF (top 20 GO BP, CC, MF terms)
  • Barplot PDF (top 20 KEGG pathways)
  • Network plot PDF (pathway overlap or gene-concept overlap)
  • Session info text file

Limits

  • clusterProfiler requires R with org.Hs.eg.db, ReactomePA, DOSE, and enrichplot installed (see knowledge/sources/genomics/r-environment-setup.md)
  • KEGG enrichment requires internet access (KEGG REST API) unless a local cache is used
  • Reactome requires the ReactomePA package
  • Gene ID conversion (bitr) may lose genes without an ENTREZID mapping (~10-20% for Ensembl IDs with version suffixes)
  • GSEA requires a minimum of ~100 genes per gene set; rare pathways may be untestable
  • Common failure cases: Ensembl IDs with version suffixes (ENSG00000123.5) must be stripped before ID conversion; KEGG organism code must match the species (hsa for human, mmu for mouse); gene sets with <5 or >500 genes are excluded by default size filters

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.