samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 243 forks source link

Ignore version validation for BCF in VCFHeaderReader because we only need the header #1707

Open lindenb opened 6 months ago

lindenb commented 6 months ago

Description

For now HTSJDK does not support BCF2.2 but sometimes you just want to only get the VCF header in a BCF file while you don't care about the variants . e.g:

search all the vcfs in your filesystem with given dictionary and for given sample(s)).

So this PR, overrides BCF2Codec.validateVersionCompatibility in VCFheaderReader so the validation is just ignored.

VCFheaderReader is then used in SamSequenceDictionaryExtractor instead of VCFReader so we can extract a dictionary from a BCF2.2 file

I added tests.

Things to think about before submitting: