SKILL.md
Version Compatibility
Reference examples tested with: ReactomePA 1.46+, clusterProfiler 4.10+, rWikiPathways 1.24+
Before using code patterns, verify installed versions match. If versions differ:
- R:
packageVersion('<pkg>')then?function_nameto 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.
WikiPathways Enrichment
Core Pattern - Over-Representation Analysis
Goal: Identify WikiPathways that are over-represented in a gene list.
Approach: Test for enrichment using enrichWP against community-curated open-source pathway definitions.
"Run pathway enrichment against WikiPathways" → Test whether genes from community-curated WikiPathways are over-represented among significant genes.
library(clusterProfiler)
library(org.Hs.eg.db)
wp_result <- enrichWP(
gene = entrez_ids, # Character vector of Entrez IDs
organism = 'Homo sapiens', # Full species name
pvalueCutoff = 0.05,
pAdjustMethod = 'BH'
)
head(as.data.frame(wp_result))
Prepare Gene List
Goal: Extract significant Entrez gene IDs from DE results for WikiPathways enrichment.
Approach: Filter by significance thresholds and convert gene symbols to Entrez IDs with bitr.
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 WikiPathways
Goal: Detect coordinated expression changes in WikiPathways using a ranked gene list.
Approach: Sort genes by fold change and run gseWP for rank-based enrichment testing.
