Entering edit mode
10.2 years ago
Tommy Carstensen
▴
210
Is it possible to use tabix or a similar tool to list all records (chrom and pos) in a tabix indexed block gzipped vcf file or do I need to loop over the file to acquire this information? Thanks.
zcat seems to be faster than bcftools:
zcat file.vcf.gz | grep -v ^# | cut -f-2
bcftools query -f '%CHROM\t%POS\n' file.vcf.gz
Thanks a lot RamRS. How is that different from looping over the file with zcat? I think both are equally slow, no?
They very well might be, but unfortunately this is the only technique I know :(
Please do update your post with a better technique if you come across one - I'm sure many of us would benefit from it!
I sure will update my post RamRS, if I come across a better solution. I have asked a few coworkers and hopefully they will get back to me by Monday with a silver bullet solution. Thanks for your suggestion.
You're most welcome :)
The VCFTools Perl might be a bit more optimized for TABIX-ed VCF GZs, might wanna check that out too!