Skip to content

nf-core/sarek

nf-core/sarek is the nf-core pipeline for germline and somatic variant calling on whole genome, whole exome and targeted sequencing data. It was written first for human and mouse, and it works on any species with a reference genome. It handles single samples and tumor with normal pairs, and it is described in Garcia et al. 2020 and Hanssen et al. 2024. The RNA-seq nf-core pipelines page covers what nf-core is and why a pipeline beats a folder of scripts.

This section uses release 3.11.0, published on 26 October 2026. Its module definitions pin BWA 0.7.19, GATK 4.7.0.0, DeepVariant 1.10.0, FreeBayes 1.3.10, bcftools 1.23.1 and SnpEff 5.4.0c. The preprocessing follows the GATK Best Practices, and the BWA & GATK preprocessing page goes through the same steps one command at a time.

With the default --step mapping, sarek starts from FASTQ files and runs these steps in order.

  1. FastQC reports on the raw reads.
  2. fastp splits each FASTQ file into chunks of at most 50 million reads, set by --split_fastq, so the chunks can be mapped in parallel. It trims adapters only when you add --trim_fastq.
  3. BWA-MEM maps each chunk with -K 100000000 -Y and a read group built from the samplesheet, and samtools sorts the result by coordinate.
  4. GATK MarkDuplicates merges the chunks of each sample and marks duplicate reads. The result is a CRAM file.
  5. GATK BaseRecalibrator builds a recalibration table from the dbSNP and known indel sites, and GATK ApplyBQSR writes a recalibrated CRAM.
  6. mosdepth and samtools stats report depth and alignment statistics on the CRAM files.
  7. Each caller named in --tools reads the recalibrated CRAM and calls variants inside the intervals.
  8. bcftools stats and VCFtools summarize each VCF.
  9. SnpEff annotates each VCF with the predicted effect of every variant on genes.
  10. MultiQC gathers the reports of every step into one HTML file.
FASTQ ─► FastQC
│
▼
fastp split ─► BWA-MEM + samtools sort ─► MarkDuplicates ─► BaseRecalibrator
│
▼
mosdepth, samtools stats ◄── recalibrated CRAM ◄── ApplyBQSR
│
┌──────────────┬────────────────┬──────────┴───────┐
▼ ▼ ▼ ▼
HaplotypeCaller DeepVariant FreeBayes bcftools mpileup
│ │ │ │
└──────────────┴───────┬────────┴──────────────────┘
▼
bcftools stats, VCFtools, SnpEff ─► MultiQC

Sarek takes the two BWA-MEM flags from the functional equivalence standard of Regier et al. 2018, as its usage page explains. The -K flag fixes the batch size so that the alignments do not depend on the thread count, and -Y soft clips supplementary alignments.

Two consequences of this layout matter for the pages that follow. Every caller reads the same recalibrated CRAM, so the Comparing callers page compares them on identical input. That input includes BQSR, which the DeepVariant documentation recommends against because it found a small decrease in accuracy. The --skip_tools baserecalibrator setting turns the step off, and then it is off for every caller.

Sarek reads its input from a CSV samplesheet passed with --input. For FASTQ input, the samplesheet needs at least the patient, sample, lane, fastq_1 and fastq_2 columns.

Column Meaning
patient the person; one patient can have several samples, such as a tumor and a normal
sex XX, XY and so on, used only for copy number analysis of tumors; defaults to NA
status 0 for a normal sample, 1 for a tumor; defaults to 0
sample the sample; rows with the same sample and different lanes are merged
lane the lane, unique within a sample
fastq_1, fastq_2 the gzipped read 1 and read 2 files

A germline run of one sample needs one row per lane. This is the samplesheet of this section’s run, as it sits in the companion folder.

