Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

fastp

> 数据库
Open source

An ultra-fast all-in-one FASTQ preprocessor (QC/adapters/trimming/filtering/splitting/merging...)

2.4K stars0 likes1 views
WebsiteGitHub

About

An ultra-fast all-in-one FASTQ preprocessor (QC/adapters/trimming/filtering/splitting/merging...)

fastp

A tool designed to provide ultrafast all-in-one preprocessing and quality control for FastQ data.

This tool is designed for processing short reads (i.e. Illumina NovaSeq, MGI), if you are looking for tools to process long reads (i.e. Nanopore, PacBio, Cyclone), please use fastplong.

fastp supports batch processing of multiple FASTQ files in a folder, see - batch processing

If you use fastp in your work, you can cite fastp as: Shifu Chen. fastp 1.0: An ultra-fast all-round tool for FASTQ data quality control and preprocessing. iMeta 4.5 (2025): e70078 https://doi.org/10.1002/imt2.70078

  • features
  • simple usage
  • examples of report
  • get fastp
    • install with Bioconda
    • or download the latest prebuilt binary for Linux users
    • or compile from source
      • Step 1: install isa-l
      • Step 2: install libdeflate
      • Step 3: install highway
      • Step 4: download and build fastp
  • input and output
    • output to STDOUT
    • input from STDIN
    • store the unpaired reads for PE data
    • store the reads that fail the filters
    • process only part of the data
    • do not overwrite exiting files
    • split the output to multiple files for parallel processing
    • merge PE reads
  • filtering
    • quality filter
    • length filter
    • low complexity filter
    • Other filter
  • adapters
  • per read cutting by quality score
  • base correction for PE data
  • global trimming
  • polyG tail trimming
  • polyX tail trimming
  • unique molecular identifier (UMI) processing
    • UMI example
  • output splitting
    • splitting by limiting file number
    • splitting by limiting the lines of each file
  • overrepresented sequence analysis
  • merge paired-end reads
  • duplication rate and deduplication
    • duplication rate evaluation
    • deduplication
  • batch processing
  • all options
  • citations
  • sponsorship

features

  1. comprehensive quality profiling for both before and after filtering data (quality curves, base contents, KMER, Q20/Q30, GC Ratio, duplication, adapter contents...)
  2. filter out bad reads (too low quality, too short, or too many N...)
  3. cut low quality bases for per read in its 5' and 3' by evaluating the mean quality from a sliding window (like Trimmomatic but faster).
  4. trim all reads in front and tail
  5. cut adapters. Adapter sequences can be automatically detected, which means you don't have to input the adapter sequences to trim them.
  6. correct mismatched base pairs in overlapped regions of paired end reads, if one base is with high quality while the other is with ultra low quality
  7. trim polyG in 3' ends, which is commonly seen in NovaSeq/NextSeq data. Trim polyX in 3' ends to remove unwanted polyX tailing (i.e. polyA tailing for mRNA-Seq data)
  8. preprocess unique molecular identifier (UMI) enabled data, shift UMI to sequence name.
  9. report JSON format result for further interpreting.
  10. visualize quality control and filtering results on a single HTML page (like FASTQC but faster and more informative).
  11. split the output to multiple files (0001.R1.gz, 0002.R1.gz...) to support parallel processing. Two modes can be used, limiting the total split file number, or limitting the lines of each split file.
  12. support long reads (data from PacBio / Nanopore devices).
  13. support reading from STDIN and writing to STDOUT
  14. support interleaved input
  15. support ultra-fast FASTQ-level deduplication
  16. ...

If you find a bug or have additional requirement for fastp, please file an issue:https://github.com/OpenGene/fastp/issues/new

simple usage

  • for single end data (not compressed)
fastp -i in.fq -o out.fq
  • for paired end data (gzip compressed)
fastp -i in.R1.fq.gz -I in.R2.fq.gz -o out.R1.fq.gz -O out.R2.fq.gz

By default, the HTML report is saved to fastp.html (can be specified with -h option), and the JSON report is saved to fastp.json (can be specified with -j option).

examples of report

fastp creates reports in both HTML and JSON format.

  • HTML report: http://opengene.org/fastp/fastp.html
  • JSON report: http://opengene.org/fastp/fastp.json

get fastp

install with Bioconda

bash
# note: the fastp version in bioconda may be not the latest
conda install -c bioconda fastp

or download the latest prebuilt binary for Linux users

This binary was compiled on CentOS, and tested on CentOS/Ubuntu

bash
# download the latest build
wget http://opengene.org/fastp/fastp
chmod a+x ./fastp

# or download specified version, i.e. fastp v1.3.3
wget http://opengene.org/fastp/fastp.1.3.3
mv fastp.1.3.3 fastp
chmod a+x ./fastp

or compile from source

fastp depends on libisal, libdeflate and libhwy (Google Highway >= 1.1.0). Please install all three before building.

You can install all dependencies at once with conda:

bash
conda install -c conda-forge isa-l libdeflate libhwy

Or install them individually using your system package manager:

