Skip to content

lindenb/bcfparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

java parser for BCF2.2 format (Binary VCF format). The current HTSJDK only supports BCF2.1

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published