The HG002 inputs come from NIST and the Genome in a Bottle consortium. The preparation on October 29, 2026 selects the chromosome 20 interval, subsets the GIAB v4.2.1 benchmark, and produces fresh analysis outputs. The source and terms notice identifies the original sequencing and benchmark publications, the exact source files, and the changes. It also records the grants for the Broad reference bundle and Ensembl release 99 annotation.

patient,sex,status,sample,lane,fastq_1,fastq_2
HG002,XY,0,HG002,L001,data/reads/hg002_chr20_region_r1.fastq.gz,data/reads/hg002_chr20_region_r2.fastq.gz

Sarek builds the read group of each row from these columns. The SM tag is <patient>_<sample>, LB is the sample, PU is the lane, and PL comes from --seq_platform, which defaults to ILLUMINA. The ID joins the sample and the lane, with the flowcell in front when sarek can read one from the first FASTQ header. The SM tag becomes the sample name in the VCF of every caller that takes the name from the alignments, so choose the two columns with the VCF in mind.

The run passes these settings. Each double dash parameter is in the sarek 3.11.0 parameter schema, and -profile is a Nextflow option.

Parameter Value What it does
-profile podman runs every process in a Podman container
--igenomes_ignore true stops sarek from loading its built-in reference paths
--genome null clears the default iGenomes genome, as the --fasta help asks for a custom FASTA
--fasta the chr20 reference the genome every step aligns to and calls against
--dbsnp the region subset of dbSNP known sites for BQSR, and the rsIDs in the HaplotypeCaller ID column
--known_indels the region subset of the Mills and 1000G gold standard indels known indel sites for BQSR
--intervals a BED file of the region restricts BQSR and variant calling to the region
--tools haplotypecaller,deepvariant,freebayes,mpileup,snpeff the four callers and the annotation
--gatk_pcr_indel_model NONE turns off the PCR indel error model, because the HG002 library is PCR-free
--snpeff_db GRCh38.99 the SnpEff database, read from the public annotation-cache bucket
--save_reference true publishes the indexes sarek builds, under reference/

The command has this form. The file names stand in for the files that the fetch script writes. The companion folder keeps the same settings in a parameter file, which the sarek documentation recommends over a -c config for pipeline parameters, and the real run page shows that file.

Terminal window
nextflow run nf-core/sarek \
-r 3.11.0 \
-profile podman \
--input samplesheet.csv \
--outdir results \
--igenomes_ignore \
--genome null \
--fasta chr20.fasta \
--dbsnp dbsnp.region.vcf.gz \
--known_indels mills.region.vcf.gz \
--intervals region.bed \
--tools haplotypecaller,deepvariant,freebayes,mpileup,snpeff \
--gatk_pcr_indel_model NONE \
--snpeff_db GRCh38.99 \
--save_reference

Three of these settings exist because the run does not use iGenomes or the sarek defaults. A custom FASTA needs --genome null next to --igenomes_ignore. With iGenomes off, sarek also has no SnpEff database name, so the run names GRCh38.99, the value that the GATK.GRCh38 entry of sarek’s iGenomes config uses. The HaplotypeCaller documentation recommends the NONE PCR indel model for PCR-free data, and sarek’s default is CONSERVATIVE.

Sarek builds the BWA index, the sequence dictionary, the FASTA index and the tabix index of each known sites VCF whenever you do not supply them. The --intervals file restricts BQSR and calling but not mapping. The parameter help states that the reads are aligned to the whole reference first, and here the whole reference is chr20.

Everything else keeps its sarek default. Two of those defaults shape this section’s results.

Parameter Default Effect
--aligner bwa-mem BWA-MEM rather than bwa-mem2 or DragMap
--freebayes_filter 30 the QUAL threshold sarek applies to FreeBayes calls

For germline SNVs and indels, sarek offers DeepVariant, FreeBayes, GATK HaplotypeCaller, bcftools mpileup and Sentieon Haplotyper, plus GPU versions of DeepVariant and HaplotypeCaller through NVIDIA Parabricks. Manta, TIDDIT and indexcov cover germline structural variants, and CNVkit covers copy number. The usage page has a table of callers by data type, somatic callers included.

