list all records in a vcf file?
1
0
Entering edit mode
10.2 years ago

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
bgzf vcf tabix • 2.9k views
ADD COMMENT
2
Entering edit mode
10.2 years ago
Ram 44k

vcftools should do the trick:

vcftools --gzvcf vcfFile.vcf.gz --stdout

If the above doesn't work/give you a VCF output, try adding a --recode at the end.

ADD COMMENT
2
Entering edit mode

Thanks a lot RamRS. How is that different from looping over the file with zcat? I think both are equally slow, no?

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

You're most welcome :)

The VCFTools Perl might be a bit more optimized for TABIX-ed VCF GZs, might wanna check that out too!

ADD REPLY

Login before adding your answer.

Traffic: 1884 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6