bcftools

Version:

1.15.1

Category:

bio

Cluster:

Loki

Author / Distributor

https://samtools.github.io/bcftools/bcftools.html

Description

BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed.

Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations. In general, whenever multiple VCFs are read simultaneously, they must be indexed and therefore also compressed. (Note that files with non-standard index names can be accessed as e.g. β€œbcftools view -r X:2928329 file.vcf.gz##idx##non-standard-index-name”.)

BCFtools is designed to work on a stream. It regards an input file β€œ-” as the standard input (stdin) and outputs to the standard output (stdout). Several commands can thus be combined with Unix pipes.

Documentation

For a full list of available commands, run bcftools without arguments. For a full list of available options, run bcftools COMMAND without arguments.

annotate      .. edit VCF files, add or remove annotations
call          .. SNP/indel calling (former "view")
cnv           .. Copy Number Variation caller
concat        .. concatenate VCF/BCF files from the same set of samples
consensus     .. create consensus sequence by applying VCF variants
convert       .. convert VCF/BCF to other formats and back
csq           .. haplotype aware consequence caller
filter        .. filter VCF/BCF files using fixed thresholds
gtcheck       .. check sample concordance, detect sample swaps and contamination
head          .. view VCF/BCF file headers
index         .. index VCF/BCF
isec          .. intersections of VCF/BCF files
merge         .. merge VCF/BCF files from non-overlapping sample sets
mpileup       .. multi-way pileup producing genotype likelihoods
norm          .. normalize indels
plugin        .. run user-defined plugin
polysomy      .. detect contaminations and whole-chromosome aberrations
query         .. transform VCF/BCF into user-defined formats
reheader      .. modify VCF/BCF header, change sample names
roh           .. identify runs of homo/auto-zygosity
sort          .. sort VCF/BCF files
stats         .. produce VCF/BCF stats (former vcfcheck)
view          .. subset, filter and convert VCF and BCF files

Examples/Usage

  • Load the Anaconda module:

    $ module load bio/bcftools
    
  • Check the loaded modules:

    $ module list
    
  • List available modules:

    $ module avail bio/bcftools
    
  • Unload the Anaconda module:

    $ module unload bio/bcftools
    
  • Remove three fields:

    $ bcftools annotate -x ID,INFO/DP,FORMAT/DP file.vcf.gz
    
  • Remove all INFO fields and all FORMAT fields except for GT and PL:

    $ bcftools annotate -x INFO,^FORMAT/GT,FORMAT/PL file.vcf
    
  • For (many) more examples see http://samtools.github.io/bcftools/howtos/annotate.html

Installation

Source code is obtained from BCFtools