VCFtools

As of July 2015, the VCFtools project has been moved to github! Please visit the new website here: vcftools.github.io/htslib.html

The bcftools/htslib VCF commands

HTSlib is a C library for high-throughput sequencing data formats. It is designed for speed and works with both VCF and BCFv2.

Download and installation

The library is hosted on github. It can be downloaded and compiled the usual way. The clone command is run only once, the pull command is run whenever the latest snapshots from github is needed. Please see the bcftools github page for the up-to-date version of the clone command. The software is under heavy development and the option --branch may be required.

git clone [--branch=name] git://github.com/samtools/htslib.git htslib
git clone git://github.com/samtools/bcftools.git bcftools
cd htslib; git pull; cd ..
cd bcftools; git pull; cd ..

# Compile
cd bcftools; make; make test

# Run
./bcftools stats file.vcf.gz

The tools

bcftools annotate

Adds or removes annotations, support for user-written plugins.

Fast alternative to vcf-annotate

(Read more)

bcftools call

Formerly known as bcftools view, this is the successor of the popular caller from the samtools package with extended capabilities.

(Read more)

bcftools filter

Powerful fixed-threshold filtering, accepts boolean and arithmetic expressions.
See also the bcftools view below.

(Read more)

bcftools gtcheck

A tool for detecting sample swaps and contamination

(Read more)

bcftools isec

Fast alternative to vcf-isec

(Read more)

bcftools merge

Fast alternative to vcf-merge with extended capabilities and correct handling of Number=A,G,R INFO fields.

(Read more)

bcftools norm

Left-align and normalize indels to the shortest possible representation.

(Read more)

bcftools query

Fast alternative to vcf-query

(Read more)

bcftools stats

Formerly known as vcfcheck. Extract stats from a VCF/BCF file or compare two VCF/BCF files. The resulting text file can be plotted using plot-vcfstats.

bcftools stats file.vcf.gz > file.vchk
plot-vcfstats file.vchk -p plots/

(Read more)

bcftools view

This versatile tool can be used for subsetting by sample, position and even flexible fixed-threshold filtering.

(Read more)