Consistent adapter and quality trimming for NGS, with extra functionality for RRBS data
Consistent adapter and quality trimming for NGS, with extra functionality for RRBS data
Consistent quality and adapter trimming for next-generation sequencing data, with special handling for RRBS libraries. https://www.trimgalore.com/
[!NOTE] Trim Galore v2.0 is a faithful Rust rewrite — a single binary with zero external dependencies, designed as a drop-in replacement for v0.6.x scripts and pipelines. Same CLI, same output filenames, same report format. Adds poly-G auto-detection and trimming for 2-colour instruments, a generic poly-A trimmer, per-pair adapter auto-detection, and cleaner multi-adapter invocation (repeatable
-a/-a2instead of Perl's embedded-string syntax) — among other extensions. For details on what changed, benchmarks, and migration notes, see the v2.0 migration notes.
--stranded_illumina) because its sequence is ambiguous with Nextera.-a/-a2 or via -a "file:adapters.fa", with optional multi-round trimming (-n)--no_poly_g--nextseq N / --2colour N applies 2-colour-aware quality trimming (opt-in; replaces -q)--cores N runs trimming and gzip compression in worker threads under an N+4 thread model (N workers + 2 decompressors + 1 batcher + 1 writer); near-linear speedup up to --cores 8 for paired-end runs, then gzip-output I/O typically becomes binding--clumpify reorders reads by canonical 16-mer minimizer so similar reads share gzip dictionary windows; combined with --compression 1–9 it shrinks output 15–55% on fragment-clustered data (ATAC, Ribo, RRBS, RNA-seq, MiSeq amplicons). Coverage-diverse data (WGBS PE, scRNA-seq R2) regress — see Clumpy compression for the per-data-type guidance--passthrough carries a third FASTQ (typically the I1/I2 cell-barcode read) untrimmed but in lockstep with R1/R2; records dropped by length/quality/N filters cascade to the passthrough output. Designed for 10X Multiome ATAC-seq libraries with modified ATAC adapters that Cellranger Arc can't detect — trim R1/R2 against your own -a/-a2 while keeping the barcode read aligned in a single invocation. Per-record three-way header sync check catches mid-file truncation / desync loudly.fastqc on $PATHRequires the Rust toolchain (1.88+):
cargo install trim-galoreconda install -c bioconda trim-galoregit clone https://github.com/FelixKrueger/TrimGalore.git
cd TrimGalore
cargo build --release
# Binary is at target/release/trim_galoreTo install the latest unreleased changes directly from the development branch:
cargo install --git https://github.com/FelixKrueger/TrimGalore --branch dev trim-galore --forceThe --force flag overwrites any existing trim_galore binary (e.g. a v2.0.0 install from crates.io).
Multi-arch images (amd64 + arm64) are available from GitHub Container Registry:
docker run --rm -v "$PWD":/data -w /data ghcr.io/felixkrueger/trimgalore:latest trim_galore input.fastq.gzFastQC is built into the binary itself via the bundled fastqc-rust library — no external fastqc or Java runtime needed in the image. Tags published: :latest (latest stable, currently v2.3.0), :v2.3.0 (pinned to a specific release), :beta (latest prerelease — only set during an active beta cycle), and :dev (every push to the dev branch). See the docs site install page for the full table.
Prebuilt binaries for Linux (x86_64, aarch64) and macOS (Apple Silicon) are available on the Releases page. Intel Mac users: install via cargo install trim-galore (local build) or use the Docker amd64 image.
…For the complete list of options:
trim_galore --help| Mode | Trimmed output | Reports |
|---|---|---|
| Single-end | *_trimmed.fq.gz |
*_trimming_report.txt + *_trimming_report.json |
| Paired-end | *_val_1.fq.gz / *_val_2.fq.gz |
per-read text + JSON reports |
Unpaired (with --retain_unpaired) |
*_unpaired_1.fq.gz / *_unpaired_2.fq.gz |
|
Single-end, --output-format ubam |
*_trimmed.bam |
(same text + JSON reports) |
Paired-end, --output-format ubam |
*_val.bam (ONE interleaved BAM) |
R1 + R2 reports |
Output compression mirrors the input: gzipped input (*.fastq.gz) produces gzipped output (*.fq.gz); plain input (*.fastq) produces plain output (*.fq). Pass --dont_gzip to force plain output regardless. By default, gzip output is written at compression level 1 (fastest); pass --compression (1–9) to override — decompressed content is byte-identical regardless of level, but level-1 .fq.gz files are roughly 75% larger than level-9 in exchange for substantially faster trimming.
Pass --clumpify to reorder reads inside each gzip member by canonical 16-mer minimizer so reads sharing similar sequence land adjacent on disk, letting gzip's 32 KB dictionary find longer back-references. The right configuration depends on what the trimmed FASTQ is used for:
# Pipeline intermediates (deleted after the run): reorder is essentially free
# and shrinks the file 15–35% on most data — net I/O win for the next step.
trim_galore --clumpify
# Long-term storage / disk-constrained workdirs: add gzip L6 for 15–50% saving
# at 4–6× plain wall.
trim_galore --clumpify --compression 6
# Archival use, max compression
trim_galore --clumpify --compression 9
# Smaller output without the reorder cost (e.g. for 10x scRNA-seq, see docs)
trim_galore --compression 6 No information loss — only the on-disk order of records changes. Output records are byte-identical to the unsorted output and trimming reports are unaffected. --clumpify requires --cores >= 2.
Memory budget is controlled by the global --memory flag (default 1G); bigger budgets give bigger per-gzip-member sort runs and better compression up to roughly the uncompressed input size, with sharply diminishing returns above ~2 GB. With enough memory, --clumpify --compression 9 gets you within 1–2 percentage points of bbmap clumpify and stevekm/squish on the same data.
Intended for short reads (Illumina, AVITI). Long-read inputs (Oxford Nanopore, PacBio) and 10x scRNA-seq typically see no benefit or a small negative result; see Clumpy compression for per-data-type recommendations.
The JSON report contains the same statistics as the text report in a structured format (schema v1), designed for native parsing by MultiQC.
Full documentation is published at https://www.trimgalore.com/
Trim Galore was developed at The Babraham Institute by @FelixKrueger, now part of Altos Labs.
No open issues yet, or sync has not completed.