-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support for reading alignments in specific region without CRAI index file #311
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #311 +/- ##
=======================================
Coverage 88.49% 88.50%
=======================================
Files 95 95
Lines 8173 8214 +41
Branches 506 506
=======================================
+ Hits 7233 7270 +37
- Misses 434 438 +4
Partials 506 506 ☔ View full report in Codecov by Sentry. |
(is (not (cram/indexed? cram-rdr'))) | ||
(are [?region ?count] (= ?count | ||
(count (cram/read-alignments cram-rdr ?region)) | ||
(count (cram/read-alignments cram-rdr' ?region))) |
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.
This test fails in my environment.
Maybe we need to reset the position of the mapped buffer before calling next read-alignments
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.
Thank you for pointing that out! Yeah, I'm just looking into it right now. I wasn't aware that I didn't run these tests on my local environment at all 😂
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.
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.
Thank you for fixing so quickly! LGTM 👍
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.
LGTM!
This PR allows the CRAM reader to read alignments from a specified region within a CRAM file without requiring an index file.
CRAM readers can instantly check if each container or slice overlaps with the specified region by examining their headers. This makes it much more efficient to read alignments by skipping non-overlapping containers or slices, rather than performing a linear scan of the entire CRAM file.
This PR also adds a new test file
medium_without_index.cram
, which is identical tomedium.cram
except that it does not come with its corresponding index file.