bcftools
Variant calling and VCF/BCF file manipulation
TLDR
SYNOPSIS
bcftools subcommand [options] [file]
DESCRIPTION
bcftools is a suite of utilities for variant calling and manipulating files in the Variant Call Format (VCF) and its binary counterpart BCF. It is part of the SAMtools/HTSlib project and is widely used in bioinformatics for genomic variant analysis.All commands work transparently with both VCF and BCF files, compressed or uncompressed. The tools are designed to work in pipelines, reading from stdin and writing to stdout.
PARAMETERS
-Ob
Output compressed BCF-Oz
Output compressed VCF (bgzipped)-Ov
Output uncompressed VCF-Ou
Output uncompressed BCF (fastest for piping)-r region
Restrict to comma-separated regions (chr:from-to format), requires an index-R file
Restrict to regions listed in a file (VCF, BED, or tab-delimited)-t region
Restrict to targets, streamed without an index-T file
Restrict to targets listed in a file-s samples
Comma-separated list of samples to include (prefix ^ to exclude)-S file
Read the sample list from a file--threads int
Number of extra worker threads used for output compression-W, --write-index [fmt]
Automatically index the output (tbi or csi)-i expression
Include sites matching filter expression-e expression
Exclude sites matching filter expression-o file
Output file name
SUBCOMMANDS
Variant Calling
mpileup, callFile Operations
view, merge, concat, sort, index, convertFiltering & Querying
filter, query, normStatistics
stats, roh, gtcheckAnnotation
annotate, csq, fill-tagsManipulation
reheader, isec, head, cnv, polysomyConsensus
consensusPlugins
plugin (e.g. +split, +scatter, +fill-tags, +setGT)
CAVEATS
Use -Ou when piping between bcftools subcommands to avoid unnecessary compression overhead. Indexed files are required for random access and some operations. VCF/BCF files should be sorted by chromosome and position for most operations.
HISTORY
bcftools was developed as part of the SAMtools project, initially created by Heng Li at the Wellcome Sanger Institute. It became a separate project around 2014 with the HTSlib library rewrite, gaining significant functionality for variant analysis.
