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

fq

> 前端框架
Open source

Command line utility for manipulating FASTQ files

99 stars0 likes1 views
WebsiteGitHub

About

Command line utility for manipulating FASTQ files

fq

fq filters, subsamples, and validates FASTQ files.

Install

There are different methods to install fq.

Releases

Precompiled binaries are built for modern Linux distributions (x86_64-unknown-linux-gnu), macOS (x86_64-apple-darwin), and Windows (x86_64-pc-windows-msvc). The Linux binaries require glibc 2.31+ (CentOS/RHEL 9+, Debian 11+, Ubuntu 20.04+, etc.).

Conda

fq is available via Bioconda.

$ conda install fq=0.12.0

Manual

Clone the repository and use Cargo to install fq.

$ git clone --depth 1 --branch v0.12.0 https://github.com/stjude-rust-labs/fq.git
$ cd fq
$ cargo install --locked --path .

Container image

Container images are managed by Bioconda and available through Quay.io, e.g., using Docker:

$ docker image pull quay.io/biocontainers/fq:

See the repository tags for the available tags.

Alternatively, build the development container image:

$ git clone --depth 1 --branch v0.12.0 https://github.com/stjude-rust-labs/fq.git
$ cd fq
$ docker image build --tag fq:0.12.0 .

Usage

fq provides subcommands for filtering, subsampling, and validating FASTQ files.

filter

fq filter filters a given FASTQ file by a set of names or a sequence pattern. The result includes only the records that match the given options.

Usage

Filters a FASTQ file

Usage: fq filter [OPTIONS] --dsts  [SRCS]...

Arguments:
  [SRCS]...  FASTQ sources. Accepts both raw and gzipped FASTQ inputs

Options:
      --names 
          Allowlist of record names
      --sequence-pattern 
          Keep records that have sequences that match the given regular expression
      --dsts 
          Filtered FASTQ destinations
  -h, --help
          Print help
  -V, --version
          Print version

Examples

bash
# Filters an input FASTQ using the given allowlist.
$ fq filter --names allowlist.txt --dsts /dev/stdout in.fastq

# Filters FASTQ files by matching a sequence pattern in the first input's
# records and applying the match to all inputs.
$ fq filter --sequence-pattern ^TC --dsts out.1.fq --dsts out.2.fq in.1.fq in.2.fq

lint

fq lint is a FASTQ file pair validator.

Usage

…

Validators

validate includes a set of validators that run on single or paired records. By default, records are validated with all rules, but validators can be disabled using --disable-validator CODE, where CODE is one of validators listed below.

Single
Code Level Name Validation
S001 low PlusLine Plus line starts with a "+".
S002 medium Alphabet All characters in sequence line are one of "ACGTN", case-insensitive.
S003 high Name Name line starts with an "@".
S004 low Complete All four record lines (name, sequence, plus line, and quality) are present.
S005 high ConsistentSeqQual Sequence and quality lengths are the same.
S006 medium QualityString All characters in quality line are between "!" and "~" (ordinal values).
S007 high DuplicateName All record names are unique.
Paired
Code Level Name Validation
P001 medium Names Each paired read name is the same, excluding interleave.

Examples

bash
# Validate both reads using all validators. Exits cleanly (0) if no validation
# errors occur.
$ fq lint r1.fastq r2.fastq

# Log errors instead of quitting on first error.
$ fq lint --lint-mode log r1.fastq r2.fastq

# Disable validators S004 and S007.
$ fq lint --disable-validator S004 --disable-validator S007 r1.fastq r2.fastq

subsample

fq subsample outputs a subset of records from single or paired FASTQ files.

When using a probability (-p, --probability), each file is read through once, and a subset of records is selected based on that chance. Given the randomness used when sampling a uniform distribution, the output record count will not be exact but (statistically) close.

When using a record count (-n, --record-count), the first input is read twice, but it provides an exact number of records to be selected.

A seed (-s, --seed) can be provided to influence the results, e.g., for a deterministic subset of records.

For paired input, the sampling is applied to each pair.

Usage

…

Examples

…

Legal

Please see the disclaimer that applies to all crates and command line tools made available by St. Jude Rust Labs.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustbioinformaticsfastqfastq-filesgenomics

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架