Read alignment and variants · Software
bcftools
A toolkit to call, filter, merge, query, and summarise genetic variants in VCF, gVCF, and BCF2 files.
What bcftools is
BCFtools is a collection of command-line utilities for processing and analysing genetic variation data from high-throughput sequencing experiments. Developed alongside the Samtools project by Petr Danecek, Heng Li, and collaborators, it provides operations for Variant Call Format (VCF), genomic VCF (gVCF), and binary variant call format (BCF2) files.
The package addresses standard data-processing tasks encountered after read alignment in whole-genome and whole-exome sequencing workflows. It enables researchers to identify single nucleotide polymorphisms (SNPs) and short insertion-deletion (indel) variants, apply statistical filters, merge distinct samples, compute summary metrics, and examine predicted variant effects.
How it works
BCFtools uses HTSlib, an underlying C library specialised for reading and writing high-throughput sequencing data formats. It combines variant-calling routines originally derived from the Samtools codebase with file manipulation tools previously distributed in HTSlib, such as vcfmerge and vcfisec.
During execution, the software parses variant records from VCF or BCF2 files, processes coordinate and genotype data, and performs specific operations including variant calling, sorting, statistical summarisation, or logical filtering based on user-defined query criteria.
Key facts
- Latest version
- 1.20
- Primary developers
- Petr Danecek, James K Bonfield, Jennifer Liddle, John Marshall, Valeriu Ohan, Martin O Pollard, Andrew Whitwham, Thomas Keane, Shane A McCarthy, Robert M Davies, and Heng Li
- Supported formats
- VCF, gVCF, BCF2
- Target variants
- Single nucleotide polymorphisms (SNPs) and short indels
- Internal library
- HTSlib
What you can use it for
- Variant calling
- Calling SNPs and short indels from aligned sequence reads during whole-genome or whole-exome sequencing workflows.
- Variant filtering
- Filtering VCF and BCF files by applying custom statistical and annotation criteria to remove low-confidence calls.
- File conversion and manipulation
- Converting between plain-text VCF and binary BCF2 formats, sorting coordinate entries, and querying specific variant data.
- Merging and intersecting sample files
- Combining variant calls from multiple experiments or computing record intersections using integrated utilities such as vcfmerge and vcfisec.
- Quality assessment and statistics
- Summarising variant sets and calculating call-set statistics using commands such as vcfcheck.
Run it here
bcftools is preinstalled on the machine behind every research conversation. Ask the agent in plain language, or give it the exact command — it runs it, reads the output and explains it.
Try asking
“Filter this VCF to high-quality SNPs with bcftools and count them per chromosome.”
Strengths and limits
Good at
- Supports multiple genomic variant formats, including VCF, gVCF, and binary BCF2.
- Integrates variant calling directly alongside downstream filtering, merging, and querying tools.
- Contains its own copy of HTSlib within the source package, enabling independent compilation.
Watch out for
- Variant calling is restricted to single nucleotide polymorphisms and short indels, excluding structural variants.
- Operates exclusively on supported standard genomic variation formats conforming to HTS specifications.
Questions
Can I run bcftools online without installing it?
bcftools is preinstalled on the machine behind every research conversation. Ask the agent in plain language, or give it the exact command — it runs it, reads the output and explains it.
What licence is bcftools under?
bcftools is published under its authors' own licence; the project page at https://www.htslib.org/ states it.
Which variant types can BCFtools detect?
BCFtools is designed to call single nucleotide polymorphisms (SNPs) and short indel sequence variants.
What input and output file formats are supported?
The software reads and writes VCF, gVCF, and binary BCF2 files.
Is an external installation of HTSlib required to build the software?
No. While BCFtools uses HTSlib internally to read and write sequencing data, the distribution package includes its own copy of HTSlib so it can be built independently.
Where should software defects or feature requests be submitted?
General issues and feature requests are tracked via the BCFtools GitHub issue tracker, whereas security issues should be directed by email to samtools@sanger.ac.uk.
How to cite it
Petr Danecek, James K Bonfield, Jennifer Liddle, John Marshall, Valeriu Ohan, Martin O Pollard, Andrew Whitwham, Thomas Keane, Shane A McCarthy, Robert M Davies, Heng Li, Twelve years of SAMtools and BCFtools, GigaScience, Volume 10, Issue 2, February 2021, giab008, https://doi.org/10.1093/gigascience/giab008
Written from bcftools's own README and project page. Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.