lacklab/epens-snakemake

Snakemake pipeline for the analysis of ePENS (ChIP-exo) data

Overview

Topics:

Latest release: None, Last update: 2024-11-18

Linting: linting: failed, Formatting:formatting: failed

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/lacklab/epens-snakemake . --tag None

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.

Edit these files:

  1. config.yaml: The config file. Only used parameters are:

SAMPLES which points to samples.tsv BWA_INDEX which points to the BWA index prefix CHR_SIZES which points to the chrom.sizes file (formatted as tab-separated; chrom name in the 1st column, size in the 2nd)

  1. samples.tsv: A tab-separated file with the following example should be provided to specify the units (technical replicates or lanes):
sample unit fq1 fq2
N1_rep1 1 data/SRR653223_1.fastq.gz data/SRR653223_2.fastq.gz
N1_rep2 1 data/SRR653224_1.fastq.gz data/SRR653224_2.fastq.gz

sample: Sample name (same as in samples.tsv)

unit: Unit (tech. rep such as sequencing lane) no

fq1: Path to the 1st FASTQ file

fq2: Path to the 2nd FASTQ file

IF THE FILE DOESN'T EXIST, IT WILL TRY TO DOWNLOAD FROM SRA USING PREFETCH

Linting and formatting

Linting results

/tmp/tmpo5brfeum/workflow/rules/signal.smk:49: SyntaxWarning: invalid escape sequence '\/'
/tmp/tmpo5brfeum/workflow/rules/signal.smk:63: SyntaxWarning: invalid escape sequence '\/'
Lints for rule prefetch (line 1, /tmp/tmpo5brfeum/workflow/rules/sra.smk):
    * No log directive defined:
      Without a log directive, all output will be printed to the terminal. In
      distributed environments, this means that errors are harder to discover.
      In local environments, output of concurrent jobs will be mixed and become
      unreadable.
      Also see:
      https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files

Lints for rule dump_fastq (line 11, /tmp/tmpo5brfeum/workflow/rules/sra.smk):
    * No log directive defined:
      Without a log directive, all output will be printed to the terminal. In
      distributed environments, this means that errors are harder to discover.
      In local environments, output of concurrent jobs will be mixed and become
      unreadable.
      Also see:
      https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files


... (truncated)

Formatting results

[DEBUG] 
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/rules/epest.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/Snakefile":  Formatted content is different from original
[DEBUG] 
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/rules/signal.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/rules/map.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/rules/common.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpo5brfeum/workflow/rules/sra.smk":  Formatted content is different from original
[INFO] 6 file(s) would be changed 😬

snakefmt version: 0.10.2