samtools / htsjdk

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

CRAM: Refactor Encodings and Codecs #1224

Closed jmthibault79 closed 5 years ago

jmthibault79 commented 5 years ago

Description

Encodings and Codecs are better encapsulated: final fields and constructors over random-access

removed AbstractBitCodec and BitCodec

"Experimental" codecs are those which are not supported by htslib and will be removed from the spec

moved compression classes out of the encoding package to prevent confusion

rethrowing IOExceptions as RuntimeExceptions

rearranged the Huffman classes to better isolate the base codecs

Checklist

codecov-io commented 5 years ago

Codecov Report

Merging #1224 into master will increase coverage by 0.538%. The diff coverage is 61.043%.

@@               Coverage Diff               @@
##              master     #1224       +/-   ##
===============================================
+ Coverage     69.031%   69.568%   +0.538%     
- Complexity      8077      8120       +43     
===============================================
  Files            539       543        +4     
  Lines          32616     32650       +34     
  Branches        5510      5538       +28     
===============================================
+ Hits           22515     22714      +199     
+ Misses          7894      7729      -165     
  Partials        2207      2207
Impacted Files Coverage Δ Complexity Δ
...ava/htsjdk/samtools/cram/compression/rans/E04.java 96.875% <ø> (ø) 5 <0> (?)
...a/htsjdk/samtools/cram/compression/rans/Utils.java 57.895% <ø> (ø) 3 <0> (?)
...va/htsjdk/samtools/cram/compression/rans/RANS.java 79.545% <ø> (ø) 17 <0> (?)
...oding/reader/MultiRefSliceAlignmentSpanReader.java 100% <ø> (ø) 6 <0> (ø) :arrow_down:
...ain/java/htsjdk/samtools/cram/structure/Block.java 62.5% <ø> (ø) 30 <0> (ø) :arrow_down:
...s/cram/encoding/core/huffmanUtils/HuffmanCode.java 90.244% <ø> (ø) 7 <0> (?)
...ava/htsjdk/samtools/cram/compression/rans/E14.java 88.679% <ø> (ø) 3 <0> (?)
...s/cram/encoding/core/huffmanUtils/HuffmanLeaf.java 100% <ø> (ø) 1 <0> (?)
...samtools/cram/compression/ExternalCompression.java 88.571% <ø> (ø) 11 <0> (?)
...jdk/samtools/cram/structure/CompressionHeader.java 90.506% <ø> (-0.119%) 27 <0> (-1)
... and 97 more
jmthibault79 commented 5 years ago

Based on spec conversations, I made some changes to this PR: