bio-pathway-reactome
Reactome pathway enrichment using ReactomePA package. Use when analyzing gene lists against Reactome's curated peer-reviewed pathway database. Performs over-representation analysis and GSEA with visualization and pathway hierarchy exploration.
Best use case
bio-pathway-reactome is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Reactome pathway enrichment using ReactomePA package. Use when analyzing gene lists against Reactome's curated peer-reviewed pathway database. Performs over-representation analysis and GSEA with visualization and pathway hierarchy exploration.
Teams using bio-pathway-reactome should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bio-pathway-reactome/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bio-pathway-reactome Compares
| Feature / Agent | bio-pathway-reactome | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Reactome pathway enrichment using ReactomePA package. Use when analyzing gene lists against Reactome's curated peer-reviewed pathway database. Performs over-representation analysis and GSEA with visualization and pathway hierarchy exploration.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
## Version Compatibility
Reference examples tested with: R stats (base), ReactomePA 1.46+, clusterProfiler 4.10+
Before using code patterns, verify installed versions match. If versions differ:
- R: `packageVersion('<pkg>')` then `?function_name` to verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Reactome Pathway Enrichment
## Core Pattern - Over-Representation Analysis
**Goal:** Identify Reactome pathways over-represented in a gene list from differential expression or other analyses.
**Approach:** Test for enrichment using the hypergeometric test via ReactomePA enrichPathway against curated peer-reviewed pathways.
**"Run pathway enrichment against Reactome"** → Test whether genes in curated Reactome pathways are over-represented among significant genes.
```r
library(ReactomePA)
library(org.Hs.eg.db)
pathway_result <- enrichPathway(
gene = entrez_ids, # Character vector of Entrez IDs
organism = 'human', # human, rat, mouse, celegans, yeast, zebrafish, fly
pvalueCutoff = 0.05,
pAdjustMethod = 'BH',
readable = TRUE # Convert to gene symbols
)
head(as.data.frame(pathway_result))
```
## Prepare Gene List from DE Results
**Goal:** Extract significant Entrez gene IDs from differential expression results for Reactome enrichment.
**Approach:** Filter by significance and fold change, then convert symbols to Entrez IDs using bitr.
```r
library(clusterProfiler)
de_results <- read.csv('de_results.csv')
sig_genes <- de_results[de_results$padj < 0.05 & abs(de_results$log2FoldChange) > 1, 'gene_symbol']
gene_ids <- bitr(sig_genes, fromType = 'SYMBOL', toType = 'ENTREZID', OrgDb = org.Hs.eg.db)
entrez_ids <- gene_ids$ENTREZID
```
## GSEA on Reactome Pathways
**Goal:** Detect coordinated expression changes in Reactome pathways using all genes ranked by a statistic.
**Approach:** Create a sorted named vector from DE results and run gsePathway for rank-based enrichment.
```r
# Create ranked gene list (named vector sorted by statistic)
gene_list <- de_results$log2FoldChange
names(gene_list) <- de_results$entrez_id
gene_list <- sort(gene_list, decreasing = TRUE)
gsea_result <- gsePathway(
geneList = gene_list,
organism = 'human',
pvalueCutoff = 0.05,
pAdjustMethod = 'BH',
verbose = FALSE
)
head(as.data.frame(gsea_result))
```
## With Background Universe
**Goal:** Restrict enrichment testing to only genes that were actually measured in the experiment.
**Approach:** Pass all tested gene IDs as the universe parameter to enrichPathway.
```r
all_genes <- de_results$entrez_id # All tested genes
pathway_result <- enrichPathway(
gene = entrez_ids,
universe = all_genes, # Background gene set
organism = 'human',
pvalueCutoff = 0.05,
readable = TRUE
)
```
## Visualization
**Goal:** Create publication-quality plots of Reactome enrichment results.
**Approach:** Use enrichplot functions (dotplot, barplot, emapplot, cnetplot, gseaplot2) on enrichment result objects.
```r
library(enrichplot)
# Dot plot
dotplot(pathway_result, showCategory = 15)
# Bar plot
barplot(pathway_result, showCategory = 15)
# Enrichment map (requires pairwise_termsim first)
pathway_result <- pairwise_termsim(pathway_result)
emapplot(pathway_result)
# Gene-concept network
cnetplot(pathway_result, categorySize = 'pvalue')
# GSEA plot
gseaplot2(gsea_result, geneSetID = 1:3)
```
## View Pathway in Browser
```r
# Open pathway in Reactome browser
viewPathway('R-HSA-109582', organism = 'human') # Uses pathway ID
# Get pathway ID from results
top_pathway_id <- pathway_result@result$ID[1]
viewPathway(top_pathway_id, organism = 'human')
```
## Export Results
```r
results_df <- as.data.frame(pathway_result)
write.csv(results_df, 'reactome_enrichment.csv', row.names = FALSE)
# Key columns: ID, Description, GeneRatio, BgRatio, pvalue, p.adjust, geneID, Count
```
## Different Organisms
```r
# Mouse
pathway_mouse <- enrichPathway(gene = mouse_entrez, organism = 'mouse', readable = TRUE)
# Rat
pathway_rat <- enrichPathway(gene = rat_entrez, organism = 'rat', readable = TRUE)
# Zebrafish
pathway_zfish <- enrichPathway(gene = zfish_entrez, organism = 'zebrafish', readable = TRUE)
# Supported: human, rat, mouse, celegans, yeast, zebrafish, fly
```
## Compare Clusters
**Goal:** Compare Reactome pathway enrichment across multiple gene lists (e.g., upregulated vs downregulated).
**Approach:** Use compareCluster with enrichPathway to run enrichment per group and visualize side by side.
```r
# Compare pathways across multiple gene lists
gene_clusters <- list(
upregulated = up_genes,
downregulated = down_genes
)
compare_result <- compareCluster(
geneClusters = gene_clusters,
fun = 'enrichPathway',
organism = 'human',
pvalueCutoff = 0.05
)
dotplot(compare_result)
```
## Key Parameters
| Parameter | Default | Description |
|-----------|---------|-------------|
| gene | required | Vector of Entrez IDs |
| organism | human | Species name |
| pvalueCutoff | 0.05 | P-value threshold |
| pAdjustMethod | BH | Adjustment method |
| universe | NULL | Background genes |
| minGSSize | 10 | Min genes per pathway |
| maxGSSize | 500 | Max genes per pathway |
| readable | FALSE | Convert to symbols |
## Supported Organisms
| Organism | Name | OrgDb |
|----------|------|-------|
| Human | human | org.Hs.eg.db |
| Mouse | mouse | org.Mm.eg.db |
| Rat | rat | org.Rn.eg.db |
| Zebrafish | zebrafish | org.Dr.eg.db |
| Fly | fly | org.Dm.eg.db |
| C. elegans | celegans | org.Ce.eg.db |
| Yeast | yeast | org.Sc.sgd.db |
## Related Skills
- go-enrichment - Gene Ontology enrichment
- kegg-pathways - KEGG pathway enrichment
- wikipathways - WikiPathways enrichment
- gsea - Gene Set Enrichment Analysis
- enrichment-visualization - Visualization functionsRelated Skills
reactome-database
Query Reactome REST API for pathway analysis, enrichment, gene-pathway mapping, disease pathways, molecular interactions, expression analysis, for systems biology studies.
bio-pathway-wikipathways
WikiPathways enrichment using clusterProfiler and rWikiPathways. Use when analyzing gene lists against community-curated open-source pathways. Performs over-representation analysis and GSEA for 30+ species.
bio-pathway-kegg-pathways
KEGG pathway and module enrichment analysis using clusterProfiler enrichKEGG and enrichMKEGG. Use when identifying metabolic and signaling pathways over-represented in a gene list. Supports 4000+ organisms via KEGG online database.
bio-pathway-gsea
Gene Set Enrichment Analysis using clusterProfiler gseGO and gseKEGG. Use when analyzing ranked gene lists to find coordinated expression changes in gene sets without arbitrary significance cutoffs. Detects subtle but coordinated expression changes.
bio-pathway-go-enrichment
Gene Ontology over-representation analysis using clusterProfiler enrichGO. Use when identifying biological functions enriched in a gene list from differential expression or other analyses. Supports all three ontologies (BP, MF, CC), multiple ID types, and customizable statistical thresholds.
bio-pathway-enrichment-visualization
Visualize enrichment results using enrichplot package functions. Use when creating publication-quality figures from clusterProfiler results. Covers dotplot, barplot, cnetplot, emapplot, gseaplot2, ridgeplot, and treeplot.
bio-metabolomics-pathway-mapping
Map metabolites to biological pathways using KEGG, Reactome, and MetaboAnalyst. Perform pathway enrichment and topology analysis. Use when interpreting metabolomics results in the context of biochemical pathways.
zinc-database
Access ZINC (230M+ purchasable compounds). Search by ZINC ID/SMILES, similarity searches, 3D-ready structures for docking, analog discovery, for virtual screening and drug discovery.
zarr-python
Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.
xlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code