Skip to main content

MPUSP/snakemake-simple-mapping

A Snakemake workflow for the mapping of reads to reference genomes, minimalistic and simple.

Overview

Testing: GitHub Actions Workflow Status GitHub Actions Workflow Status

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:

  1. Download genome reference from NCBI (ncbi tools), or use manual input (fasta, gff format)
  2. Check quality of input read data (FastQC)
  3. Trim adapters and apply quality filtering (fastp)
  4. Map reads to reference genome using:
    1. (Bowtie2)[http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml] or
    2. (BWA-MEM2)[https://github.com/bwa-mem2/bwa-mem2] or
    3. (STAR)[https://github.com/alexdobin/STAR]
    4. (minimap2)[https://github.com/lh3/minimap2]
  5. Determine experiment type, get mapping stats (rseqc)
  6. Generate bigwig or bedgaph coverage profiles (deeptools)
  7. Quantify variations and SNPs (bcftools, freebayes)
  8. Predict effect of variants such as premature stop codons (VEP or SnpEff)
  9. Create consensus of variants and create a visual report (R markdown)
  10. 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:

sampledescriptionread1read2
sample1strain XYsample1_R1.fastq.gzsample1_R2.fastq.gz
............

Parameters

This table lists all parameters that can be used to run the workflow.

parametertypedetailsdefault
samplesheetstringpath to the sample sheet in tsv format
get_genome
databasestringdatabase to use for genome retrieval, 'ncbi' or 'manual'ncbi
assemblystringRefseq ID to use for genome retrievalGCF_000307535.1
fastastringpath to a custom FASTA file (optional)
gffstringpath to a custom GFF file (optional)
gff_source_typearraymapping of GFF source types to feature types
fastp
extrastringadditional arguments to Fastp
mapping
toolstringmapping tool to use, one of 'bowtie2', 'bwa_mem2'bwa_mem2
bowtie2
indexstringadditional arguments to bowtie build
extrastringadditional arguments to bowtie align
bwa_mem2
extrastringadditional arguments to bwa-mem2
sortstringsorting tool to usesamtools
sort_orderstringsorting order to usecoordinate
sort_extrastringadditional arguments to the sorting tool
samtools_sort
extrastringadditional arguments to Samtools sort-m 4G
indexobjectSamtools index options
extrastringadditional arguments to Samtools index
star
indexstringadditional arguments to STAR index
extrastringadditional arguments to STAR align
minimap2
indexstringadditional arguments to minimap2 index
extrastringadditional arguments to minimap2 align-ax map-ont
sortingstringsorting order to usecoordinate
sort_extrastringadditional arguments to the sorting tool
mapping_stats
gffread
extrastringadditional arguments to GFFread
rseqc_infer_experiment
extrastringadditional arguments to RSeQC infer_experiment
rseqc_bam_stat
extrastringadditional arguments to RSeQC bam_stat
deeptools_coverage
genome_sizeintegergenome size in base pairs1000
extrastringadditional arguments to DeepTools bamCoverage
variant_calling
bcftools_pileup
uncompressedbooleanwhether to output uncompressed BCF filesFalse
extrastringadditional arguments to BCFtools pileup
bcftools_call
uncompressedbooleanwhether to output uncompressed VCF filesFalse
callerstringuse '-c' for consensus or '-m' for multiallelic-c
extrastringadditional arguments to BCFtools view
bcftools_view
extrastringadditional arguments to BCFtools call
bcftools_filter
filterstringexpression by which to filter BCF/VCF result-e 'ALT=\".\"'
extrastringadditional arguments to BCFtools filter
freebayes
extrastringadditional arguments to Freebayes call
variant_annotation
toolstringannotation tool to use, one of 'vep', 'snpeff'vep
vep
convert_gffbooleanwhether to convert NCBI GFF to Ensemble style GFFTrue
pluginsarrayVEP plugins to use[]
extrastringadditional arguments to VEPsee config.yml
snpeff
extrastringadditional arguments to SnpEffsee config.yml
qc
fastqc
extrastringadditional arguments to FastQC
multiqc
extrastringadditional arguments to MultiQC