[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QFG2TB59GSBPQRT3HDJ02Y":3,"skill-same:01M6QFG2TB59GSBPQRT3HDJ02Y":92},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":14,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6QFG2TB59GSBPQRT3HDJ02Y","pathway-enrichment",null,"Run pathway and gene-set enrichment analysis on gene lists or ranked gene data, then interpret the results. Use whenever the user has a set of genes (differentially expressed genes from PyDESeq2\u002FScanpy, CRISPR-screen hits, cluster marker genes, proteomics hits) and wants to know which biological pathways, GO terms, or gene sets are over-represented or enriched. Covers over-representation analysis (ORA \u002F Enrichr \u002F Fisher \u002F hypergeometric), ranked Gene Set Enrichment Analysis (GSEA \u002F preranked), single-sample scoring (ssGSEA\u002FGSVA), and functional profiling via gseapy, g:Profiler, Enrichr libraries, MSigDB, GO, KEGG, Reactome, and WikiPathways — plus gene-ID mapping, choosing the right background universe, multiple-testing correction, redundancy reduction, dotplots\u002Fenrichment maps, and publication-ready tables. Use this for \"pathway analysis\", \"enrichment analysis\", \"GO enrichment\", \"KEGG\u002FReactome pathways\", \"GSEA\", \"over-representation\", \"functional annotation\", or \"what pathways are my genes in\".","Tashima-Tarsh\u002FDisha6.6","Tashima-Tarsh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269906498?v=4","01M6PBH98X03XERH0HFT4PFB1P","NITISH KUMAR","01M6PBH9DA0M6KM3Z12P848F0K",0,"MIT","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"enrichment","pathway enrichment","pathway","fisher","gene","for","which","tables","functional","gene-set","enrichr","ssgsea","testing","screen","scoring","ready","use","pydeseq2","run","go","2026-11-10 10:12:30",false,"---\nname: pathway-enrichment\ndescription: Run pathway and gene-set enrichment analysis on gene lists or ranked gene data, then interpret the results. Use whenever the user has a set of genes (differentially expressed genes from PyDESeq2\u002FScanpy, CRISPR-screen hits, cluster marker genes, proteomics hits) and wants to know which biological pathways, GO terms, or gene sets are over-represented or enriched. Covers over-representation analysis (ORA \u002F Enrichr \u002F Fisher \u002F hypergeometric), ranked Gene Set Enrichment Analysis (GSEA \u002F preranked), single-sample scoring (ssGSEA\u002FGSVA), and functional profiling via gseapy, g:Profiler, Enrichr libraries, MSigDB, GO, KEGG, Reactome, and WikiPathways — plus gene-ID mapping, choosing the right background universe, multiple-testing correction, redundancy reduction, dotplots\u002Fenrichment maps, and publication-ready tables. Use this for \"pathway analysis\", \"enrichment analysis\", \"GO enrichment\", \"KEGG\u002FReactome pathways\", \"GSEA\", \"over-representation\", \"functional annotation\", or \"what pathways are my genes in\".\nlicense: MIT\nmetadata:\n  version: '1.1'\n  category: life-sciences\n  maintainer: Kalaris Labs\n  tags: pathway enrichment, gene set enrichment, GSEA, functional analysis, bioinformatics\n---\n\n# Pathway Enrichment\n\n## Overview\n\nEnrichment analysis answers \"what biology is over-represented in my genes?\" It is the standard last step after differential expression, a screen, or clustering. There are two core methods, and choosing correctly is the single most important decision:\n\n- **ORA (over-representation analysis)** — take a *thresholded* gene list (e.g., padj \u003C 0.05) and test which gene sets it overlaps more than chance, using Fisher's exact \u002F hypergeometric tests. Tools: Enrichr, g:Profiler.\n- **GSEA (gene set enrichment analysis)** — take the *whole ranked list* of genes (no threshold) and test whether each gene set is concentrated toward the top or bottom. Preranked GSEA uses a per-gene score (e.g., the DESeq2 `stat`). Better when effects are broad and subtle.\n\nThis skill orchestrates these analyses, the gene-set databases behind them, and the interpretation pitfalls that make results wrong or unpublishable.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Find enriched GO terms \u002F KEGG \u002F Reactome \u002F WikiPathways \u002F MSigDB Hallmark sets in a gene list.\n- Run GSEA \u002F preranked GSEA on DESeq2, edgeR, limma, or Scanpy `rank_genes_groups` output.\n- Score pathway activity per sample\u002Fcell (ssGSEA, GSVA).\n- Interpret, deduplicate, and visualize enrichment results, or build a publication table\u002Ffigure.\n- Decide between ORA and GSEA, pick gene-set libraries, choose a background, or fix gene-ID problems.\n\nFor quick one-off Enrichr lookups the `gget` skill (`gget enrichr`) is lighter weight; for raw pathway\u002Finteraction APIs (Reactome, KEGG, STRING) see the `database-lookup` skill. Use **this** skill for full, defensible enrichment workflows.\n\n## Choosing the Right Method\n\n| Situation | Method | Tool \u002F entry point |\n|-----------|--------|--------------------|\n| You have a discrete hit list (DE genes, screen hits, cluster markers) | **ORA** | `gp.enrichr(...)` or g:Profiler |\n| You have a full ranked list (every tested gene + a score) | **Preranked GSEA** | `gp.prerank(...)` |\n| You have an expression matrix + class labels | **GSEA** | `gp.gsea(...)` |\n| You want a pathway score per sample\u002Fcell | **ssGSEA \u002F GSVA** | `gp.ssgsea(...)`, `gp.gsva(...)` |\n| You need a custom background or 500+ organisms | **ORA with custom domain** | g:Profiler (`domain_scope='custom'`) |\n| You want TF \u002F signaling *activity* (PROGENy, DoRothEA) | activity inference | see `references\u002Fdatabases-and-gene-sets.md` (decoupler) |\n\nWhen in doubt: a thresholded list → ORA; a ranked table with scores → GSEA. Never threshold a list and then feed it to GSEA — that discards the ranking GSEA depends on.\n\n## Setup\n\n```bash\nuv pip install gseapy gprofiler-official\n# gseapy pulls pandas, numpy, scipy, matplotlib. Network access is needed for\n# Enrichr, g:Profiler, and MSigDB downloads. For fully offline ORA, use a local\n# GMT file with gp.enrich() (see references\u002Fgseapy.md).\n```\n\nVerify and list available gene-set libraries (names change over time — never hardcode blindly):\n\n```python\nimport gseapy as gp\nnames = gp.get_library_name(organism=\"human\")   # 200+ Enrichr libraries\nprint([n for n in names if \"Reactome\" in n or \"KEGG\" in n or \"Hallmark\" in n])\n```\n\n## Quick Start\n\n### ORA on a hit list (gseapy + Enrichr)\n\n```python\nimport gseapy as gp\n\n# Enrichr libraries expect HGNC gene SYMBOLS (human: UPPERCASE). Map IDs first if needed.\ngenes = [g.strip() for g in open(\"deg_symbols.txt\") if g.strip()]\n\nenr = gp.enrichr(\n    gene_list=genes,\n    gene_sets=[\"MSigDB_Hallmark_2020\", \"GO_Biological_Process_2023\",\n               \"KEGG_2021_Human\", \"Reactome_2022\"],\n    organism=\"human\",\n    outdir=None,            # in-memory; set a path to also write tables\u002Fplots\n)\nres = enr.results\nsig = res[res[\"Adjusted P-value\"] \u003C 0.05].sort_values(\"Adjusted P-value\")\nprint(sig[[\"Gene_set\", \"Term\", \"Overlap\", \"Adjusted P-value\", \"Combined Score\", \"Genes\"]].head(20))\n```\n\n### Preranked GSEA from DESeq2 results\n\n```python\nimport gseapy as gp\nimport pandas as pd\n\nres = pd.read_csv(\"deseq2_results.csv\", index_col=0)   # index = gene symbols\n# Rank by the test statistic (sign = direction, magnitude = evidence). This is\n# more stable than ranking by log2FoldChange, which is noisy for low-count genes.\nrnk = res[\"stat\"].dropna().sort_values(ascending=False)\nrnk.index = rnk.index.str.upper()\nrnk = rnk[~rnk.index.duplicated(keep=\"first\")]\n\npre = gp.prerank(\n    rnk=rnk,\n    gene_sets=[\"MSigDB_Hallmark_2020\", \"GO_Biological_Process_2023\"],\n    min_size=15, max_size=500,        # drop tiny\u002Fhuge sets (noisy or generic)\n    permutation_num=1000, seed=123,   # seed = reproducible p-values\n    threads=4, outdir=None,\n)\nout = pre.res2d.sort_values(\"FDR q-val\")\nprint(out[[\"Term\", \"ES\", \"NES\", \"NOM p-val\", \"FDR q-val\", \"Lead_genes\"]].head(20))\n```\n\nIf you have no `stat` column, build the rank from `sign(log2FoldChange) * -log10(pvalue)`.\n\n## Core Workflow\n\nFor a defensible analysis, work through these steps. The middle steps (ID type, background) are where results most often silently go wrong.\n\n### Step 1 — Pin down inputs and pick the method\nConfirm: which genes, what organism, is there a per-gene score (→ GSEA) or just a list (→ ORA), and what comparison they represent (direction matters for interpretation).\n\n### Step 2 — Get gene IDs into the right namespace\nEnrichr\u002FMSigDB libraries are keyed by **gene symbols** (human UPPERCASE, mouse Title-case). If you have Ensembl\u002FEntrez IDs, convert first. See `references\u002Fdatabases-and-gene-sets.md` for `gp.Biomart`, g:Profiler `g:Convert`, and `mygene`. A silent ID mismatch is the #1 cause of \"nothing is significant\".\n\n### Step 3 — Choose gene-set libraries to match the question\nHallmark (broad themes) → GO:BP (mechanism) → KEGG\u002FReactome\u002FWikiPathways (curated pathways) → C7 (immune), etc. Don't run 50 libraries; pick 2–4 that fit the biology. Catalog and selection guidance: `references\u002Fdatabases-and-gene-sets.md`.\n\n### Step 4 — Set the background universe (ORA only)\nThe background must be the genes that *could* have been detected in your assay (e.g., all expressed\u002Ftested genes), not the whole genome. The wrong background inflates significance. Enrichr uses a fixed background; when background matters, use g:Profiler with `domain_scope='custom'` + your `background`, or `gp.enrich()` with an explicit background. Rationale in `references\u002Finterpretation.md`.\n\n### Step 5 — Run the analysis\nUse the Quick Start patterns or the bundled `scripts\u002Frun_enrichment.py`. For GSEA always set a `seed` and report `permutation_num`.\n\n### Step 6 — Filter on adjusted p-values\nUse `Adjusted P-value` (ORA, Benjamini–Hochberg) or `FDR q-val` (GSEA), not raw p-values. Typical cutoff 0.05; also check the overlap\u002Fgene count so a \"hit\" isn't 1 gene out of a 2000-gene set.\n\n### Step 7 — Visualize\nDotplots, bar plots, enrichment maps, and GSEA running-score plots are built into gseapy (`gp.dotplot`, `gp.barplot`, `gp.enrichment_map`, `gp.gseaplot`). See `references\u002Fgseapy.md`.\n\n### Step 8 — Reduce redundancy and interpret\nGO especially returns many near-duplicate terms. Collapse with an enrichment map (term–term similarity), leading-edge overlap, or parent terms, and report representative terms. Interpretation framework and a publication-table format are in `references\u002Finterpretation.md`.\n\n## Helper Script\n\n`scripts\u002Frun_enrichment.py` runs ORA or GSEA end-to-end and writes a results table plus a dotplot, handling the boilerplate (symbol cleanup, dedup, NA removal, rank construction from a DESeq2 table, per-library FDR filtering).\n\n```bash\n# ORA from a hit list (one gene symbol per line)\npython scripts\u002Frun_enrichment.py ora \\\n  --genes deg_symbols.txt \\\n  --libraries MSigDB_Hallmark_2020 GO_Biological_Process_2023 KEGG_2021_Human \\\n  --organism human --outdir results\u002F\n\n# Preranked GSEA from a DESeq2 results CSV (auto-builds the rank from `stat`)\npython scripts\u002Frun_enrichment.py gsea \\\n  --deseq2 deseq2_results.csv \\\n  --libraries MSigDB_Hallmark_2020 GO_Biological_Process_2023 \\\n  --organism human --outdir results\u002F --seed 123\n\n# Preranked GSEA from an explicit 2-column rank file (gene,score)\npython scripts\u002Frun_enrichment.py gsea --rnk ranked_genes.csv --outdir results\u002F\n```\n\nRun `python scripts\u002Frun_enrichment.py --help` for all options (background file, FDR cutoff, min\u002Fmax set size, permutations).\n\n## Common Pitfalls\n\nThese cause most wrong or irreproducible results:\n\n1. **Gene-ID \u002F organism mismatch** — symbols vs Ensembl, human vs mouse casing. Map IDs and set `organism` correctly, or matches silently drop to ~zero.\n2. **Wrong background (ORA)** — using the whole genome instead of the tested\u002Fexpressed gene set inflates p-values. Set a custom background when it matters.\n3. **Thresholding before GSEA** — GSEA needs the *full* ranked list; only ORA uses a cut list.\n4. **Ranking GSEA by log2FoldChange alone** — unstable for low-count genes; prefer `stat` or `sign(LFC) * -log10(p)`.\n5. **Multiple-testing across libraries** — FDR is computed *within* a library; running many libraries multiplies tests. Report per-library FDR and stay conservative.\n6. **Redundant GO terms** — don't report 40 variants of the same term; collapse and show representatives.\n7. **Significance ≠ relevance** — check the overlap count and gene-set size; tiny sets reach significance trivially.\n8. **List too short\u002Flong for ORA** — \u003C10 genes is underpowered; >2000 loses specificity (consider GSEA instead).\n9. **No reproducibility metadata** — Enrichr\u002FGO libraries are versioned and drift over time. Record library names+date and set a GSEA `seed`.\n\n## Integration with Other Skills\n\n- **Upstream (where genes come from):** `pydeseq2` (DE genes + `stat` for GSEA), `scanpy` (`rank_genes_groups` markers \u002F scores), `depmap`\u002F`pytdc` (screen hits), proteomics skills (`pyopenms`, `matchms`).\n- **Databases \u002F IDs:** `database-lookup` (Reactome, KEGG, STRING, Gene Ontology APIs), `gget` (`gget enrichr` quick path, `gget info` for ID mapping), `bioservices`.\n- **Downstream:** `scientific-visualization` (custom figures), `networkx` (enrichment-map graphs), `scientific-writing` \u002F `literature-review` (interpret and cite), `statistical-analysis` (multiple-testing details).\n\n## Reference Files\n\nRead the relevant file when you need depth:\n\n- `references\u002Fgseapy.md` — full gseapy API: `enrichr`, offline `enrich`, `prerank`, `gsea`, `ssgsea`, `gsva`, `Msigdb`, `Biomart`, `get_library_name`\u002F`read_gmt`, every plot, result-column meanings, GMT\u002Foffline usage, and troubleshooting (rate limits, empty results).\n- `references\u002Fdatabases-and-gene-sets.md` — GO, KEGG, Reactome, WikiPathways, MSigDB collections, Enrichr library naming, g:Profiler sources, organism handling, gene-ID conversion, library selection by question, and pointers to Reactome\u002FSTRING APIs and decoupler activity inference.\n- `references\u002Finterpretation.md` — ORA vs GSEA statistics, background-universe choice, multiple-testing methods (BH vs g:SCS vs Bonferroni), leading-edge genes, redundancy reduction, effect vs significance, a publication-table template, and reproducibility checklist.\n\n## Resources\n\n- gseapy docs: https:\u002F\u002Fgseapy.readthedocs.io\u002F · repo: https:\u002F\u002Fgithub.com\u002Fzqfang\u002FGSEApy\n- g:Profiler: https:\u002F\u002Fbiit.cs.ut.ee\u002Fgprofiler\u002F · Python client: https:\u002F\u002Fpypi.org\u002Fproject\u002Fgprofiler-official\u002F\n- Enrichr: https:\u002F\u002Fmaayanlab.cloud\u002FEnrichr\u002F · MSigDB: https:\u002F\u002Fwww.gsea-msigdb.org\u002Fgsea\u002Fmsigdb\u002F\n- GSEA method: Subramanian et al. (2005) PNAS, DOI: 10.1073\u002Fpnas.0506580102\n\n## Related skills\n\n- `bulk-rnaseq`: End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp\u002FTrim Galore), alignment and quantificat…\n- `bioservices`: Unified Python interface to 40+ bioinformatics services.\n- `gget`: Queries 20+ bioinformatics databases and analysis services through the gget CLI and Python package, covering Ensembl gene search, info and…\n","# Pathway Enrichment\n\n## Overview\n\nEnrichment analysis answers \"what biology is over-represented in my genes?\" It is the standard last step after differential expression, a screen, or clustering. There are two core methods, and choosing correctly is the single most important decision:\n\n- **ORA (over-representation analysis)** — take a *thresholded* gene list (e.g., padj \u003C 0.05) and test which gene sets it overlaps more than chance, using Fisher's exact \u002F hypergeometric tests. Tools: Enrichr, g:Profiler.\n- **GSEA (gene set enrichment analysis)** — take the *whole ranked list* of genes (no threshold) and test whether each gene set is concentrated toward the top or bottom. Preranked GSEA uses a per-gene score (e.g., the DESeq2 `stat`). Better when effects are broad and subtle.\n\nThis skill orchestrates these analyses, the gene-set databases behind them, and the interpretation pitfalls that make results wrong or unpublishable.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Find enriched GO terms \u002F KEGG \u002F Reactome \u002F WikiPathways \u002F MSigDB Hallmark sets in a gene list.\n- Run GSEA \u002F preranked GSEA on DESeq2, edgeR, limma, or Scanpy `rank_genes_groups` output.\n- Score pathway activity per sample\u002Fcell (ssGSEA, GSVA).\n- Interpret, deduplicate, and visualize enrichment results, or build a publication table\u002Ffigure.\n- Decide between ORA and GSEA, pick gene-set libraries, choose a background, or fix gene-ID problems.\n\nFor quick one-off Enrichr lookups the `gget` skill (`gget enrichr`) is lighter weight; for raw pathway\u002Finteraction APIs (Reactome, KEGG, STRING) see the `database-lookup` skill. Use **this** skill for full, defensible enrichment workflows.\n\n## Choosing the Right Method\n\n| Situation | Method | Tool \u002F entry point |\n|-----------|--------|--------------------|\n| You have a discrete hit list (DE genes, screen hits, cluster markers) | **ORA** | `gp.enrichr(...)` or g:Profiler |\n| You have a full ranked list (every tested gene + a score) | **Preranked GSEA** | `gp.prerank(...)` |\n| You have an expression matrix + class labels | **GSEA** | `gp.gsea(...)` |\n| You want a pathway score per sample\u002Fcell | **ssGSEA \u002F GSVA** | `gp.ssgsea(...)`, `gp.gsva(...)` |\n| You need a custom background or 500+ organisms | **ORA with custom domain** | g:Profiler (`domain_scope='custom'`) |\n| You want TF \u002F signaling *activity* (PROGENy, DoRothEA) | activity inference | see `references\u002Fdatabases-and-gene-sets.md` (decoupler) |\n\nWhen in doubt: a thresholded list → ORA; a ranked table with scores → GSEA. Never threshold a list and then feed it to GSEA — that discards the ranking GSEA depends on.\n\n## Setup\n\n```bash\nuv pip install gseapy gprofiler-official\n# gseapy pulls pandas, numpy, scipy, matplotlib. Network access is needed for\n# Enrichr, g:Profiler, and MSigDB downloads. For fully offline ORA, use a local\n# GMT file with gp.enrich() (see references\u002Fgseapy.md).\n```\n\nVerify and list available gene-set libraries (names change over time — never hardcode blindly):\n\n```python\nimport gseapy as gp\nnames = gp.get_library_name(organism=\"human\")   # 200+ Enrichr libraries\nprint([n for n in names if \"Reactome\" in n or \"KEGG\" in n or \"Hallmark\" in n])\n```\n\n## Quick Start\n\n### ORA on a hit list (gseapy + Enrichr)\n\n```python\nimport gseapy as gp\n\n# Enrichr libraries expect HGNC gene SYMBOLS (human: UPPERCASE). Map IDs first if needed.\ngenes = [g.strip() for g in open(\"deg_symbols.txt\") if g.strip()]\n\nenr = gp.enrichr(\n    gene_list=genes,\n    gene_sets=[\"MSigDB_Hallmark_2020\", \"GO_Biological_Process_2023\",\n               \"KEGG_2021_Human\", \"Reactome_2022\"],\n    organism=\"human\",\n    outdir=None,            # in-memory; set a path to also write tables\u002Fplots\n)\nres = enr.results\nsig = res[res[\"Adjusted P-value\"] \u003C 0.05].sort_values(\"Adjusted P-value\")\nprint(sig[[\"Gene_set\", \"Term\", \"Overlap\", \"Adjusted P-value\", \"Combined Score\", \"Genes\"]].head(20))\n```\n\n### Preranked GSEA from DESeq2 results\n\n```python\nimport gseapy as gp\nimport pandas as pd\n\nres = pd.read_csv(\"deseq2_results.csv\", index_col=0)   # index = gene symbols\n# Rank by the test statistic (sign = direction, magnitude = evidence). This is\n# more stable than ranking by log2FoldChange, which is noisy for low-count genes.\nrnk = res[\"stat\"].dropna().sort_values(ascending=False)\nrnk.index = rnk.index.str.upper()\nrnk = rnk[~rnk.index.duplicated(keep=\"first\")]\n\npre = gp.prerank(\n    rnk=rnk,\n    gene_sets=[\"MSigDB_Hallmark_2020\", \"GO_Biological_Process_2023\"],\n    min_size=15, max_size=500,        # drop tiny\u002Fhuge sets (noisy or generic)\n    permutation_num=1000, seed=123,   # seed = reproducible p-values\n    threads=4, outdir=None,\n)\nout = pre.res2d.sort_values(\"FDR q-val\")\nprint(out[[\"Term\", \"ES\", \"NES\", \"NOM p-val\", \"FDR q-val\", \"Lead_genes\"]].head(20))\n```\n\nIf you have no `stat` column, build the rank from `sign(log2FoldChange) * -log10(pvalue)`.\n\n## Core Workflow\n\nFor a defensible analysis, work through these steps. The middle steps (ID type, background) are where results most often silently go wrong.\n\n### Step 1 — Pin down inputs and pick the method\nConfirm: which genes, what organism, is there a per-gene score (→ GSEA) or just a list (→ ORA), and what comparison they represent (direction matters for interpretation).\n\n### Step 2 — Get gene IDs into the right namespace\nEnrichr\u002FMSigDB libraries are keyed by **gene symbols** (human UPPERCASE, mouse Title-case). If you have Ensembl\u002FEntrez IDs, convert first. See `references\u002Fdatabases-and-gene-sets.md` for `gp.Biomart`, g:Profiler `g:Convert`, and `mygene`. A silent ID mismatch is the #1 cause of \"nothing is significant\".\n\n### Step 3 — Choose gene-set libraries to match the question\nHallmark (broad themes) → GO:BP (mechanism) → KEGG\u002FReactome\u002FWikiPathways (curated pathways) → C7 (immune), etc. Don't run 50 libraries; pick 2–4 that fit the biology. Catalog and selection guidance: `references\u002Fdatabases-and-gene-sets.md`.\n\n### Step 4 — Set the background universe (ORA only)\nThe background must be the genes that *could* have been detected in your assay (e.g., all expressed\u002Ftested genes), not the whole genome. The wrong background inflates significance. Enrichr uses a fixed background; when background matters, use g:Profiler with `domain_scope='custom'` + your `background`, or `gp.enrich()` with an explicit background. Rationale in `references\u002Finterpretation.md`.\n\n### Step 5 — Run the analysis\nUse the Quick Start patterns or the bundled `scripts\u002Frun_enrichment.py`. For GSEA always set a `seed` and report `permutation_num`.\n\n### Step 6 — Filter on adjusted p-values\nUse `Adjusted P-value` (ORA, Benjamini–Hochberg) or `FDR q-val` (GSEA), not raw p-values. Typical cutoff 0.05; also check the overlap\u002Fgene count so a \"hit\" isn't 1 gene out of a 2000-gene set.\n\n### Step 7 — Visualize\nDotplots, bar plots, enrichment maps, and GSEA running-score plots are built into gseapy (`gp.dotplot`, `gp.barplot`, `gp.enrichment_map`, `gp.gseaplot`). See `references\u002Fgseapy.md`.\n\n### Step 8 — Reduce redundancy and interpret\nGO especially returns many near-duplicate terms. Collapse with an enrichment map (term–term similarity), leading-edge overlap, or parent terms, and report representative terms. Interpretation framework and a publication-table format are in `references\u002Finterpretation.md`.\n\n## Helper Script\n\n`scripts\u002Frun_enrichment.py` runs ORA or GSEA end-to-end and writes a results table plus a dotplot, handling the boilerplate (symbol cleanup, dedup, NA removal, rank construction from a DESeq2 table, per-library FDR filtering).\n\n```bash\n# ORA from a hit list (one gene symbol per line)\npython scripts\u002Frun_enrichment.py ora \\\n  --genes deg_symbols.txt \\\n  --libraries MSigDB_Hallmark_2020 GO_Biological_Process_2023 KEGG_2021_Human \\\n  --organism human --outdir results\u002F\n\n# Preranked GSEA from a DESeq2 results CSV (auto-builds the rank from `stat`)\npython scripts\u002Frun_enrichment.py gsea \\\n  --deseq2 deseq2_results.csv \\\n  --libraries MSigDB_Hallmark_2020 GO_Biological_Process_2023 \\\n  --organism human --outdir results\u002F --seed 123\n\n# Preranked GSEA from an explicit 2-column rank file (gene,score)\npython scripts\u002Frun_enrichment.py gsea --rnk ranked_genes.csv --outdir results\u002F\n```\n\nRun `python scripts\u002Frun_enrichment.py --help` for all options (background file, FDR cutoff, min\u002Fmax set size, permutations).\n\n## Common Pitfalls\n\nThese cause most wrong or irreproducible results:\n\n1. **Gene-ID \u002F organism mismatch** — symbols vs Ensembl, human vs mouse casing. Map IDs and set `organism` correctly, or matches silently drop to ~zero.\n2. **Wrong background (ORA)** — using the whole genome instead of the tested\u002Fexpressed gene set inflates p-values. Set a custom background when it matters.\n3. **Thresholding before GSEA** — GSEA needs the *full* ranked list; only ORA uses a cut list.\n4. **Ranking GSEA by log2FoldChange alone** — unstable for low-count genes; prefer `stat` or `sign(LFC) * -log10(p)`.\n5. **Multiple-testing across libraries** — FDR is computed *within* a library; running many libraries multiplies tests. Report per-library FDR and stay conservative.\n6. **Redundant GO terms** — don't report 40 variants of the same term; collapse and show representatives.\n7. **Significance ≠ relevance** — check the overlap count and gene-set size; tiny sets reach significance trivially.\n8. **List too short\u002Flong for ORA** — \u003C10 genes is underpowered; >2000 loses specificity (consider GSEA instead).\n9. **No reproducibility metadata** — Enrichr\u002FGO libraries are versioned and drift over time. Record library names+date and set a GSEA `seed`.\n\n## Integration with Other Skills\n\n- **Upstream (where genes come from):** `pydeseq2` (DE genes + `stat` for GSEA), `scanpy` (`rank_genes_groups` markers \u002F scores), `depmap`\u002F`pytdc` (screen hits), proteomics skills (`pyopenms`, `matchms`).\n- **Databases \u002F IDs:** `database-lookup` (Reactome, KEGG, STRING, Gene Ontology APIs), `gget` (`gget enrichr` quick path, `gget info` for ID mapping), `bioservices`.\n- **Downstream:** `scientific-visualization` (custom figures), `networkx` (enrichment-map graphs), `scientific-writing` \u002F `literature-review` (interpret and cite), `statistical-analysis` (multiple-testing details).\n\n## Reference Files\n\nRead the relevant file when you need depth:\n\n- `references\u002Fgseapy.md` — full gseapy API: `enrichr`, offline `enrich`, `prerank`, `gsea`, `ssgsea`, `gsva`, `Msigdb`, `Biomart`, `get_library_name`\u002F`read_gmt`, every plot, result-column meanings, GMT\u002Foffline usage, and troubleshooting (rate limits, empty results).\n- `references\u002Fdatabases-and-gene-sets.md` — GO, KEGG, Reactome, WikiPathways, MSigDB collections, Enrichr library naming, g:Profiler sources, organism handling, gene-ID conversion, library selection by question, and pointers to Reactome\u002FSTRING APIs and decoupler activity inference.\n- `references\u002Finterpretation.md` — ORA vs GSEA statistics, background-universe choice, multiple-testing methods (BH vs g:SCS vs Bonferroni), leading-edge genes, redundancy reduction, effect vs significance, a publication-table template, and reproducibility checklist.\n\n## Resources\n\n- gseapy docs: https:\u002F\u002Fgseapy.readthedocs.io\u002F · repo: https:\u002F\u002Fgithub.com\u002Fzqfang\u002FGSEApy\n- g:Profiler: https:\u002F\u002Fbiit.cs.ut.ee\u002Fgprofiler\u002F · Python client: https:\u002F\u002Fpypi.org\u002Fproject\u002Fgprofiler-official\u002F\n- Enrichr: https:\u002F\u002Fmaayanlab.cloud\u002FEnrichr\u002F · MSigDB: https:\u002F\u002Fwww.gsea-msigdb.org\u002Fgsea\u002Fmsigdb\u002F\n- GSEA method: Subramanian et al. (2005) PNAS, DOI: 10.1073\u002Fpnas.0506580102\n\n## Related skills\n\n- `bulk-rnaseq`: End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp\u002FTrim Galore), alignment and quantificat…\n- `bioservices`: Unified Python interface to 40+ bioinformatics services.\n- `gget`: Queries 20+ bioinformatics databases and analysis services through the gget CLI and Python package, covering Ensembl gene search, info and…\n",{"name":5,"license":15,"metadata":44,"description":7},{"tags":45,"version":46,"category":47,"maintainer":48},"pathway enrichment, gene set enrichment, GSEA, functional analysis, bioinformatics","1.1","life-sciences","Kalaris Labs","main","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Fkal-pathway-enrichment","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6","https:\u002F\u002Fdisha6.6.thenitishkr.in\u002F","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh","www.thenitishkr","thenitishkr | AI • Cyber-security • Research\r\n","2026-11-08 03:33:25",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill pathway-enrichment",{"tool":64,"command":65},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill pathway-enrichment",{"tool":67,"command":68},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill pathway-enrichment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002FSKILL.md",true,[72,78,82,86],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fdatabases-and-gene-sets.md","REFERENCE","参考文档",6418,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002Freferences\u002Fdatabases-and-gene-sets.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fgseapy.md",7720,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002Freferences\u002Fgseapy.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Finterpretation.md",5985,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002Freferences\u002Finterpretation.md",{"path":87,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"scripts\u002Frun_enrichment.py","SCRIPT","脚本",8550,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-pathway-enrichment\u002Fscripts\u002Frun_enrichment.py",[93,124,148,175,198,222],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":104,"publishedAt":39},"01M6QRD07D4TGNDK6VJ4EHF8BV","youtube-full","Use when the user needs YouTube transcripts, video search, channel browsing, playlist extraction, or content monitoring. Trigger phrases: 'get the transcript for', 'search YouTube for', 'what are the latest videos on', 'list this playlist', 'monitor this channel', or any request involving a YouTube URL, video ID, or @handle. Do NOT use for downloading video or audio files, YouTube engagement data (likes, comments), or private\u002Fage-restricted videos.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fyoutube-full\u002FSKILL.md",[99],{"categoryNo":100,"categoryName":101,"taxonomyType":102,"taxonomyTypeDesc":103},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,24,121,122,123],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","browsing","request","youtube transcripts",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":39},"01M6QRCJ3112VYPA97YG7KGMC2","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[131,132,133,134,109,135,136,137,138,139,140,141,142,143,35,144,145,146,147,24],"twitter","x twitter growth","growth","research","content","engineering","plan","web search","competitors","analyze","engine","write","strategy","platform","grow","posting","competitive",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":157,"publishedAt":39},"01M6QRBN3EHQNJY42RERP7A149","write-a-skill","Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, build, or author a new skill.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[154],{"categoryNo":155,"categoryName":156,"taxonomyType":102,"taxonomyTypeDesc":103},"01JBSEEDCAT000000000000023","Skill与智能体开发",[158,142,159,160,161,162,163,164,35,165,166,49,167,168,169,170,171,172,173,174],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":39},"01M6QRB6G8P33PNGAF9Y69EJ9T","wrap-up","Close out a launched Claude Managed Agent — recap every primitive the founder now owns, regenerate the single-file overview page, and suggest the next 1-2 upgrades. Use when the user says \"wrap up\", \"close this out\", \"what do I own now\", \"give me the summary\", \"recap the agent\", or when the orchestrator routes phase=wrap-up. primitives_inventory.py tables everything owned (agent, environment, session, memory, outcome, deployment); overview_page.py regenerates a self-contained .\u002Fmy-agent\u002Fagent-overview.html; upgrade_suggester.py ranks the next moves from recorded deferrals plus standing hardening steps. Companion to run-without-you; the last stop before phase=done.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[182,183,184,185,186,37,187,188,189,35,190,116,191,192,193,194,195,26,196,197],"wrap up","up","wrap","gemini","deployment","file","hardening","closeout","stop","upgrade","founder","close","companion","you","directions","phase",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":205,"publishedAt":39},"01M6QRA5AYC1RBFZ39GTWGS3N8","workflow-builder","Design and write deterministic multi-agent workflow scripts (.js files in .claude\u002Fworkflows\u002F) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-builder\u002FSKILL.md",[204],{"categoryNo":155,"categoryName":156,"taxonomyType":102,"taxonomyTypeDesc":103},[206,207,208,209,210,160,37,211,212,213,214,215,142,216,115,217,218,219,220,221],"workflow","workflow builder","builder","design","workflows","code","orchestrate","pipeline","loop","multi-agent","context","across","fresh","scripts","judge","claude code workflow",{"skillNo":223,"name":224,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":228,"publishedAt":39},"01M6QR7QMCZESKQA0ERW1E657M","weekly-review","Use when someone wants to run a weekly review, close open loops, audit stalled projects and commitments, get their system back to trusted, restart a lapsed review habit, or says \"\u002Fcs:weekly-review\". Walks David Allen's three-phase loop — GET CLEAR, GET CURRENT, GET CREATIVE — with deterministic scripts that inventory open loops, gate the checklist with named gaps, and score commitment health 0-100.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[229,230,231,232,233,234,235,236,237,214,238,239,240,241,242,243,117,244,245,197],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","open","team","projects","project-management","scanner","conversation","back","project","sprint","cadence"]