A BCF 2.2 parser using HTSJDK.
The developpment for HTSJDK/vcf is stalled and I really need a BCF reader. At the time of writing HTSJDK only support BCF2.1. See (2016) samtools/htsjdk#596
All the data is decoded, all the genotypes are decoded on the fly, there is no soft mecanism to decode the genotypes on demand.
So far, the tests I ran with a few bcfs show no differences with the VCF+Htsjdk (The classes of the attributes might change though, e.g "1.5" as String vs "1.5" as Float)
try(BCFFileReader r=new BCFFileReader(path,true)) {
VCFHeader h= r.getHeader();
try(CloseableIterator<VariantContext> iter= r.query("chr1",100,200)) {
while(iter.hasNext()) {
VariantContext ctx = iter.next();
}
}
}
try(VCFIterator iter = BCFIterator.open(pat)) {
VCFHeader h= iter.getHeader();
while(iter.hasNext()) {
VariantContext ctx = iter.next();
}
}
Compilation of the library bcf.jar requires a java compiler, make, wget.
make
Pierre Lindenbaum PhD Institut du Thorax 44000 Nantes France