samtools / htsjdk

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

Improve TextualBAMIndexWriter text output. #1432

Closed cmnbroad closed 4 years ago

cmnbroad commented 4 years ago

This adds a couple of utility methods to GenomicIndexUtil for use with TextualBAMIndexWriter for easier index debugging. The new output includes the bin level for a given bin, and the genomic territory covered by that bin (along with a minor formatting tweak to put line breaks in the right spot).

Previous output:

Reference 0 has n_bin= 2
  Ref 0 bin 5291 has n_chunk= 1     Chunk: 1837:0-1837:1 start: 72d0000 end: 72d0001
  Ref 0 bin 37450 has n_chunk= 2     Chunk:  start: 68d end: 68d
     Chunk:  start: 0 end: 0

with this:

Reference 0 has n_bin= 2
  Ref 0 bin 5291 (bin=5291, level=5, first bin=4681, bin size=16,384 bin range=(9,994,240-10,010,624)) has n_chunk= 1
     Chunk: 1837:0-1837:1 start: 72d0000 end: 72d0001
  Ref 0 bin 37450 has n_chunk= 2
     Chunk:  start: 68d end: 68d
     Chunk:  start: 0 end: 0
cmnbroad commented 4 years ago

@lbergelson Back to you if you want another look before I resolve conflicts.

codecov-io commented 4 years ago

Codecov Report

Merging #1432 into master will increase coverage by 0.02%. The diff coverage is 90.909%.

@@              Coverage Diff               @@
##              master     #1432      +/-   ##
==============================================
+ Coverage     68.343%   68.364%   +0.02%     
- Complexity      8489      8494       +5     
==============================================
  Files            583       583              
  Lines          34391     34410      +19     
  Branches        5729      5729              
==============================================
+ Hits           23504     23524      +20     
+ Misses          8668      8666       -2     
- Partials        2219      2220       +1
Impacted Files Coverage Δ Complexity Δ
.../samtools/util/BlockCompressedFilePointerUtil.java 86.667% <100%> (+1.481%) 20 <1> (+1) :arrow_up:
...in/java/htsjdk/samtools/TextualBAMIndexWriter.java 67.089% <100%> (+0.422%) 12 <0> (ø) :arrow_down:
...rc/main/java/htsjdk/samtools/GenomicIndexUtil.java 87.097% <86.667%> (-0.137%) 24 <3> (+3)
...samtools/util/AsyncBlockCompressedInputStream.java 76% <0%> (+4%) 13% <0%> (+1%) :arrow_up: