Skip to content

5.0.1

Choose a tag to compare

@tfenne tfenne released this 01 Oct 11:16
· 151 commits to master since this release
d0a4fee

htsjdk 5.0.1 Release Notes

A patch release on the 5.0 line that makes BCF decoding and many-sample VCF writing much faster. It is a drop-in replacement for 5.0.0: there is no API change, and decoded values and written output are byte-for-byte unchanged.

⚡ Performance

  • BCF records decode faster, most of all their genotypes. BCF2Decoder reads each value straight from the record's bytes rather than a byte at a time through a synchronized ByteArrayInputStream. Reading a 3,000-sample BCF and decoding every genotype takes 40–60% less time on Apple silicon (#1856).
  • Writing VCF records with many samples is faster. VCFEncoder.formatVCFDouble formats %.2f and %.3f values without a java.util.Formatter except near a rounding halfway point. List and array attributes are formatted without reflection. VCFWriter encodes each record into a StringBuilder and writes it in one call, rather than taking the BufferedWriter's lock for every few characters (#1857).
  • The VCF encoder does less for each sample. It works out each FORMAT key's kind once per record, writes a missing attribute without formatting it, takes genotypes by position when a record's genotypes are in the header's sample order, and finds a GT allele's code by identity before hashing its bases (#1858).

🐛 Bug fixes

  • A truncated or corrupt BCF record now fails with a TribbleException when decoding reaches the end of the record's bytes. It used to read each missing byte as 0xFF (so a value came out as -1) and carry on (#1856).
  • A VCF record that fails to encode no longer corrupts the next one. VCFWriter used to leave the columns it had written before the failure at the start of the next record's line (#1857).

📥 How to upgrade

Change the version from 5.0.0 to 5.0.1. Nothing else is needed.

Full Changelog: 5.0.0...5.0.1