Skip to the content.

Genomic Region Set & (Ranked) Gene Set Enrichment Analysis & Visualization Snakemake Workflow for Human and Mouse Genomes.

DOI

Given human (hg19 or hg38) or mouse (mm9 or mm10) based genomic region sets (i.e., region sets) and/or (ranked) gene sets of interest and respective background region/gene sets, the enrichment within the configured databases is determined using LOLA, GREAT, GSEApy (over-representation analysis (ORA) & preranked GSEA) and results saved as CSV files. Additionally, the most significant results are plotted for each region/gene set, database queried, and analysis performed. Finally, the results within the same “group” (e.g., stemming from the same DEA) are aggregated per database and analysis in summary CSV files and visualized using hierarchically clustered heatmaps and bubble plots. For collaboration, communication and documentation of results, methods and workflow information a detailed self-contained HTML report can be generated.

This workflow adheres to the module specifications of MR. PARETO, an effort to augment research by modularizing (biomedical) data science. For more details and modules check out the project’s repository.

If you use this workflow in a publication, please don’t forget to give credits to the authors by citing it using this DOI 10.5281/zenodo.7810621.

Workflow Rulegraph

Table of contents

Authors

Software

This project wouldn’t be possible without the following software and their dependencies:

Software Reference (DOI)
Enrichr https://doi.org/10.1002/cpz1.90
ggplot2 https://ggplot2.tidyverse.org/
GREAT https://doi.org/10.1371/journal.pcbi.1010378
GSEA https://doi.org/10.1073/pnas.0506580102
GSEApy https://doi.org/10.1093/bioinformatics/btac757
LOLA https://doi.org/10.1093/bioinformatics/btv612
pandas https://doi.org/10.5281/zenodo.3509134
pheatmap https://cran.r-project.org/package=pheatmap
rGREAT https://doi.org/10.1093/bioinformatics/btac745
Snakemake https://doi.org/10.12688/f1000research.29032.2

Methods

This is a template for the Methods section of a scientific publication and is intended to serve as a starting point. Only retain paragraphs relevant to your analysis. References [ref] to the respective publications are curated in the software table above. Versions (ver) have to be read out from the respective conda environment specifications (workflow/envs/*.yaml files) or post execution (results_dir/envs/enrichment_analysis/*.yaml files). Parameters that have to be adapted depending on the data or workflow configurations are denoted in squared brackets e.g. [X].

The outlined analyses were performed using the programming languages R (ver) [ref] and Python (ver) [ref] unless stated otherwise. All approaches statistically correct their results using expressed/accessible background genomic region/gene sets from the respective analyses that yielded the query region/gene sets.

Genomic region set enrichment analyses

LOLA. Genomic region set enrichment analysis was performed using LOLA (ver) [ref], which uses Fisher’s exact test. The following databases were queried [lola_dbs].

GREAT. Genomic region set enrichment analysis was performed using GREAT [ref] implemented with rGREAT (ver) [ref]. The following databases were queried [great_dbs].

Furthermore, genomic regions (query- and background-sets) were mapped to genes using GREAT and then analyzed as gene-sets as described below for a complementary and extended perspective.

Gene set enrichment analyses (GSEA)

Over-representation analysis (ORA). Gene set ORA was performed using Enrichr [ref], which uses Fisher’s exact test (i.e., hypergeometric test), implemented with GSEApy’s (ver) [ref] function enrich. The following databases were queried [enrichr_dbs][local_gmt_dbs][local_json_dbs].

Preranked GSEA. Preranked GSEA was performed using GSEA [ref], implemented with GSEApy’s (ver) [ref] function prerank. The following databases were queried [enrichr_dbs][local_gmt_dbs][local_json_dbs].

Aggregation The results of all queries belonging to the same analysis [group] were aggregated by method and database. Additionally, we filtered the results by retaining only the union of terms that were statistically significant (i.e. [adj_pvalue]<[adjp_th]) in at least one query.

Visualization All analysis results were visualized in the same way.

For each query, method and database combination an enrichment dot plot was used to visualize the most important results. The top [top_n] terms were ranked (along the y-axis) by the mean rank of statistical significance ([p_value]), effect-size ([effect_size]), and overlap ([overlap]) with the goal to make the results more balanced and interpretable. The significance (adjusted p-value) is denoted by the dot color, effect-size by the x-axis position, and overlap by the dot size.

The aggregated results per analysis [group], method and database combination were visualized using hierarchically clustered heatmaps and bubble plots. The union of the top [top_terms_n] most significant terms per query were determined and their effect-size and significance were visualized as hierarchically clustered heatmaps, and statistical significance ([adj_pvalue] < [adjp_th]) was denoted by *. Furthermore, a hierarchically clustered bubble plot encoding both effect-size (color) and statistical significance (size) is provided, with statistical significance denoted by *. All summary visualizations’ values were capped by [adjp_cap]/[or_cap]/[nes_cap] to avoid shifts in the coloring scheme caused by outliers.

The analysis and visualizations described here were performed using a publicly available Snakemake (ver) [ref] workflow [10.5281/zenodo.7810621].

Features

The three tools LOLA, GREAT and GSEApy (over-representation analysis (ORA) & preranked GSEA) are used for various enrichment analyses. Databases to be queried can be configured (see ./config/config.yaml). All approaches statistically correct their results using the provided background region/gene sets.

Results

The result directory {result_path}/enrichment_analysis contains a folder for each region/gene-set {query} and {group}

Usage

Here are some tips for the usage of this workflow:

Configuration

Detailed specifications can be found here ./config/README.md

Examples

We provide four example queries:

We provide two local example databases

Follow these steps to run the complete analysis:

  1. activate your snakemake conda environment
     conda activate snakemake
    
  2. enter the workflow directory
     cd enrichment_analysis
    
  3. run a snakemake dry-run (-n flag) using the provided configuration to check if everything is in order
     snakemake -p --use-conda --configfile .test/config/example_enrichment_analysis_config.yaml -n
    
  4. run the workflow
     snakemake -p --use-conda --configfile .test/config/example_enrichment_analysis_config.yaml
    
  5. generate report
     snakemake --report .test/report.html --configfile .test/config/example_enrichment_analysis_config.yaml
    

Links

Resources

Publications

The following publications successfully used this module for their analyses.