Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for BAM index bins #1024

Closed
wants to merge 3 commits into from

Conversation

valeriuo
Copy link
Contributor

@valeriuo valeriuo commented Nov 7, 2017

  1. Fixes a bug: ArrayIndexOutOfBoundsException would be thrown if levelNumber is too big.
  2. Fixes a bug: the level size for the last level was miscalculated. It should be 32768 (2^15).
  3. Removes the unused method regionToBins, whose code was already implemented in the class GenomicIndexUtil.

Description

Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?

Checklist

  • Code compiles correctly
  • New tests covering changes and new functionality
  • All tests passing
  • Extended the README / documentation, if necessary
  • Is not backward compatible (breaks binary or source compatibility)

…elNumber is too big.

2. Fixes a bug: the level size for the last level was miscalculated. It should be 32768 (2^15).
3. Removes the unused method regionToBins, whose code was already implemented in the class GenomicIndexUtil.
@codecov-io
Copy link

codecov-io commented Nov 7, 2017

Codecov Report

Merging #1024 into master will increase coverage by 0.046%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##              master     #1024       +/-   ##
===============================================
+ Coverage     66.072%   66.118%   +0.046%     
- Complexity      7554      7562        +8     
===============================================
  Files            532       532               
  Lines          32227     32241       +14     
  Branches        5491      5489        -2     
===============================================
+ Hits           21293     21317       +24     
+ Misses          8778      8768       -10     
  Partials        2156      2156
Impacted Files Coverage Δ Complexity Δ
...ain/java/htsjdk/samtools/AbstractBAMFileIndex.java 81.882% <100%> (+4.855%) 43 <5> (+4) ⬆️
...a/htsjdk/samtools/cram/encoding/rans/Decoding.java 82.143% <0%> (-3.571%) 11% <0%> (-1%)
src/main/java/htsjdk/samtools/util/IOUtil.java 34.783% <0%> (-0.58%) 71% <0%> (ø)
...rc/main/java/htsjdk/samtools/SamFileValidator.java 85.082% <0%> (-0.025%) 79% <0%> (+2%)
...n/java/htsjdk/samtools/util/SortingCollection.java 70% <0%> (ø) 14% <0%> (ø) ⬇️
...a/htsjdk/samtools/util/AbstractProgressLogger.java 40.385% <0%> (+0.385%) 6% <0%> (ø) ⬇️
...va/htsjdk/samtools/util/AbstractLocusIterator.java 66.292% <0%> (+0.974%) 61% <0%> (+2%) ⬆️
...ain/java/htsjdk/samtools/SAMFileWriterFactory.java 64.138% <0%> (+1.379%) 47% <0%> (ø) ⬇️
...samtools/util/AsyncBlockCompressedInputStream.java 76% <0%> (+4%) 13% <0%> (+1%) ⬆️

@lbergelson
Copy link
Member

@droazen Could you take a look at this?

@lbergelson lbergelson requested a review from droazen November 8, 2017 20:53
@valeriuo
Copy link
Contributor Author

Hi! Can I get a review on this PR?

@Test
public static void testGetLevelSizeOK() {

final AbstractBAMFileIndex afi = new DiskBasedBAMFileIndex(new File(BAM_FILE.getPath() + ".bai"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary getPath() here and below, you can just write new File(BAM_FILE + ".bai"). Although BAM_FILE is otherwise unused here so you could just define BAI_FILE instead.

@valeriuo valeriuo mentioned this pull request Nov 22, 2017
5 tasks
@valeriuo valeriuo closed this Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants