MPUSP/snakemake-simple-mapping
A Snakemake workflow for the mapping of reads to reference genomes, minimalistic and simple.
Overview
Testing:
Last update: 2025-12-18
Latest release: v1.5.0
Topics: bowtie2 bwa-mem2 genomics mapping next-generation-sequencing snakemake snakemake-workflow star-alignment variant-calling
Authors: @m-jahn
Configuration
The following configuration details are extracted from the config's README file.
Workflow overview
This workflow is a best-practice workflow for mapping of reads to reference genomes, minimalistic and simple.
It will attempt to map reads to the reference using one of the included mappers, report read and experiment statistics, create coverage profiles, quantify variants (such as SNPs) using two different tools, and predict the effect of these variants. All of this is performed with minimal input and without lookups to external databases (e.g. for variant effects), which makes the workflow ideal for bacteria and other low-complexity non-model organisms.
The workflow is built using snakemake and consists of the following steps:
- Download genome reference from NCBI (
ncbi tools), or use manual input (fasta,gffformat) - Check quality of input read data (
FastQC) - Trim adapters and apply quality filtering (
fastp) - Map reads to reference genome using:
- (
Bowtie2)[http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml] or - (
BWA-MEM2)[https://github.com/bwa-mem2/bwa-mem2] or - (
STAR)[https://github.com/alexdobin/STAR] - (
minimap2)[https://github.com/lh3/minimap2]
- (
- Determine experiment type, get mapping stats (
rseqc) - Generate
bigwigorbedgaphcoverage profiles (deeptools) - Quantify variations and SNPs (
bcftools,freebayes) - Predict effect of variants such as premature stop codons (
VEPorSnpEff) - Create consensus of variants and create a visual report (
R markdown) - Collect statistics from tool output (
MultiQC)
Running the workflow
Input data
The workflow requires sequencing data in *.fastq.gz format, and a reference genome to map to.
The sample sheet listing read input files needs to have the following layout:
| sample | description | read1 | read2 |
|---|---|---|---|
| sample1 | strain XY | sample1_R1.fastq.gz | sample1_R2.fastq.gz |
| ... | ... | ... | ... |
Parameters
This table lists all parameters that can be used to run the workflow.
| parameter | type | details | default |
|---|---|---|---|
| samplesheet | string | path to the sample sheet in tsv format | |
| get_genome | |||
| database | string | database to use for genome retrieval, 'ncbi' or 'manual' | ncbi |
| assembly | string | Refseq ID to use for genome retrieval | GCF_000307535.1 |
| fasta | string | path to a custom FASTA file (optional) | |
| gff | string | path to a custom GFF file (optional) | |
| gff_source_type | array | mapping of GFF source types to feature types | |
| fastp | |||
| extra | string | additional arguments to Fastp | |
| mapping | |||
| tool | string | mapping tool to use, one of 'bowtie2', 'bwa_mem2' | bwa_mem2 |
| bowtie2 | |||
| index | string | additional arguments to bowtie build | |
| extra | string | additional arguments to bowtie align | |
| bwa_mem2 | |||
| extra | string | additional arguments to bwa-mem2 | |
| sort | string | sorting tool to use | samtools |
| sort_order | string | sorting order to use | coordinate |
| sort_extra | string | additional arguments to the sorting tool | |
| samtools_sort | |||
| extra | string | additional arguments to Samtools sort | -m 4G |
| index | object | Samtools index options | |
| extra | string | additional arguments to Samtools index | |
| star | |||
| index | string | additional arguments to STAR index | |
| extra | string | additional arguments to STAR align | |
| minimap2 | |||
| index | string | additional arguments to minimap2 index | |
| extra | string | additional arguments to minimap2 align | -ax map-ont |
| sorting | string | sorting order to use | coordinate |
| sort_extra | string | additional arguments to the sorting tool | |
| mapping_stats | |||
| gffread | |||
| extra | string | additional arguments to GFFread | |
| rseqc_infer_experiment | |||
| extra | string | additional arguments to RSeQC infer_experiment | |
| rseqc_bam_stat | |||
| extra | string | additional arguments to RSeQC bam_stat | |
| deeptools_coverage | |||
| genome_size | integer | genome size in base pairs | 1000 |
| extra | string | additional arguments to DeepTools bamCoverage | |
| variant_calling | |||
| bcftools_pileup | |||
| uncompressed | boolean | whether to output uncompressed BCF files | False |
| extra | string | additional arguments to BCFtools pileup | |
| bcftools_call | |||
| uncompressed | boolean | whether to output uncompressed VCF files | False |
| caller | string | use '-c' for consensus or '-m' for multiallelic | -c |
| extra | string | additional arguments to BCFtools view | |
| bcftools_view | |||
| extra | string | additional arguments to BCFtools call | |
| bcftools_filter | |||
| filter | string | expression by which to filter BCF/VCF result | -e 'ALT=\".\"' |
| extra | string | additional arguments to BCFtools filter | |
| freebayes | |||
| extra | string | additional arguments to Freebayes call | |
| variant_annotation | |||
| tool | string | annotation tool to use, one of 'vep', 'snpeff' | vep |
| vep | |||
| convert_gff | boolean | whether to convert NCBI GFF to Ensemble style GFF | True |
| plugins | array | VEP plugins to use | [] |
| extra | string | additional arguments to VEP | see config.yml |
| snpeff | |||
| extra | string | additional arguments to SnpEff | see config.yml |
| qc | |||
| fastqc | |||
| extra | string | additional arguments to FastQC | |
| multiqc | |||
| extra | string | additional arguments to MultiQC |