Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.23 KB

File metadata and controls

51 lines (36 loc) · 1.23 KB

A BCF 2.2 parser using HTSJDK.

Motivation

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)

Usage

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

Compilation of the library bcf.jar requires a java compiler, make, wget.

make

Author

Pierre Lindenbaum PhD Institut du Thorax 44000 Nantes France