-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix CRAM container offset calculation #1167
Conversation
@cmnbroad, could you take a look when you get a chance please? I found the bug when I was testing large CRAM files with Disq. |
Codecov Report
@@ Coverage Diff @@
## master #1167 +/- ##
===============================================
+ Coverage 68.354% 68.372% +0.018%
- Complexity 8003 8005 +2
===============================================
Files 541 541
Lines 32674 32674
Branches 5531 5531
===============================================
+ Hits 22334 22340 +6
+ Misses 8115 8111 -4
+ Partials 2225 2223 -2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good, one request to tighten up the test.
// try to read a container from the offset to check it's correct | ||
try (SeekableFileStream seekableFileStream = new SeekableFileStream(cramFile)) { | ||
seekableFileStream.seek(headerOnlyContainer.offset); | ||
ContainerIO.readContainer(actualHeader.getVersion(), seekableFileStream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have the actual fullContainer that corresponds to the container you're reading from the stream, can you grab the return value from readContainer
and add a couple of equality asserts, maybe for alignmentStart, alignmentSpan, nofRecords, checksum, to verify the container is intact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
c4eb34d
to
55c7113
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. Needs @lbergelson to merge.
I hope I'm not stepping on any toes as I merge this.... |
Thanks @yfarjoun! |
Description
Fixes a bug from #1129, and added a test to check for the error (which fails without the fix).
Checklist