Skip to content

PoolSeqFlow

A Nextflow pipeline for allele frequency analysis from pooled Illumina sequencing data. It takes raw FASTQ files and a reference genome, and gives back allele frequency tables, running quality control, adapter trimming, composition-aware clipping, alignment, BAM cleanup, variant calling and frequency conversion in a single resumable run.

Nextflow ≥26.04.0 Apache 2.0 DOI

Install Quick Start

Platform support

PoolSeqFlow is developed and tested on Linux. macOS and Windows are not supported: the shipped conda environments are pinned to linux-64 builds, and the resume logic relies on symbolic links and Unix-style paths that do not behave correctly on native Windows filesystems. macOS support is planned; Windows is not.


What it is for

Pool-seq sequences many individuals together in one library. You get an allele frequency snapshot of the whole population for a fraction of the cost of sequencing each individual, and you give up knowing which individual carried which allele. The unit of analysis stops being a genotype and becomes a frequency.

That difference runs through every stage of this pipeline. A variant caller built for individual sequencing assigns a genotype per site; a pooled sample has no genotype to assign, only a ratio of read counts. PoolSeqFlow is built around keeping that ratio honest:

  • No biallelic assumption. Multiallelic sites are preserved through calling, filtering and conversion rather than being collapsed or dropped.
  • Major-allele normalization. VCFs are re-encoded so the most frequent allele is the reference, which makes frequencies comparable across samples and runs.
  • Pool-aware filtering. The minimum credible frequency is derived from your pool size and ploidy, not from a fixed cutoff. See The Filter Chain.

If you are weighing Pool-seq against individual sequencing, or checking whether your design fits what this pipeline assumes, start with When to use PoolSeqFlow.


The pipeline

graph TD
    reads(["Raw FASTQ reads"])
    s0["<b>Step 0</b><br/>Verify environment, parameters<br/>and folder structure"]
    s1["<b>Step 1</b><br/>Build reference dictionaries<br/>BWA, SAMtools, SnpEff"]
    s2["<b>Step 2</b><br/>QC and trimming<br/>FastQC → Trim Galore → composition-aware clipping"]
    s3["<b>Step 3</b><br/>Alignment<br/>BWA-MEM"]
    s4["<b>Step 4</b><br/>BAM cleanup<br/>name-sort → fixmate → coord-sort → markdup → addRG → filter → index"]
    s5["<b>Step 5</b><br/>Alignment, coverage and depth reports<br/>BAMtools, SAMtools → depth ceiling per sample"]
    s6["<b>Step 6</b><br/>Depth capping, then variant calling<br/>BCFtools mpileup + call"]
    s7["<b>Step 7</b><br/>VCF → allele frequency tables"]
    s8["<b>Step 8</b><br/>Annotation<br/>SnpEff"]

    reads --> s0 --> s1 --> s2 --> s3 --> s4 --> s5 --> s6
    s6 --> s7
    s6 -.->|optional| s8

Each step is an independent Nextflow DSL2 module. Full detail in Pipeline Steps.


Start here

  • New to the pipeline


    Install the conda environment, write a parameters.config, and get a first run going.

    Getting Started →

  • Deciding whether to use it


    What Pool-seq buys you, what it costs, and the study designs this pipeline does and does not fit.

    Concepts →

  • Choosing your settings


    Every parameter that changes a result, what it trades off, and how to pick a value for your data.

    Configuration →

  • Understanding your output


    What each filter removes, what the frequency tables contain, and how to read a column.

    Interpreting Results →


What is different about it

Clip points are measured for each sample. Trimming reads the per-base composition table FastQC produced for that sample and derives where to clip from it, so you set a tolerance rather than a fixed number of bases. How →

Each pool can state its own size. Its detection limit follows from that size, so a design mixing a pool of 10 with a pool of 500 is one run and not two. How →

A run that would mix two configurations stops before any work happens. The pipeline compares parameters.config and metadata.csv against the records kept beside your existing outputs, and on any difference it names what to delete rather than adding to it. Why →

Every setting lives in parameters.config. There are no command-line overrides, so a run is described entirely by a file you can version, diff and publish beside the results it produced. Why →

One invocation can analyze the same reads under several configurations. A run table lists them, and every step the runs agree on is carried out once rather than once per configuration. How →

Resume is read from the filesystem rather than from a cached session. Each step skips itself when its outputs are already in storage, so an interrupted run continues after a job timeout, a reboot, or a cleared work/. Why →

Finished artifacts are moved to permanent storage and symlinked back. Each byte crosses between the two storage roots exactly once, so a project holds one copy of a result rather than one per stage. Why →

Thread counts follow from a single setting. threads is the ceiling and each tool's share of it comes from a benchmarked ladder, so moving a project to a different machine means changing one number. How →


Citing

If PoolSeqFlow contributes to published work, please cite it; the DOI and a formatted reference are on the Citation page.