Development manual for vsearch 2.32.0, built from the
devbranch: it describes changes that are not released yet. The manual for the current release is published separately.
NAME
userfields — output fields available with the --userout option
DESCRIPTION
The option --userfields selects and orders the columns written to a --userout file. Fields are separated by +:
vsearch \
--usearch_global queries.fasta \
--db db.fasta \
--id 0.97 \
--userout results.tsv \
--userfields query+target+id+alnlen+mism+opens
When a query has no match (reported only with --output_no_hits), numeric fields are set to 0, string fields are empty, and target is set to *, unless noted otherwise.
Fields are grouped thematically below. See also vsearch-pairwise_alignment_parameters(7) for a description of the alignment model and identity definitions.
Alignment representation
aln- Pairwise alignment encoded as a string of operation characters:
M(match or mismatch, i.e. not a gap),D(deletion, i.e. a gap in the target),I(insertion, i.e. a gap in the query). Empty if there is no alignment. Seevsearch-cigar(5)for a description of the operation alphabet. caln- Compact pairwise alignment in CIGAR format (Compact Idiosyncratic Gapped Alignment Report):
M(match or mismatch),D(deletion, a gap in the target),I(insertion, a gap in the query). Explicit operations are always written (the=exact-match shorthand appears only in--ucoutput). Empty if there is no alignment. Seevsearch-cigar(5)for a complete description. qrow- Query segment as seen in the pairwise alignment, with gap characters inserted where the target has an insertion. Empty if there is no alignment.
trow- Target segment as seen in the pairwise alignment, with gap characters inserted where the query has an insertion. Empty if there is no alignment.
qrowdots- Query segment as
qrowreports it, with a dot (.) at every position identical to the target, so that only the differences remain visible. A gap keeps its gap character, and a position where the two sequences carry different nucleotides keeps its own nucleotide. Ambiguous nucleotides are dotted only against the same symbol: anNfacing anAis written out, even though the alignment counts that position as a match (seeids). Empty if there is no alignment. trowdots- Target segment as
trowreports it, dotted in the same way. Where the query has a gap,trowdotsshows the target nucleotide, andqrowdotsshows the gap character.
Query and target identifiers
query- Query sequence label.
target- Target sequence label. Set to
*if there is no alignment.
Sequences
The two fields below report complete sequences, not the aligned segments reported by qrow and trow. Both are written on a single line, without folding, and both report the sequences as the search saw them: with the default --qmask dust and --dbmask dust, masked low-complexity regions appear in lower case (see vsearch-fasta(5)).
qseq- Full-length query sequence. On a minus-strand hit, the reverse complement of the query is reported, so that
qseqmatches the orientation used byqrowand by the--qsegoutoutput. Reported even when there is no alignment, asqlis. tseq- Full-length target sequence, including any part of it that falls outside the alignment. Empty if there is no alignment.
Sequence lengths
ql- Query sequence length (positive integer).
tl- Target sequence length (positive integer).
qs- Query segment length. Always equal to the query sequence length.
ts- Target segment length. Always equal to the target sequence length.
Alignment span
The following fields report the first and last aligned positions in the query (q) or target (t) sequence, using 1-based nucleotide positions. The lo/hi variants span the whole sequence, from 1 to its length (swapped for the query on minus-strand hits); the ilo/ihi variants exclude terminal gaps and report the span of the actual aligned residues. The lor/hir variants report the same span as lo/hi, counted from zero rather than from one.
qlo- First nucleotide of the query aligned with the target: 1 when there is an alignment on the plus strand; on minus-strand hits
qloandqhiare swapped (qlois then the query sequence length). Seeqiloto exclude initial gaps. qhi- Last nucleotide of the query aligned with the target: the query sequence length when there is an alignment on the plus strand (1 on minus-strand hits). See
qihito exclude terminal gaps. qilo- First nucleotide of the query aligned with the target, ignoring initial terminal gaps. Nucleotide positions use 1-based indexing.
qihi- Last nucleotide of the query aligned with the target, ignoring terminal gaps at the right. Nucleotide positions use 1-based indexing.
tlo- First nucleotide of the target aligned with the query. Always 1 when there is an alignment (including terminal gaps at the left). See
tiloto exclude initial gaps. thi- Last nucleotide of the target aligned with the query: the target sequence length when there is an alignment. See
tihito exclude terminal gaps. tilo- First nucleotide of the target aligned with the query, ignoring initial terminal gaps. Nucleotide positions use 1-based indexing.
tihi- Last nucleotide of the target aligned with the query, ignoring terminal gaps at the right. Nucleotide positions use 1-based indexing.
qlor- Same as
qlo, using 0-based indexing: 0 when there is an alignment on the plus strand, and the query sequence length minus one on minus-strand hits. qhir- Same as
qhi, using 0-based indexing: the query sequence length minus one when there is an alignment on the plus strand, and 0 on minus-strand hits. tlor- Same as
tlo, using 0-based indexing. Always 0 when there is an alignment. thir- Same as
thi, using 0-based indexing: the target sequence length minus one when there is an alignment.
Alignment statistics
alnlen- Length of the pairwise alignment: the number of columns, excluding terminal gaps.
ids- Number of matching columns in the alignment (zero or positive integer).
mism- Number of mismatching columns in the alignment (zero or positive integer).
gaps- Number of gap-containing columns in the alignment (zero or positive integer, excluding terminal gaps).
diffs- Number of differing columns in the alignment:
mism+gaps, or equivalentlyalnlen-ids(zero or positive integer, excluding terminal gaps). This is the quantity the option--maxdiffsis compared against. opens- Number of gap-opening columns in the alignment (zero or positive integer, excluding terminal gaps).
exts- Number of gap-extension columns in the alignment (zero or positive integer).
pairs- Number of columns containing only nucleotides (alignment length minus gap-containing columns; zero or positive integer).
pv- Number of positive columns. Equivalent to the number of matches for nucleotide sequences.
pctgaps- Number of gap-containing columns expressed as a percentage of the alignment length (real value from 0.0 to 100.0).
pctpv- Percentage of positive columns. Equivalent to the percentage of matches for nucleotide sequences (real value from 0.0 to 100.0).
Identity percentages
id- Percentage of identity computed according to the definition selected by
--iddef(default:id2; real value from 0.0 to 100.0). mid- Percentage of identity computed over the columns containing two nucleotides, ignoring all gaps, internal and terminal: 100 * (matching columns) / (
pairs). This is the quantity the option--midis compared against. A hit whose only difference is a gap therefore reports 100.0 here whileidreports less. id0- CD-HIT definition: 100 * (matching columns) / (shortest sequence length).
id1- Edit distance: 100 * (matching columns) / (alignment length).
id2- Edit distance excluding terminal gaps: 100 * (matching columns) / (alignment length - terminal gaps). Default definition for
--id. id3- Marine Biological Lab definition, counting each gap opening (internal or terminal) as a single mismatch, whether or not the gap was extended: 100 * (1.0 - [(mismatches + gap openings) / (longest sequence length)]).
id4- BLAST definition, equivalent to
id1for global pairwise alignments. Always equal toid1.
Coverage
qcov- Fraction of the query sequence aligned with the target (real value from 0.0 to 100.0). Computed as 100 * (matches + mismatches) / (query sequence length). Gap-only columns are not counted.
tcov- Fraction of the target sequence aligned with the query (real value from 0.0 to 100.0). Computed as 100 * (matches + mismatches) / (target sequence length). Gap-only columns are not counted.
Score
raw- Raw alignment score (negative, zero, or positive integer). The score is the sum of match rewards minus mismatch penalties, gap opening penalties, and gap extension penalties, using the parameters set by
--match,--mismatch,--gapopen, and--gapext. bits- Bit score. Not computed for nucleotide alignments. Always 0.
evalue- E-value. Not computed for nucleotide alignments. Always -1.
Strand
qstrand- Query strand orientation (
+or-for nucleotide sequences). Empty if there is no alignment. tstrand- Target strand orientation. Always
+: when a query matches a target on the reverse strand,tstrandis+andqstrandis-. Empty if there is no alignment.
Unused fields
qframe- Query reading frame (-3 to +3). Only meaningful for coding sequences; not computed by vsearch. Always
+0. tframe- Target reading frame (-3 to +3). Only meaningful for coding sequences; not computed by vsearch. Always
+0.
EXAMPLES
Output query label, target label, identity, alignment length, and number of mismatches:
vsearch \
--usearch_global queries.fasta \
--db db.fasta \
--id 0.97 \
--userout results.tsv \
--userfields query+target+id+alnlen+mism
Output all five identity definitions side by side for comparison:
vsearch \
--usearch_global queries.fasta \
--db db.fasta \
--id 0.0 \
--userout identity_comparison.tsv \
--userfields query+target+id0+id1+id2+id3+id4
Report each hit as a list of its differences alone, with the target label and the number of differences:
vsearch \
--usearch_global queries.fasta \
--db db.fasta \
--id 0.97 \
--userout differences.tsv \
--userfields query+target+diffs+qrowdots+trowdots
Output query coverage and alignment span excluding terminal gaps:
vsearch \
--usearch_global queries.fasta \
--db db.fasta \
--id 0.8 \
--userout coverage.tsv \
--userfields query+target+qcov+tcov+qilo+qihi+tilo+tihi
SEE ALSO
vsearch-pairwise_alignment_parameters(7), vsearch-allpairs_global(1), vsearch-cluster_fast(1), vsearch-cluster_size(1), vsearch-cluster_smallmem(1), vsearch-cluster_unoise(1), vsearch-search_exact(1), vsearch-usearch_global(1)
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.
These manual pages are also published online at https://torognes.github.io/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.