NAME
fastq — a text-based format for representing nucleotide sequences and their corresponding quality scores
DESCRIPTION
In fastq files, each entry consists of four parts: a sequence header starting with ‘@’, a sequence, a quality header starting with ‘+’, and a quality string:
@label [description]
ACGTURYSWKMDBHVN...
+
IIIIIIIIIIIIIIII...
Sequence header
The sequence header is the line starting with ‘@’. The label is the
string between ‘@’ and the first space, tab, or newline, unless
--notrunclabels is in effect, in which case the entire line after ‘@’
is used as the label.
The header should contain printable ASCII characters (values 33–126, see
ascii(7)). The control characters 1–8, 11–12, 14–31 and 127 cause a
fatal error; the tabulation (9) is accepted; a NUL byte (0) silently
truncates the label; carriage returns (13) and newlines (10) terminate
the line. Non-ASCII characters (values 128–255) trigger a warning. This
check covers the part of the header the command retains: the label by
default, or the whole header line for the filtering commands
(--fastq_filter, --fastx_filter) and when --notrunclabels is in
effect.
Sequence
The sequence is the line following the header line. It is a string of IUPAC symbols (‘ACGTURYSWKMDBHVN’ and ‘acgturyswkmdbhvn’). Carriage returns before the newline are accepted (Windows line endings); any other character — including tabulations, spaces, and any non-IUPAC letter or non-ASCII byte — causes a fatal error. Unlike the fasta parser, nothing is silently stripped from fastq sequences.
Quality header
The quality header is the line starting with ‘+’. The text after ‘+’ must be empty or repeat the sequence header line exactly; anything else causes a fatal error.
Quality string
The quality string is a string of ASCII characters, one per base, encoding the Phred quality score for the corresponding position. The quality string starts after the quality header line and ends before the next sequence header or the end of the file.
Quality scores are encoded as Q = ASCII_value - offset, where the
offset is set with --fastq_ascii (default 33):
-
phred+33 (offset 33): Sanger and Illumina 1.8+ format. Valid quality characters range from ‘!’ (Q=0) to ‘~’ (Q=93). vsearch accepts scores from 0 to 41 by default (
--fastq_qminand--fastq_qmax). -
phred+64 (offset 64): Solexa, Illumina 1.3+, and Illumina 1.5+ formats. Valid quality characters range from ‘@’ (Q=0) to ‘~’ (Q=62); negative Solexa scores (down to -31, e.g. ‘;’ for the historical -5) are representable by lowering
--fastq_qmin.
The parser accepts every printable ASCII character (values 33–126) in
quality strings — ‘.’ and ‘-’ are ordinary quality symbols (Q=13 and
Q=12 at offset 33). Carriage returns before the newline are accepted;
any other character (tabulations, spaces, control characters, values
128–255) causes a fatal error; nothing is stripped or warned about. The
--fastq_qmin/--fastq_qmax score bounds are enforced by the commands
that interpret quality values, not by the parser itself.
Header annotations
vsearch reads and writes several annotations embedded in sequence
headers, following the pattern [@;]key=value[;]. Annotations can
appear in any order, but must be joined to the label by ‘;’ without any
whitespace: with the default header truncation, an annotation separated
from the label by a space is part of the discarded remainder and is
silently invisible (unless --notrunclabels is used).
[@;]size=integer[;]
Abundance (number of occurrences of the sequence in the study). Read by
--sizein, written by --sizeout, removed by --xsize.
[@;]ee=float[;]
Expected error count. Written by --eeout or --fastq_eeout, removed
by --xee. See
vsearch-expected_error(7).
[@;]length=integer[;]
Sequence length. Written by --lengthout, removed by --xlength.
[@;]sample=string[;]
Sample identifier. Written by --sample.
Case and masking
vsearch operations are case-insensitive, except when soft masking is
active. Lower-case letters indicate masked residues; upper-case letters
indicate unmasked residues. DUST masking (automatic low-complexity
masking applied during chimera detection, clustering, masking, pairwise
alignment, and searching) converts low-complexity regions to lower case.
Soft masking is enabled with --qmask soft or --dbmask soft. Masked
residues are excluded from word-based comparisons but otherwise treated
as normal symbols.
T and U equivalence
When comparing sequences (chimera detection, dereplication, searching, and clustering), T and U are treated as identical regardless of case.
SEE ALSO
vsearch-fasta(5),
vsearch-udb(5),
vsearch-fastq_chars(1),
vsearch-fastq_convert(1),
ascii(7)
CITATION
Rognes T, Flouri T, Nichols B, Quince C, Mahé F. (2016) VSEARCH: a versatile open source tool for metagenomics. PeerJ 4:e2584 doi: 10.7717/peerj.2584
REPORTING BUGS
Submit suggestions and bug-reports at https://github.com/torognes/vsearch/issues, send a pull request on https://github.com/torognes/vsearch, or compose a friendly or curmudgeont e-mail to Torbjørn Rognes (torognes@ifi.uio.no).
AVAILABILITY
Source code and binaries are available at https://github.com/torognes/vsearch.
COPYRIGHT
Copyright (C) 2014-2026, Torbjørn Rognes, Frédéric Mahé and Tomás Flouri
All rights reserved.
Contact: Torbjørn Rognes torognes@ifi.uio.no, Department of Informatics, University of Oslo, PO Box 1080 Blindern, NO-0316 Oslo, Norway
This software is dual-licensed and available under a choice of one of two licenses, either under the terms of the GNU General Public License version 3 or the BSD 2-Clause License.
GNU General Public License version 3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
The BSD 2-Clause License
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ACKNOWLEDGMENTS
We would like to thank the authors of the following projects for making their source code available:
- vsearch includes code from Google’s CityHash project by Geoff Pike and Jyrki Alakuijala, providing some excellent hash functions available under a MIT license.
- vsearch includes code derived from Tatusov and Lipman’s DUST program that is in the public domain.
- vsearch includes public domain code written by Alexander Peslyak for the MD5 message digest algorithm.
- vsearch includes public domain code written by Steve Reid and others for the SHA1 message digest algorithm.
- vsearch binaries may include code from the zlib library, copyright Jean-Loup Gailly and Mark Adler.
- vsearch binaries may include code from the bzip2 library, copyright Julian R. Seward.