schlesnerlab/multicondition-deseq2-enrichment

Workflow dervied form https://github.com/snakemake-workflows/rna-seq-star-deseq2 for multi condition Deseq2 and enrichment analyis

Overview

Topics:

Latest release: v0.2.0, Last update: 2025-01-27

Linting: linting: failed, Formatting:formatting: passed

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.

When using Mamba, run

mamba create -c conda-forge -c bioconda --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

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/schlesnerlab/multicondition-deseq2-enrichment . --tag v0.2.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.

Config setup

Configfile

Here

  • samples: Path to samples file

    • format .tsv
    • required columns: sample
  • counts: Path to count file

    • format: .tsv
    • format: first column gene names
    • column names == sample column from samples
  • gene_name_type:

    • system used for gene naming
    • supports
      • ENSEMBL
      • HGNC
      • ENTREZ_ID
    • organisms:
      • Mus musculus
      • Homo sapiens
  • dirs: Directories

    • BASE_DATA_DIR: Directory where data is saved
    • BASE_ANALYSIS_DIR: Directory where results are saved
  • pca:

    • labels: columns of sample sheet used for PCA plots (Used in snakemake report)
  • diffexp: conditions for PCA

    • gsea_use_stat: bool, If true Walds test statistic used for gsea. Else we use log2FC * -log10(p- value)
    • pval_threshold: padj threshold for DESeq2 test
    • LFC_threshold: absolute log2 fold change threshold
    • contrasts: object containing the contrasts
      • <contrast_name>
        • <Comparison_one>
          • group_1
          • group_2
      • model: design formula definition for DESeq2 all variables need to be present in the sample .tsv file
  • group_colors: colors to use in plots for groups

    • <contrast_name>
      • group: color
    • Color is accepted either as a name or hex code
      • "red" or "#ff0000"
  • run_mitch: bool whether to run mitch on GSEA results

  • run_carnival:

    • vanilla: bool Run vanilla carnival on DESeq2 results with perturbation targets (Custom gene support not added yet)
    • inverse: bool Run carnival on DESeq results without defined perturbation targets
    • sample: bool Run carnival on each sample separately
    • joint_rep: bool Generate joint HTML report for one contrast across all comparisons
  • cplex_solver: Path to the cplex solver executable.

  • DKFZ: bool. Optional parameter that can be enabled when running on data from DKFZ infrastructure.

Sample sheet

THe sample sheet is required so that the workflow knows which condition is associated to each sample.

Each sample should have an id which is identical in the count matrix and the first column of the sample sheet. After all contrast_names used in the config file need to have a column in the sample sheet.

Have a look at data/test_data for example data used in the DESeq2 vignette.

Linting and formatting

Linting results

KeyError in file /tmp/tmp563nm2fb/schlesnerlab-multicondition-deseq2-enrichment-a4e8f97/workflow/Snakefile, line 18:
'samples'
  File "/tmp/tmp563nm2fb/schlesnerlab-multicondition-deseq2-enrichment-a4e8f97/workflow/Snakefile", line 18, in <module>

Formatting results

None