This section runs four germline callers that work in different ways.

Caller --tools value How it calls
GATK HaplotypeCaller haplotypecaller reassembles the reads in each active region into candidate haplotypes, scores every read against every haplotype with a PairHMM, and assigns the most likely genotype
DeepVariant deepvariant encodes the reads around each candidate site as an image and classifies the genotype with a convolutional neural network
FreeBayes freebayes a Bayesian caller that genotypes short haplotypes rather than single positions
bcftools mpileup piles up the reads at each position with bcftools mpileup and calls genotypes with bcftools call in its multiallelic mode

The methods are published in Poplin et al. 2018 for DeepVariant, Garrison and Marth 2012 for FreeBayes and Danecek et al. 2021 for bcftools.

Sarek does not leave every caller’s output as the caller wrote it. For HaplotypeCaller it runs CNNScoreVariants and FilterVariantTranches on the single sample VCF and writes a .filtered VCF beside the raw one, unless you pass --skip_tools haplotypecaller_filter. For FreeBayes it keeps the calls with QUAL above --freebayes_filter in a second .filtered VCF. For bcftools it removes the sites where the genotype is homozygous reference, so sites with a missing genotype and no ALT allele stay in the file. DeepVariant writes a VCF and a gVCF. The Filtering and Comparing callers pages say which file they read.

Sarek writes its results under --outdir. The layout below follows the publish paths in the 3.11.0 module configuration, for a sample called HG002 and this section’s tools.

results/
├── annotation/
│ └── <caller>/HG002/ SnpEff annotated VCF for each caller
├── csv/ samplesheets to restart from a later step
├── multiqc/
│ └── multiqc_report.html
├── pipeline_info/ execution report, timeline, trace, parameters
├── preprocessing/
│ ├── markduplicates/HG002/ HG002.md.cram
│ ├── recal_table/HG002/ HG002.recal.table
│ └── recalibrated/HG002/ HG002.recal.cram
├── reference/ the built indexes, with --save_reference
├── reports/
│ ├── bcftools/<caller>/HG002/
│ ├── fastp/HG002/
│ ├── fastqc/
│ ├── markduplicates/HG002/
│ ├── mosdepth/HG002/
│ ├── samtools/HG002/
│ ├── snpeff/<caller>/HG002/
│ └── vcftools/<caller>/HG002/
└── variant_calling/
├── bcftools/HG002/ HG002.bcftools.vcf.gz
├── deepvariant/HG002/ HG002.deepvariant.vcf.gz, HG002.deepvariant.g.vcf.gz
├── freebayes/HG002/ HG002.freebayes.vcf.gz, HG002.freebayes.filtered.vcf.gz
└── haplotypecaller/HG002/ HG002.haplotypecaller.vcf.gz, HG002.haplotypecaller.filtered.vcf.gz

The alignments are CRAM files, which store reads as differences from the reference, so you need the same FASTA to read them back, and --save_output_as_bam makes sarek write BAM instead. The pipeline_info/ folder is the run’s own record, with the Nextflow execution report, timeline and trace and the parameters of the run. The output documentation describes every file, and the DNA-seq with nf-core/sarek guide lists what this section’s run wrote.

The next page, BWA & GATK preprocessing, opens steps 3 to 5 and shows each one as a command.

Di Tommaso and colleagues, 2017 describe Nextflow and its model for reproducible computational workflows.

Ewels and colleagues, 2020 describe nf-core and its community-curated bioinformatics pipelines, which include nf-core/sarek.

The Sarek 3.11.0 usage guide defines sample identities, reference inputs, and caller selection. The tagged guide matches the workflow described here.

The DeepVariant r1.10 input guidance explains model inputs and interval behavior. It provides context for the caller-specific choices inside Sarek.