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
.
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.
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.
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
.
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
1Using workflow specific profile workflow/profiles/default for setting default command line arguments.
2usage: snakemake [-h] [--dry-run] [--profile PROFILE]
3 [--workflow-profile WORKFLOW_PROFILE] [--cache [RULE ...]]
4 [--snakefile FILE] [--cores N] [--jobs N] [--local-cores N]
5 [--resources NAME=INT [NAME=INT ...]]
6 [--set-threads RULE=THREADS [RULE=THREADS ...]]
7 [--max-threads MAX_THREADS]
8 [--set-resources RULE:RESOURCE=VALUE [RULE:RESOURCE=VALUE ...]]
9 [--set-scatter NAME=SCATTERITEMS [NAME=SCATTERITEMS ...]]
10 [--set-resource-scopes RESOURCE=[global|local]
11 [RESOURCE=[global|local] ...]]
12 [--default-resources [NAME=INT ...]]
13 [--preemptible-rules [PREEMPTIBLE_RULES ...]]
14 [--preemptible-retries PREEMPTIBLE_RETRIES]
15 [--configfile FILE [FILE ...]] [--config [KEY=VALUE ...]]
16 [--envvars VARNAME [VARNAME ...]] [--directory DIR] [--touch]
17 [--keep-going]
18 [--rerun-triggers {code,input,mtime,params,software-env} [{code,input,mtime,params,software-env} ...]]
19 [--force] [--executor {local,dryrun,touch}] [--forceall]
20 [--forcerun [TARGET ...]]
21 [--consider-ancient RULE=INPUTITEMS [RULE=INPUTITEMS ...]]
22 [--prioritize TARGET [TARGET ...]]
23 [--batch RULE=BATCH/BATCHES] [--until TARGET [TARGET ...]]
24 [--omit-from TARGET [TARGET ...]] [--rerun-incomplete]
25 [--shadow-prefix DIR] [--scheduler [{ilp,greedy}]]
26 [--wms-monitor [WMS_MONITOR]]
27 [--wms-monitor-arg [NAME=VALUE ...]]
28 [--scheduler-ilp-solver {PULP_CBC_CMD,COIN_CMD}]
29 [--conda-base-path CONDA_BASE_PATH] [--no-subworkflows]
30 [--precommand PRECOMMAND] [--groups GROUPS [GROUPS ...]]
31 [--group-components GROUP_COMPONENTS [GROUP_COMPONENTS ...]]
32 [--report [FILE]] [--report-stylesheet CSSFILE]
33 [--reporter PLUGIN] [--draft-notebook TARGET]
34 [--edit-notebook TARGET] [--notebook-listen IP:PORT]
35 [--lint [{text,json}]] [--generate-unit-tests [TESTPATH]]
36 [--containerize] [--export-cwl FILE] [--list-rules]
37 [--list-target-rules] [--dag] [--rulegraph] [--filegraph]
38 [--d3dag] [--summary] [--detailed-summary] [--archive FILE]
39 [--cleanup-metadata FILE [FILE ...]] [--cleanup-shadow]
40 [--skip-script-cleanup] [--unlock]
41 [--list-changes {input,code,params}] [--list-input-changes]
42 [--list-params-changes] [--list-untracked]
43 [--delete-all-output | --delete-temp-output]
44 [--keep-incomplete] [--drop-metadata] [--version]
45 [--printshellcmds] [--debug-dag] [--nocolor]
46 [--quiet [{all,host,progress,rules} ...]]
47 [--print-compilation] [--verbose] [--force-use-threads]
48 [--allow-ambiguity] [--nolock] [--ignore-incomplete]
49 [--max-inventory-time SECONDS] [--latency-wait SECONDS]
50 [--wait-for-files [FILE ...]] [--wait-for-files-file FILE]
51 [--queue-input-wait-time SECONDS] [--notemp] [--all-temp]
52 [--unneeded-temp-files FILE [FILE ...]]
53 [--keep-storage-local-copies]
54 [--target-files-omit-workdir-adjustment]
55 [--allowed-rules ALLOWED_RULES [ALLOWED_RULES ...]]
56 [--max-jobs-per-timespan MAX_JOBS_PER_TIMESPAN]
57 [--max-jobs-per-second MAX_JOBS_PER_SECOND]
58 [--max-status-checks-per-second MAX_STATUS_CHECKS_PER_SECOND]
59 [--seconds-between-status-checks SECONDS_BETWEEN_STATUS_CHECKS]
60 [--retries RETRIES] [--wrapper-prefix WRAPPER_PREFIX]
61 [--default-storage-provider DEFAULT_STORAGE_PROVIDER]
62 [--default-storage-prefix DEFAULT_STORAGE_PREFIX]
63 [--local-storage-prefix LOCAL_STORAGE_PREFIX]
64 [--remote-job-local-storage-prefix REMOTE_JOB_LOCAL_STORAGE_PREFIX]
65 [--shared-fs-usage {input-output,persistence,software-deployment,source-cache,sources,storage-local-copies,none} [{input-output,persistence,software-deployment,source-cache,sources,storage-local-copies,none} ...]]
66 [--scheduler-greediness SCHEDULER_GREEDINESS]
67 [--scheduler-subsample SCHEDULER_SUBSAMPLE] [--no-hooks]
68 [--debug] [--runtime-profile FILE]
69 [--local-groupid LOCAL_GROUPID] [--attempt ATTEMPT]
70 [--show-failed-logs] [--log-handler-script FILE]
71 [--log-service {none,slack,wms}] [--job-deploy-sources]
72 [--benchmark-extended] [--container-image IMAGE]
73 [--immediate-submit] [--jobscript SCRIPT] [--jobname NAME]
74 [--flux]
75 [--software-deployment-method {apptainer,conda,env-modules} [{apptainer,conda,env-modules} ...]]
76 [--container-cleanup-images] [--use-conda]
77 [--conda-not-block-search-path-envvars] [--list-conda-envs]
78 [--conda-prefix DIR] [--conda-cleanup-envs]
79 [--conda-cleanup-pkgs [{tarballs,cache}]]
80 [--conda-create-envs-only] [--conda-frontend {conda,mamba}]
81 [--use-apptainer] [--apptainer-prefix DIR]
82 [--apptainer-args ARGS] [--use-envmodules]
83 [--scheduler-solver-path SCHEDULER_SOLVER_PATH]
84 [--deploy-sources QUERY CHECKSUM]
85 [--target-jobs TARGET_JOBS [TARGET_JOBS ...]]
86 [--mode {default,remote,subprocess}]
87 [--report-html-path VALUE]
88 [--report-html-stylesheet-path VALUE]
89 [targets ...]
90snakemake: error: Couldn't parse config file: Error processing template in section /__definitions__: 'ACCOUNT_NAME'
Formatting results
1[DEBUG]
2[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/common.smk": Formatted content is different from original
3[DEBUG]
4[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/count_kmers.smk": Formatted content is different from original
5[DEBUG]
6[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/Snakefile": Formatted content is different from original
7[DEBUG]
8[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/reference.smk": Formatted content is different from original
9[DEBUG]
10[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/call_variants.smk": Formatted content is different from original
11[DEBUG]
12[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/install_bbq.smk": Formatted content is different from original
13[DEBUG]
14[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/train_model.smk": Formatted content is different from original
15[DEBUG]
16[DEBUG] In file "/tmp/tmp85cr2ykn/BesenbacherLab-bbq_pipeline-f61880f/workflow/rules/filter_variants.smk": Formatted content is different from original
17[INFO] 8 file(s) would be changed 😬
18
19snakefmt version: 0.10.2