Skip to content

Home

genomepanel_nf is a Nextflow pipeline for highly efficient reference genome mapping, variant (SNP/indel) calling and quality control of large genome panels. It accepts Illumina reads from local files or NCBI/ENA SRA accessions, pre-processed BAM files, and optionally PacBio HiFi reads. It produces fully genotyped and filtered VCF files along with tabulated sample statistics and an HTML report.

With --cnv, it also calls copy-number variants across the whole panel: deletions and duplications per sample, gene presence/absence from a genome annotation, and per-chromosome copy number (aneuploidy, accessory chromosomes).

We tested genomepanel_nf on 100s to 1000s of samples from plant, animal and fungal species with reference genomes in single-digit Gb sizes. Please report any issues or share feature requests on the GitHub Issues page.

The main design goals were to parallelize tasks as much as possible by splitting reference genomes into segments for variant calling and downstream processing, and to minimize SLURM resource requests dynamically depending on the dataset. Even very large datasets typically peak at single-digit TBs of temporary storage needs.

genomepanel_nf emits by default only filtered and unfiltered VCF files to save disk space. Intermediate files (BAMs, GVCFs) can be optionally retained though. The pipeline can also be switched to emit confidence scores at invariant sites.

The pipeline is designed to run both on HPC clusters via SLURM or on single machines, and uses Singularity containers so all software dependencies are reproducible and portable.

Get started View on GitHub DOI


Pipeline Summary

flowchart TD
    classDef io stroke-width:3px
    classDef opt stroke-dasharray:6 4

    A1([Local FASTQ<br/>--reads]):::io
    A2([SRA / ENA<br/>--SRA_index]):::io
    A3([BAM files<br/>--bam_input]):::io
    A4([PacBio HiFi<br/>--hifi_reads<br/>--hifi_SRA_index]):::io
    REF([Reference genome<br/>--reference]):::io

    T[fastp<br/>trimming & QC]
    M[bwa-mem2<br/>read mapping]
    MH[pbmm2<br/>HiFi read mapping]
    D[Picard<br/>read groups & deduplication]
    HC[GATK HaplotypeCaller<br/>per-sample GVCF]
    JG[GATK joint genotyping<br/>GenomicsDBImport + GenotypeGVCFs]
    VF[VariantFiltration + bcftools<br/>flagging & filtering]
    PG[vcftools<br/>pop-gen VCF]
    PL[PLINK 2, optional<br/>PCA, relatedness, LD pruning]:::opt
    CN[GATK gCNV, optional --cnv<br/>copy-number variants,<br/>gene presence/absence]:::opt
    QC[R<br/>pipeline_report.html]

    O1([final_variants.vcf.gz]):::io
    O2([final_variants.clean.vcf.gz]):::io
    O3([pop-gen VCF]):::io
    O4([pipeline_report.html]):::io
    O5([9_plink/]):::io
    O6([11_cnv/<br/>segments, gene copy numbers]):::io

    A1 --> T
    A2 --> T
    T --> M
    REF --> M
    REF --> HC
    M --> D
    A4 --> MH
    REF --> MH
    MH --> D
    D --> HC
    A3 --> HC
    HC --> JG
    JG --> VF
    VF --> O1
    VF --> O2
    O1 --> PG
    PG --> O3
    O3 --> PL
    PL --> O5
    D --> CN
    A3 --> CN
    CN --> O6
    O2 --> QC
    QC --> O4

Thick outlines mark inputs and outputs; dashed boxes are optional analyses.

The pipeline accepts four input modes that converge at the variant calling step:

  1. Local FASTQ files (--reads): raw paired-end Illumina reads are trimmed with fastp, mapped with bwa-mem2, sorted with samtools, assigned read groups and deduplicated with Picard.
  2. SRA/ENA accessions (--SRA_index): accessions are resolved to run IDs and download URLs; paired-end and single-end runs are handled automatically before joining the same read-processing path.
  3. Pre-processed BAM files (--bam_input): coordinate-sorted, read-group annotated BAMs skip directly to variant calling.
  4. PacBio HiFi reads (--hifi_reads, --hifi_SRA_index; optional): local FASTQ or SRA/ENA accessions are mapped with pbmm2 without trimming. They can be combined with Illumina input, and a HiFi run given the same sample name as Illumina runs is merged with them and called as one sample.

After read processing the pipeline performs joint genotyping across all samples using GATK HaplotypeCaller (GVCF mode), GenomicsDBImport and GenotypeGVCFs. Variant filtration follows GATK best practices. A population-genetics VCF (thinned, MAF-filtered) is generated with vcftools, and can optionally be carried through PLINK 2 analyses — PCA, GRM and KING relatedness matrices, and LD pruning — with --plink_pca, --plink_relationships and --plink_ld_prune. All QC metrics are collected into a single pipeline_report.html.

