solida-core/dima
Snakemake pipeline to map DNA datasets to a given reference genome using BWA MEM and Samtools.
Overview
Topics: snakemake snakemake-workflows genomics bioinformatics ngs-pipeline workflows
Latest release: v2.0.2, Last update: 2024-11-21
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/solida-core/dima . --tag v2.0.2
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, following the explanations provided in the file.
Add samples to config/samples.tsv
and config/units.tsv
.
In the units
file each row contain a single unit for a given sample, with fastq files for read1 and, if present, read2.
The file have 4 tab-separated columns:
-
sample
: generic sample name, it will be reported also in thesamples.tsv
file. Can be present multiple times in different rows if the sample has multiple units. -
unit
: is a unique identifier for the unit. A unit, i.e.HSQ1008_141.L001.NA20804
is composed by 3 different parts:-
flowcell_id
: an id for the flowcell or instrument -
lane
: the lane id in which that unit was sequenced -
sample_id
: the sample id (the same in the first column of the file)
-
-
fq1
: absolute path of fastq file containing read1 -
fq2
: absolute path of fastq file containing read2, leave blank if SE.
An example config/units.tsv
is reported below:
sample unit fq1 fq2
NA20804 HSQ1008_141.L001.NA20804 /abs_path/NA20804.L001.R1.fq.gz
NA20804 HSQ1008_141.L005.NA20804 /abs_path/NA20804.L005.R1.fq.gz /abs_path/NA20804.L005.R2.fq.gz
In the samples
file each row contain information for a single sample, with indication of all its units.
The file have 3 tab-separated columns:
-
sample
: generic sample name, the same indicated in theunits.tsv
file. -
odp
: Optical Duplicate Distance used for Picard MarkDuplicates, depending on flowcell type. -
units
: comma separated list of units (the unit name reported in the units file) for a given sample.
An example config/samples.tsv
is reported below:
sample odp units
NA20804 100 HSQ1008_141.L001.NA20804,HSQ1008_141.L005.NA20804,HSQ1009_88.L007.NA20804
NA20806 100 HSQ1009_86.L001.NA20806
Linting and formatting
Linting results
AttributeError in file /tmp/tmp19885e1r/solida-core-dima-57c1a3c/workflow/rules/picard.smk, line 137:
'NoneType' object has no attribute 'get'
File "/tmp/tmp19885e1r/solida-core-dima-57c1a3c/workflow/rules/picard.smk", line 137, in <module>
Formatting results
[DEBUG]
[DEBUG]
[DEBUG] In file "/tmp/tmp19885e1r/solida-core-dima-57c1a3c/workflow/rules/coverage.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp19885e1r/solida-core-dima-57c1a3c/workflow/Snakefile": Formatted content is different from original
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[INFO] 2 file(s) would be changed 😬
[INFO] 7 file(s) would be left unchanged 🎉
snakefmt version: 0.10.2