MPUSP/snakemake-ont-bacterial-variants
A Snakemake workflow for the identification of variants in bacterial genomes using nanopore long-read sequencing.
Overview
Testing:
Last update: 2025-12-12
Latest release: v1.1.0
Topics: bioinformatics-pipeline conda nanopore singularity snakemake variant-calling workflow
Authors: @tfwulff @m-jahn @rabioinf
Configuration
The following configuration details are extracted from the config's README file.
Running the workflow
Input data
The workflow requires the following files to be located in the data directory:
- Whole-genome sequencing data in
*.fastq.gzformat indata/fastq - Reference genome(s) in
*.faformat indata/reference
Optionally, users can provide:
- Reference genome annotation in
*.gffformat indata/annotation(for feature annotation in IGV report) - A
*.bedfile with genomic regions to ignore for variant calling indata/masked_region
Please ensure that the chromosome names in *.gff and *.bed files are the same as in the reference genome.
Input data files are provided in the samples.tsv table, whose location is inidcated in the config.yml file. The samplesheet must comply with the following structure:
sampledefines the sample name that will be used throughout the workflow and thus needs to be unique.fastqprovides the path to the sample's*.fastq.gzfile.referenceprovides the path to the reference genome*.fafile (may be the same for several / all samples).annotationprovides the path to the optional reference genome annotation in*.gfffile (may be the same for several / all samples). If no annotation is provided, you must entern/a!masked_regionsprovides the path to the optional*.bedfile for filtering genomic regions (may be the same for several / all samples). If no*.bedfile is provided, you must entern/a!
| sample | fastq | reference | annotation | masked_regions |
|---|---|---|---|---|
| <sample1> | data/fastq/<fastq1>.fastq.gz | data/reference/<ref1>.fa | data/annotation/<anno1>.gff | data/masked_region/<region1>.bed |
| <sample2> | data/fastq/<fastq2>.fastq.gz | data/reference/<ref2>.fa | data/annotation/<anno2>.gff | data/masked_region/<region2>.bed |
| ... | ... | ... | ... | ... |
| <sampleN> | data/fastq/<fastqN>.fastq.gz | data/reference/<refN>.fa | data/annotation/<annoN>.gff | data/masked_region/<regionN>.bed |
Configuration and parameters
Before executing the workflow, you may want to adjust several options and parameters in the default config file config/config.yml:
- Directories:
indir: Input directory for all input files,databy default (see above)outdir: Output directory (relative to working directory),resultsby default
- Sample information:
samples: Path to samplesheet (relative to working directory),samplesheet/samples.tsvby defaultlibprepkit: Kit from ONT used for library preparation, e.g.SQK-NBD114.24basecalling_model: Model used for basecalling of raw sequencing data (required for variant calling usingMedaka), currently supported models are:r1041_e82_400bps_sup_v4.2.0r1041_e82_400bps_sup_v4.3.0
- Tool parameters:
- The number of cores can be adjusted here for the following tools:
NGMLR,NanoPlot,MultiQC,Medaka,Clair3,Sniffles2, andcuteSV - You may further adjust the run parameters for the following tools (please refer to the reference provided for more details on run parameters):
Filtlong: By default, reads are filtered for a minimum length of 500 bp and a mean accuracy of at least 90% (Q10), with 90% of the longest and highest-quailty reads to be kept.Clair3: Variants are called on all contigs in a haploid-sensitive, ONT-specific mode using--include_all_ctgs --haploid_sensitive --platform ont.cuteSV: Variants are called with the suggested parameters for ONT data (--max_cluster_bias_INS 100 --diff_ratio_merging_INS 0.3 --max_cluster_bias_DEL 100 --diff_ratio_merging_DEL 0.3) and the genotyping option enabled (--genotype).
- The number of cores can be adjusted here for the following tools:
- Filtering of variants:
- The variant quality thresholds can be adjusted here for all four variant callers
remove_common_variants: IfTrue, variants which have been identified in all samples with the same reference genome by one tool are filtered out. This is helpful in case all samples derive from a strain, whose genome sequence already differs from the used reference sequence. IfFalse, all variants are reported.
- Reporting options:
igv_region_length: Neighboring variants with a maximum bp distance indicated here [1 by default] are reported in one region in the IGV variant report. Increasing this parameter will reduce the file size of the resulting IGV HTML report, if hotspots / regions with many variants exist in a sample.