Copy-number variant calling (--cnv) runs alongside on the same short-read BAMs, using GATK's germline CNV workflow (gCNV) in cohort mode: the panel serves as its own reference, so no panel of normals is needed. It reports per-sample deletion and duplication segments, per-gene copy numbers from a GTF/GFF3 annotation, and the copy number of every chromosome in every sample. The model settings are tuned for whole-genome panels, so that deletions shared by many samples are found. See Copy-number variant calling.


Key features

  • Flexible input


    Illumina reads from local FASTQ or SRA/ENA accessions, pre-processed BAM files, and PacBio HiFi reads — all in the same run.

  • Joint variant calling


    SNPs and indels with GATK HaplotypeCaller and joint genotyping across the panel, filtered following GATK best practices.

  • Copy-number variants


    --cnv calls deletions, duplications and gene presence/absence in every sample with GATK gCNV, tuned for whole-genome panels. Learn more

  • Population genetics


    A thinned, MAF-filtered VCF, with optional PLINK 2 PCA, relatedness matrices and LD pruning.

  • HPC-ready


    SLURM profile with optimised resource requests. Parallel variant calling across genome segments.

  • Fully containerised


    All tools run inside Singularity images that are pulled automatically.

  • Built-in QC report


    A single pipeline_report.html with fastp, mapping and VCF quality plots.

  • PacBio HiFi reads


    --hifi_reads / --hifi_SRA_index map HiFi runs with pbmm2, on their own or merged with Illumina runs of the same sample. Learn more


Software used by genomepanel_nf

Please cite the underlying tools if you use them through this pipeline.

Tool Version Role Reference
fastp 1.3.1 Adapter trimming, read QC Chen et al. 2018, Bioinformatics doi:10.1093/bioinformatics/bty560
bwa-mem2 2.3 Read mapping Vasimuddin et al. 2019, IPDPS doi:10.1109/IPDPS.2019.00041
pbmm2 / minimap2 26.2.0 / 2.26 PacBio HiFi read mapping Li 2018, Bioinformatics doi:10.1093/bioinformatics/bty191
SAMtools 1.23.1 BAM manipulation & sorting Danecek et al. 2021, GigaScience doi:10.1093/gigascience/giab008
Picard 3.4.0 Read group assignment, duplicate removal Broad Institute 2019
GATK 4.6.2.0 Haplotype calling, genotyping, variant filtration, copy-number calling (gCNV) Van der Auwera & O'Connor 2020; gCNV: Babadi et al. 2023, Nature Genetics doi:10.1038/s41588-023-01449-0
BCFtools 1.23.1 VCF filtering and manipulation Danecek et al. 2021, GigaScience doi:10.1093/gigascience/giab008
vcftools 0.1.17 Population-genetics VCF processing Danecek et al. 2011, Bioinformatics doi:10.1093/bioinformatics/btr330
PLINK 2 2.0.0-a.6.9 PCA, GRM and KING relatedness, LD pruning Chang et al. 2015, GigaScience doi:10.1186/s13742-015-0047-8
sra-tools 3.2.1 NCBI SRA data download NCBI
entrez-direct 24.0 NCBI SRA accession resolution NCBI
R / tidyverse 1.2.1 QC visualisation, CNV summary tables R Core Team; Wickham et al. 2019, JOSS doi:10.21105/joss.01686

Release notes

v1.2.1 (December 2026)

  • Fixes HaplotypeCaller crashing without an error message (exit 245) on PacBio HiFi samples; GATKHC no longer retries failures that are not out-of-memory kills six times.
  • Nanopore runs listed as HiFi, and long-read runs listed as Illumina, are skipped with a warning.
  • A SLURM partition whose time limit is shorter than the pipeline's requests is caught at startup; --slurm_max_time caps task walltime for such partitions.

v1.2.0 (October 2026)

  • Copy-number variant calling with --cnv: GATK gCNV in cohort mode gives per-sample deletion and duplication segments, per-gene copy numbers from a GTF/GFF3 annotation (gene presence/absence), and per-contig ploidy (aneuploidy, accessory chromosomes). Results are in 11_cnv/.
  • The model settings are tuned for whole-genome panels, so that deletions shared by many samples are found, which GATK's defaults miss. See Model settings.
  • PacBio HiFi input (--hifi_reads, --hifi_SRA_index) is described under Configuration. HiFi samples are left out of CNV calling.

v1.1.2 (October 2026)

  • PacBio HiFi input (--hifi_reads, --hifi_SRA_index), mapped with pbmm2.
  • Out-of-memory kills in joint genotyping are always retried with more memory; the HTML report works with --call_invar_sites.

