This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools - reducing to "sites-only"?

I have some very large WGS BCF files and I would to extract just the first 8 columns, thus reducing to just a 'sites-only' VCF/BCF.

Does BCFTOOLS have a canned option for doing it?

I know I can do this:

query -f "%CHROM\t%POS\t%ID\t%REF\t%ALT\t%QUAL\t%FILTER\t%INFO\n"

but I'm finding that that is quite slow (>24hrs for some files in my case) - understandably so, since it will need to parse each BCF record (and I'll bet it's parsing all the per-sample information, which I don't want) and then reconstruct the desired output line for each row, according to that complex format string. But since my format string is really just "the first 8 columns please, unchanged", and "sites-only" VCF/BCFs are sort of a common/known thing, I wonder if there isn't a more efficient way to do that?

Thanks for any info

sites-only bcftools

1 answer

bcftools view -G in.vcf.gz

Thank you Pierre!
Not sure why I didn't notice that (I should have)

Don't forget to follow up on your threads. If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work. If an answer was not really helpful or did not work, provide detailed feedback so others know not to use that answer.

Upvote|Bookmark|Accept

Log in to answer this question.