rnaseq-functional-enrichment
Gene set enrichment and over-representation analysis using clusterProfiler, gseapy, or fgsea, with GO, KEGG, and Reactome pathway databases.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- rnaseq-functional-enrichment
- description
- Gene set enrichment and over-representation analysis using clusterProfiler, gseapy, or fgsea, with GO, KEGG, and Reactome pathway databases.
02 资源文件 10
- 参考文档agents/claude.yaml341 B
- 参考文档agents/openai.yaml342 B
- 参考文档agents/README.md322 B
- 资产文件assets/.gitkeep—
- 参考文档config.yaml332 B
- 参考文档references/enrichment-tools.md6.5 KB
- 参考文档references/README.md68 B
- 脚本scripts/run_enrichment.py15.5 KB
- 脚本scripts/run_enrichment.R24.2 KB
- 脚本scripts/run.sh5.8 KB
03 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.dbfor human) - Gene ID type:
SYMBOL,ENSEMBL, orENTREZID(default:SYMBOL) - FDR cutoff (default:
0.05) - Analysis type:
oraorgsea(default:orafor DE table input,gseafor 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:
clusterProfilerorgseapy(default:clusterProfilerfor R environments;gseapyfor Python-only environments)
- Organism database (default:
Workflow
- 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.
- Map gene IDs to ENTREZID using
bitr()(clusterProfiler) or an annotation database. Deduplicate any genes that map to multiple Entrez IDs. - For ORA: run
enrichGO()(BP, CC, MF),enrichKEGG(), and optionallyenrichPathway()(Reactome) on the significant gene list. - For GSEA: run
gseGO()(BP) andgseKEGG()on the full ranked gene vector. - Filter results by FDR threshold and gene set size limits.
- Generate plots: dotplot (top 20 terms), barplot (top 20 pathways), network/emapplot (pathway overlap), gene-concept network (cnetplot).
- Write all enrichment result tables as TSV and plots as PDFs to the output directory.
- 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, andenrichplotinstalled (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
ReactomePApackage - 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
04 同仓库更多 Skills
structured-intelligence-skill-creator
Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.
stat-survival-analysis
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
stat-pca
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
stat-nonlinear-embedding
Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
stat-logistic-regression
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).