This is a test version of Biostars. For the public version, visit https://www.biostars.org.
vcf to bcf conversion

I want to convert a .vcf.gz file into .bcf (compressed) form;

I tried the following command:

bcftools view file.vcf.gz -Ob -o file.bcf

however, when I check the converted .bcf file, I got the header showing:

##fileformat=VCFv4.2

shouldn't the fileformat be BCF?

Thank you.

vcf bcftools bcf

1 answer

File format specification is Variant Call Format (VCF).

BCF is a binary representation of VCF files (section 6 from format spec doc above) :

BCF2 is a binary, compressed equivalent of VCF that can be indexed with tabix and can be efficiently decoded from disk or streams.

and

The “text” field contains the standard VCF header lines in text format, from ##fileformat=VCFv4.3 to #CHROM ... inclusive, terminated by a NUL character.

Log in to answer this question.