v1.1.1 (September 2026)

  • Runs mapped to the same sample (--SRR_sample_map, or --bam_input files sharing an @RG SM tag) are merged before duplicate marking, giving one gVCF per sample; samples move on as soon as their own runs are done, without waiting for the rest of the panel.
  • A task retried after a spurious failure no longer finds its input deleted; intermediates are removed only after a step succeeds, and user-supplied BAMs are never deleted.
  • Mapping and BAM processing now drop a failing sample instead of aborting the run; dropped samples are listed in ignored_samples.txt and the HTML report. GATK errors in GenomicsDBImport/GenotypeGVCFs now stop the run instead of being silently ignored.
  • Higher HaplotypeCaller concurrency on SLURM; the work directory is only deleted after a run with no failed or ignored tasks.

v1.1.0 (September 2026)

  • Optional PLINK 2 analyses on the pop-gen VCF: --plink_pca, --plink_relationships (GRM and KING matrices) and --plink_ld_prune, published to 9_plink/.
  • All parameters and input files are validated before any task is submitted, with every problem reported in one block and a Resolved inputs summary in the startup banner. Added --help; --reads and --bam_input now accept several semicolon-separated patterns.
  • Outputs reorganised into numbered directories (1_sra_downloads/ through 10_reports/), and samples silently dropped by the download or trimming steps are now listed in pipeline_report.html.

v1.0.11 (July 2026)

  • Stopped Samtools and Picard from filtering out low-quality or duplicate reads; all reads are now retained in BAM files.
  • New --use_duplicate_reads option to use duplicate reads in GATK HaplotypeCaller (e.g. for ddRAD or RAD-seq data).

v1.0.10 (June 2026)

  • Fixed VCF sample names with --SRR_sample_map: GenomicsDBImport was reassigning names from gVCF filenames, discarding biological names set by Picard.
  • Fixed filterReference rewritten as a streaming parser to avoid loading the entire genome into RAM.
  • Fixed QC report crash when sample names share a common prefix.
  • Memory scaling broadened; GenomicsDBImport and GenotypeGVCFs start at 16 GB.
  • genomicsdb_batch_size default raised to 200; pipeline exits immediately on unrecognised --params.
  • Added MergeGVCFs module for --keep_gvcf runs with sub-chromosomal segmentation.

v1.0.9 (May 2026)

  • Added required --slurm_queue parameter when using -profile slurm. The pipeline now validates this at startup and exits with a clear error if it is missing. The specified partition should allow a walltime of at least 7 days.

v1.0.8 (May 2026)

  • BAM files are now deleted mid-run once all GATKHC tasks have finished, freeing disk space without risking premature removal.
  • Fixed zero-length vector crash in r_process_summary_fastp.R for single-end samples (duplication$rate / insert_size$peak null guard).

v1.0.7 (May 2026)

  • Replaced CombineGVCFs with GenomicsDBImport for GVCF consolidation. Eliminates in-memory GC-thrashing at large sample counts; batch size tunable via --genomicsdb_batch_size.
  • Nextflow ≥ 26.x compatibility: moved log.info inside the workflow block, replaced C-style loops with Groovy functional expressions, and updated nextflow.config env-var syntax.
  • Added JVM flags -XX:-UsePerfData --enable-native-access=ALL-UNNAMED to all GATK processes to suppress Java 17+ warnings.
  • Fixed gatkIndex memory to prevent a -Xmx0g crash on first attempt.
  • Fixed single-end sample crash in r_process_summary_fastp.R (insert_size$peak is absent for SE data).

v1.0.6 (April 2026)

  • Switch to automatic Singularity image pulling. No manual action required.
  • Included fully functional example dataset.

v1.0.5 (April 2026)

  • Fixed HTML QC report generation
  • Improved stability of SRA downloader

v1.0.4b (April 2026)

  • Fixed invalid retryStrategy process directive.

v1.0.4 (April 2026)

v1.0.3 (April 2026)

  • Updated all Singularity container images to the latest Galaxy depot releases.
  • Redesigned QC report (pipeline_report.html): unified fastp, BWA and variant quality sections into a single HTML report with inline PDF plots (font-independent, works in all containers and browsers).
  • Optimised SLURM resource requests across all pipeline modules.

Questions and feature requests

Questions, bug reports and feature requests are welcome on the GitHub Issues page.

Questions? Found a bug? Feature requests?

Go to the GitHub Issues page


How to cite

If you use genomepanel_nf in your research, please cite:

Croll, D. (2026). genomepanel_nf - a highly efficient Nextflow pipeline for reference genome variant calling of large genome panels (v1.2.1). Zenodo. https://doi.org/10.5281/zenodo.19392838

DOI

Please also cite the underlying tools listed in the Software table above.