BesenbacherLab/bbq_pipeline

Snakemake workflow for the Better Base Quality (BBQ) tool

Overview

Topics:

Latest release: v1.0.0, Last update: 2025-02-28

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/BesenbacherLab/bbq_pipeline . --tag v1.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.

General settings

To configure this workflow, modify config/config.yaml according to your needs. config/config.yaml handles the reference genome details and all tunable parameters of BBQ.

A complete list of accepted keys with default values, expected types and human readable descriptions is available in schemas.

Reference genome:

As a requirement, you need to provide a path to the reference genome FASTA file. The workflow will then create a twoBit file of the reference genome that is used by several BBQ commands. If you already have the reference genome in the twoBit format, you can provide a path to it using the twobit key.

By default the full reference genome is used for the analysis. You can specify regions of interest or blacklist regions with split_bed and exclude_bed parameters, respectively.

To speed up the k-mer counting and variant calling, the reference genome is split non-overlapping regions of 8Mb by default. The region length can be changed by adjusting the split_region_length parameter.

BBQ

All tunable parameters of BBQ are set to the default values by the config schema (see ../workflow/schemas/config.schema.yaml). To modify parameter values, specify the intended key,value pair in the config/config.yaml.

Sample and unit sheet

You can specify the samples you want to call variants for in the config/samples.tsv file. As a requirement, sample name and bam_file need to be specified. Optionally, you can add the filter_bam_file path, which represents the germline sequence of the respective sample and is used to exclude germline variants during variant calling.

Linting and formatting

Linting results

Using workflow specific profile workflow/profiles/default for setting default command line arguments.
usage: snakemake [-h] [--dry-run] [--profile PROFILE]
                 [--workflow-profile WORKFLOW_PROFILE] [--cache [RULE ...]]
                 [--snakefile FILE] [--cores N] [--jobs N] [--local-cores N]
                 [--resources NAME=INT [NAME=INT ...]]
                 [--set-threads RULE=THREADS [RULE=THREADS ...]]
                 [--max-threads MAX_THREADS]
                 [--set-resources RULE:RESOURCE=VALUE [RULE:RESOURCE=VALUE ...]]
                 [--set-scatter NAME=SCATTERITEMS [NAME=SCATTERITEMS ...]]
                 [--set-resource-scopes RESOURCE=[global|local]
                 [RESOURCE=[global|local] ...]]
                 [--default-resources [NAME=INT ...]]
                 [--preemptible-rules [PREEMPTIBLE_RULES ...]]
                 [--preemptible-retries PREEMPTIBLE_RETRIES]
                 [--configfile FILE [FILE ...]] [--config [KEY=VALUE ...]]
                 [--envvars VARNAME [VARNAME ...]] [--directory DIR] [--touch]
                 [--keep-going]
                 [--rerun-triggers {code,input,mtime,params,software-env} [{code,input,mtime,params,software-env} ...]]
                 [--force] [--executor {local,dryrun,touch}] [--forceall]
                 [--forcerun [TARGET ...]]

... (truncated)

Formatting results

[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/common.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/count_kmers.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/Snakefile":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/reference.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/call_variants.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/install_bbq.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/train_model.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/filter_variants.smk":  Formatted content is different from original
[INFO] 8 file(s) would be changed 😬

snakefmt version: 0.10.2