BinAC2/Software/fastp

From bwHPC Wiki
< BinAC2‎ | Software
Revision as of 12:55, 25 November 2026 by F Bartusch (talk | contribs) (Created page with "{{Softwarepage|bio/fastp}} {| width=600px class="wikitable" |- ! Description !! Content |- | module load | bio/fastp |- | License | MIT - see [https://github.com/OpenGene/fastp/blob/master/LICENSE] |- | Citing | [https://doi.org/10.1002/imt2.70078 Shifu Chen. fastp 1.0: An ultra-fast all-round tool for FASTQ data quality control and preprocessing. iMeta 4(5) (2025): e70078] |- | Links | fastp Documentation: [https://github.com/OpenGene/fastp#readme] <br> fastp Repository...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The main documentation is available on the cluster via module help bio/fastp. Most software modules for applications provide working example batch scripts.


Description Content
module load bio/fastp
License MIT - see [1]
Citing Shifu Chen. fastp 1.0: An ultra-fast all-round tool for FASTQ data quality control and preprocessing. iMeta 4(5) (2025): e70078
Links fastp Documentation: [2]

fastp Repository: [3]

Description

This page describes fastp 1.4.0 (module bio/fastp/1.4.0). All recommendations below were measured with this version.

fastp cleans up short read sequencing data (FASTQ files) before further analysis. In one pass it checks the quality, finds and removes adapter sequences, cuts or removes low quality reads, and writes a report as HTML (to look at in a web browser) and as JSON (for tools such as MultiQC). It works with paired-end and single-end data and reads and writes gzip compressed files directly.

You only need to load this one module. fastp works on all BinAC 2 compute nodes and automatically uses the fastest instructions the processor of the node offers; you do not have to choose anything.

fastp is designed for short reads. For long reads (Nanopore, PacBio) upstream provides a separate tool, fastplong.

Quick start

Paired-end gzip FASTQ files, adapters are detected automatically. Run the job from a workspace or your project directory (see Storage).

#!/bin/bash
#SBATCH --job-name=fastp
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=2G
#SBATCH --time=01:00:00

module load bio/fastp/1.4.0

fastp -i sample_R1.fastq.gz -I sample_R2.fastq.gz \
      -o sample_R1.trimmed.fastq.gz -O sample_R2.trimmed.fastq.gz \
      --detect_adapter_for_pe -w 8 \
      -j sample.fastp.json -h sample.fastp.html

Slurm on BinAC 2 counts hardware threads as CPUs: --cpus-per-task=16 gives 8 physical cores, which fits -w 8 (8 fastp worker threads).

Benchmarks

All values were measured with fastp 1.4.0 (bio/fastp/1.4.0) on BinAC 2 Zen 3 nodes (2 x AMD EPYC 7543), one job per node. The Zen 5 nodes were not benchmarked.

Data: human whole genome sequencing of NA12878, run ERR194147, paired-end 2 x 101 bp Illumina, gzip compressed, options --detect_adapter_for_pe and otherwise the defaults. The files are on BinAC 2 in /pfs/10/project/benchmark_data/wgs/giab_NA12878_truseq_30x/ERR194147/ (ERR194147_1.fastq.gz and ERR194147_2.fastq.gz). The smaller inputs are the first 10, 20 and 40 million read pairs of these files.

Threads

The option -w sets the number of fastp worker threads. 20 million read pairs, mean of 2 runs (1 run for -w 35 and more). The recommended setting is marked green.

-w --cpus-per-task Wall time Speedup vs -w 2
2 4 98 s 1.0
4 8 62 s 1.6
6 12 52 s 1.9
8 16 47 s 2.1
12 24 40 s 2.5
16 32 41 s 2.4
35 128 55 s 1.8
70 128 58 s 1.7
128 128 64 s 1.5
  • -w 8 with --cpus-per-task=16 is the recommended setting: it uses the CPUs well.
  • -w 12 with --cpus-per-task=24 is the fastest setting, but only about 15% faster for 50% more CPUs.
  • More than -w 16 makes fastp slower, not faster.

Job size and time

With -w 8 and --cpus-per-task=16:

Read pairs Input (gzip, R1 + R2) Wall time
10 million 1.3 GB 32 s
20 million 2.7 GB 47 s
40 million 5.2 GB 79 s
766 million (30x human genome) 103 GB 23 min

Rule of thumb (estimate from these runs): about 1.8 seconds per million read pairs, plus a few seconds to start. Add a safety margin to --time.

Memory

fastp needed 1.3 GiB of memory in every run with -w 2 to -w 16, no matter if the input had 10 million or 766 million read pairs. A full 30x human genome finished with --mem=2G, so --mem=2G is enough.

With many threads fastp needs more memory: 2.7 GiB at -w 128.

Storage

BinAC 2 has several places to keep data, see File Systems.

A single fastp job was equally fast with input and output on project storage (/pfs/10/project), in a workspace (/pfs/10/work) or in the job's local $TMPDIR (40 million read pairs, all combinations between 76 s and 79 s). fastp reads and writes only about 70 MB/s per job, so the file system does not slow it down. Copying the input to $TMPDIR first does not make fastp faster.

The compressed output is about as large as the input (103 GB for a 30x human genome). Make sure there is enough space where you write the output.

Pitfalls

  • Too many threads: more than -w 16 is slower, not faster. Do not use -w ${SLURM_CPUS_PER_TASK} with a large number of CPUs.
  • Some report values depend on -w: the insert size (histogram and peak) is calculated from the reads of only one worker thread, and the list of removed adapter sequences is limited per thread. These values change slightly when you change -w. The cleaned reads and all read, base and filter counts do not depend on -w (checked for -w 2 to -w 16).
  • Report file names: without -j and -h fastp writes fastp.json and fastp.html into the current directory. Give every sample its own names, otherwise the reports overwrite each other.
  • Output file names: -o and -O must be different files.

Support

See BinAC2 Support.