How to quickly read VCF file in indexed bgzip format?
I am reading documents but get confused, there are libraries samtools, bcftools, htslib, vcftools... and I feel lost, which one should I use, could someone give me a quick C++ example, I just want to read line by line to get certain information of variants in a VCF file in indexed bgzip format.
That is very helpful, is there any API documentation?
Actually, if I just want to read bgzip VCF file line by line, do I really need index information? Thank you.
no you can always 'just' use a gzip stream from gz lib : http://www.zlib.net/manual.html gz is compatible with the vcf/bgzf format
it works much like stdio/ fopen
It seems there are differences between GBZF and GZIP file format. Should I use specific library or function to read BGZP file instead of this function for GZIP file?
as I said bgzf is compatible with gzip. You can 'gzopen' a bgzf with gzlib but you cannot do a random-access of a bgzf without the htslib