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
Public method for CRAMIntervalIterator for overlapping intervals #1120
Public method for CRAMIntervalIterator for overlapping intervals #1120
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1120 +/- ##
===============================================
+ Coverage 66.052% 66.063% +0.011%
- Complexity 7685 7690 +5
===============================================
Files 538 538
Lines 32582 32584 +2
Branches 5529 5529
===============================================
+ Hits 21521 21526 +5
+ Misses 8909 8907 -2
+ Partials 2152 2151 -1
|
@@ -466,6 +466,32 @@ void enableFileSource(final SamReader reader, final boolean enabled) { | |||
iterator.setFileSource(enabled ? reader : null); | |||
} | |||
|
|||
/** | |||
* Prepare to iterate through SAMRecords that match the given intervals. |
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.
I think we should slightly narrow the description of what this method does. Since there is no validation that the provided chunks actually match (fully span) the territory covered by the intervals, it possible that the iterator doesn't return the full set of records matching the query. The records are constrained first by the chunks, then further constrained by the intervals.
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.
Good point. I've revised the wording to say "Prepare to iterate through SAMRecords that match the intersection of the given intervals and chunk boundaries."
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.
@tomwhite This looks good to me, it just needs a test for the new method.
…ping intervals, much like BAMFileReader#createIndexIterator.
5539d81
to
92b4342
Compare
Added a new test. |
@tomwhite Thank you. |
Description
Expose a method to create a CRAMIntervalIterator to get reads overlapping intervals, much like BAMFileReader#createIndexIterator. See #1112
Checklist