This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert VCF to BCF

Hi all. I'm trying to convert this vcf to bcf but it's not working. Just spits out usage and fails.

bcftools convert -o clinvar_20150603 -O u clinvar_20150603.vcf

Strangely I can not find any info on what seems like a very common and simple task. Thanks

Edit: Forgot to mention the following

bcftools 1.1

mac os 10.x

Probably an issue only on mac... trying linux

Update:

This works fine on linux with current versions built from source. The older mac version didn't work as expected, and I have no further need to mess with this. Thanks.

vcf bcf vcftools

1 answer

I think you just need to delete the space between the -O u so its -Ou

EDIT Actually, just tried both ways and got the same output so I guess that my answer is not helpful. On the off chance you have v 0.19 you can do it like this

bcftools view -SDu clinvar_20150603.vcf > clinvar_20150603.bcf

Can you just do it like this

bcftools convert -Ou clinvar_20150603.vcf > clinvar_20150603.bcf

v0.19 generates BCFv1 which has been obsolete. v1.0+ generates BCFv2. It is better in many ways.

Good to know. How do you upgrade/update tot he newer version? Is it something that can be done over the existing software or is it a removal of the old version and an install of the new version?

Log in to answer this question.