ClavelLab/genome-assembly
A Snakemake workflow assembling bacterial genomes according to the standard operating procedure in the Clavel Lab
Overview
Topics: bacterial-genomes genome-assembly snakemake snakemake-workflows
Latest release: None, Last update: 2025-03-04
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/ClavelLab/genome-assembly . --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
.
The configuration file config/config.yaml
should indicate the path to the tabular file describing the isolates and the raw sequences to be processed.
It is specified as follows:
samples: config/isolates.tsv
The raw sequence files can be freely named and will be standardized later. In the example below, both names are accepted.
isolate forward_file reverse_file
Favorite_isolate /home/rickastley/raw-sequences/Favorite_isolate_R1.fastq.gz /home/rickastley/raw-sequences/Favorite_isolate_R1.fastq.gz
Slowgrower_isolate /home/rickastley/raw-sequences/ComplexName-of-the-isolate_R1.fastq.gz /home/rickastley/raw-sequences/ComplexName-of-the-isolate_R2.fastq.gz
In the configuration directory of the workflow:
cd config/
List all the forward (R1) and reverse (R2) FASTQ files in their directory
ls /data/project_fastq/PROJECT*R1_001.fastq.gz > R1
ls /data/project_fastq/PROJECT*R2_001.fastq.gz > R2
Extract the isolate name located before the first underscore
# Example of the path /data/PROJECT_fastq/PROJECTH117_S106_R1_001.fastq.gz
sed -e 's/^.*PROJECT/PROJECT/' -e 's/_.*//' R1 > sample
Paste together the columns and separate with tabulations (default)
paste -- sample R1 R2 > project
Add the necessary header to generate the required table as project.tsv
cat <(echo -e "isolate\tforward_file\treverse_file" ) project > project.tsv
rm R1 R2 sample project
Note: Don't forget to update the configuration file with the correct filename!
The maximum number of threads to be used for parallelisation should be indicated as follow (and as well during the snakemake invocation with the -c 9
flag):
threads: 9
The CheckM software runs a full tree by default that uses ~40Gb of RAM. If you don't have such resources, use a reduced tree (~14Gb of RAM) by setting the following flag to true
:
reduced_tree: false
Place in the resources
folder the FASTA files describing the adapters and the phiX sequences and indicate their path with these two flags:
adapters: resources/NexteraPE-PE.fa
phix: resources/phix.fasta
Specify where should the database of bakta should be found or if not where they should be stored using this flag:
bakta_db: /data/bakta_db
Set the minimum contig size to be kept in the assembly in basepair:
min_contig_length: 500
Linting and formatting
Linting results
NotImplementedError in file /tmp/tmpqbdcoz5x/workflow/rules/common.smk, line 7:
Remote providers have been replaced by Snakemake storage plugins. Please use the corresponding storage plugin instead (snakemake-storage-plugin-*).
Formatting results
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG] In file "/tmp/tmpqbdcoz5x/workflow/rules/plasmid_reconstruction.smk": Formatted content is different from original
[DEBUG]
[DEBUG]
[DEBUG] In file "/tmp/tmpqbdcoz5x/workflow/rules/common.smk": Formatted content is different from original
[DEBUG]
[INFO] 2 file(s) would be changed 😬
[INFO] 4 file(s) would be left unchanged 🎉
snakefmt version: 0.10.2