epigen/enrichment_analysis

A Snakemake workflow and MrBiomics module for performing genomic region set and gene set enrichment analyses using LOLA, GREAT, GSEApy, pycisTarget and RcisTarget.

Overview

Latest release: v3.0.0, Last update: 2026-06-08

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=epigen/enrichment_analysis

Quality control: linting: passed formatting: failed

Topics: bioinformatics genomic-regions enrichment-analysis atac-seq biomedical-data-science chip-seq gene-set-enrichment gene-sets rna-seq visualization pipeline snakemake workflow motif-enrichment-analysis

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run

conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

For other installation methods, refer to the Snakemake and Snakedeploy documentation.

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/epigen/enrichment_analysis . --tag v3.0.0

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

You need one configuration file and one annotation file to run the complete workflow. You can use the provided example as starting point. If in doubt read the comments in the config and/or try the default values.

  • project configuration (config/config.yaml): different for every project/dataset and configures the analyses to be performed and databases to be used. The fields are described within the file.

  • annotation: CSV file consisting of 5 mandatory columns

    • name: unique(!) name of the query gene/region set

    • features_path: one of the following

      • path to a query genomic region set as .bed file, which will be analyzed using LOLA, GREAT, pycisTarget and ORA_GSEApy, RcisTarget (using the region-gene association provided by GREAT)

      • path to a query gene set as .txt file with one gene per line, which will be analyzed using ORA_GSEApy and RcisTarget

      • path to a query (preranked) gene-score table with a header as .csv file, where the first column consists of gene-symbols/names and the second of corresponding gene-scores (e.g., from differential expression analysis results), which will be analyzed using preranked_GSEApy

    • background_name: name of the background gene/region set (only required for region- and gene-sets, leave empty for gene-score tables)

    • background_path: path to the background/universe gene/region-set as .txt/.bed file (only required for region- and gene-sets, leave empty for gene-score tables)

    • group: enrichment results are aggregated and visualized per analysis and database based on this group variable (e.g., gene/region-sets resulting from the same analysis)

For region-set inputs (features_path or background_path ending in .bed),the workflow expects standard BED coordinates.

  • BED is 0-based, start-inclusive, end-exclusive, i.e. in interval notation: [start, end).

  • This means:

    • the first base of a chromosome is 0

    • a region with start=0 and end=100 spans exactly 100 bases: positions 0 to 99

  • additionally, the workflow requires at least the first 3 BED columns: chrom, start, end.

Set workflow-specific resources or command line arguments (CLI) in the workflow profile workflow/profiles/default.config.yaml, which supersedes global Snakemake profiles.

Workflow parameters

The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.

Parameter

Type

Description

Required

Default

mem

integer

yes

threads

integer

yes

annotation

string

yes

result_path

string

yes

project_name

string

yes

genome

string

yes

local_databases

yes

lola_databases

yes

great_parameters

yes

. min_gene_set_size

integer

yes

. mode

string

yes

. basal_upstream

integer

yes

. basal_downstream

integer

yes

. extension

integer

yes

. map_associated_regions

integer

1

pycistarget_parameters

yes

. databases

yes

. path_to_motif_annotations

string

yes

. temp_dir

string

yes

. fraction_overlap_w_cistarget_database

number

yes

. auc_threshold

number

yes

. nes_threshold

number

yes

. rank_threshold

number

yes

. annotation_version

string

yes

. annotations_to_use

array

yes

. motif_similarity_fdr

number

yes

. orthologous_identity_threshold

number

yes

rcistarget_parameters

yes

. databases

yes

. motifAnnot

string

yes

. motifAnnot_highConfCat

array

yes

. motifAnnot_lowConfCat

array

yes

. nesThreshold

number

yes

. aucMaxRank_factor

number

yes

. geneErnMethod

string

yes

. geneErnMaxRank

integer

yes

column_names

yes

. ORA_GSEApy

yes

. preranked_GSEApy

yes

. GREAT

yes

. LOLA

yes

. pycisTarget

yes

. RcisTarget

yes

adjp_th

yes

. ORA_GSEApy

number

yes

. preranked_GSEApy

number

yes

. GREAT

number

yes

. LOLA

number

yes

. pycisTarget

number

yes

. RcisTarget

number

yes

top_terms_n

integer

yes

adjp_cap

number

yes

or_cap

number

yes

nes_cap

number

yes

cluster_summary

integer

yes

Linting and formatting

Linting results
All tests passed!
Formatting results
 1[DEBUG] 
 2[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/rules/common.smk":  Formatted content is different from original
 3[DEBUG] 
 4[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/Snakefile":  Formatted content is different from original
 5[DEBUG] 
 6[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/rules/envs_export.smk":  Formatted content is different from original
 7[DEBUG] 
 8[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/rules/enrichment_analysis.smk":  Formatted content is different from original
 9[DEBUG] 
10[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/rules/resources.smk":  Formatted content is different from original
11[DEBUG] 
12[DEBUG] In file "/tmp/tmpdojc0k9r/epigen-enrichment_analysis-0829687/workflow/rules/aggregate.smk":  Formatted content is different from original
13[INFO] 6 file(s) would be changed 😬
14
15snakefmt version: 0.11.5