Step 1: install isa-l

Install via brew install isa-l (macOS) or apt install libisal-dev (Ubuntu, dynamic linking only). Note: Ubuntu's libisal-dev does not ship a static library (.a). For static linking, compile from source (requires nasm, autoconf, automake, libtool):

bash
git clone --depth=1 --branch v2.31.0 https://github.com/intel/isa-l.git
cd isa-l
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make -j
sudo make install

Step 2: install libdeflate

Install via package manager: apt install libdeflate-dev (Ubuntu) or brew install libdeflate (macOS). Or compile from source:

bash
git clone https://github.com/ebiggers/libdeflate.git
cd libdeflate
cmake -B build
cmake --build build
sudo cmake --install build

Step 3: install Highway

Google Highway (>= 1.1.0) provides portable SIMD acceleration. Install via brew install highway (macOS) or conda install -c conda-forge libhwy. Note: apt install libhwy-dev on Ubuntu 24.04 provides 1.0.7 which is too old — compile from source instead:

bash
git clone --depth=1 --branch 1.3.0 https://github.com/google/highway.git
cd highway
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DHWY_ENABLE_TESTS=OFF -DHWY_ENABLE_EXAMPLES=OFF
cmake --build build
sudo cmake --install build

Step 4: download and build fastp

bash
# get source (you can also use browser to download from master or releases)
git clone https://github.com/OpenGene/fastp.git

# build
cd fastp
make -j

# Install
sudo make install

On macOS with Homebrew, you may need to specify the include and library paths:

bash
make -j INCLUDE_DIRS=/opt/homebrew/include LIBRARY_DIRS=/opt/homebrew/lib

input and output

fastp supports both single-end (SE) and paired-end (PE) input/output.

  • for SE data, you only have to specify read1 input by -i or --in1, and specify read1 output by -o or --out1.
  • for PE data, you should also specify read2 input by -I or --in2, and specify read2 output by -O or --out2.
  • if you don't specify the output file names, no output files will be written, but the QC will still be done for both data before and after filtering.
  • the output will be gzip-compressed if its file name ends with .gz

output to STDOUT

fastp supports streaming the passing-filter reads to STDOUT, so that it can be passed to other compressors like bzip2, or be passed to aligners like bwa and bowtie2.

  • specify --stdout to enable this mode to stream output to STDOUT
  • for PE data, the output will be interleaved FASTQ, which means the output will contain records like record1-R1 -> record1-R2 -> record2-R1 -> record2-R2 -> record3-R1 -> record3-R2 ...

input from STDIN

  • specify --stdin if you want to read the STDIN for processing.
  • if the STDIN is an interleaved paired-end stream, specify --interleaved_in to indicate that.
  • adapter auto-detection is disabled for STDIN mode

store the unpaired reads for PE data

  • you can specify --unpaired1 to store the reads that read1 passes filters but its paired read2 doesn't, as well as --unpaired2 for unpaired read2.
  • --unpaired1 and --unpaired2 can be the same, so the unpaired read1/read2 will be written to the same single file.

store the reads that fail the filters

  • give --failed_out to specify the file name to store the failed reads.
  • if one read failed and is written to --failed_out, its failure reason will be appended to its read name. For example, failed_quality_filter, failed_too_short etc.
  • for PE data, if unpaired reads are not stored (by giving --unpaired1 or --unpaired2), the failed pair of reads will be put together. If one read passes the filters but its pair doesn't, the failure reason will be paired_read_is_failing.

process only part of the data

If you don't want to process all the data, you can specify --reads_to_process to limit the reads to be processed. This is useful if you want to have a fast preview of the data quality, or you want to create a subset of the filtered data.

do not overwrite exiting files

You can enable the option --dont_overwrite to protect the existing files not to be overwritten by fastp. In this case, fastp will report an error and quit if it finds any of the output files (read1, read2, json report, html report) already exists before.

split the output to multiple files for parallel processing

See output splitting

merge PE reads

See merge paired-end reads

filtering

Multiple filters have been implemented.

quality filter

Quality filtering is enabled by default, but you can disable it by -Q or disable_quality_filtering. Currently it supports filtering by limiting the N base number (-n, --n_base_limit), and the percentage of unqualified bases.  

To filter reads by its percentage of unqualified bases, two options should be provided:

  • -q, --qualified_quality_phred       the quality value that a base is qualified. Default 15 means phred quality >=Q15 is qualified.
  • -u, --unqualified_percent_limit   how many percents of bases are allowed to be unqualified (0~100). Default 40 means 40%

You can also filter reads by its average quality score

  • -e, --average_qual if one read's average quality score <avg_qual, then this read/pair is discarded. Default 0 means no requirement (int [=0])

length filter

Length filtering is enabled by default, but you can disable it by -L or --disable_length_filtering. The minimum length requirement is specified with -l or --length_required.

For some applications like small RNA sequencing, you may want to discard the long reads. You can specify --length_limit to discard the reads longer

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++adapterbioinformaticsduplicationfastq

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库