-
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
Fix a bug in reading bgzipped VCF files #184
Conversation
Codecov Report
@@ Coverage Diff @@
## master #184 +/- ##
==========================================
+ Coverage 86.47% 86.48% +<.01%
==========================================
Files 75 75
Lines 5924 5926 +2
Branches 497 497
==========================================
+ Hits 5123 5125 +2
Misses 304 304
Partials 497 497
Continue to review full report at Codecov.
|
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
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 for the fix! As for the production code change, LGTM👍
As for the test code, it would be nice to have a comment emphasizing that the call to vcf/read-variants
at L300 is important to verify this change, in order to prevent someone in the future from accidentally optimizing out that call from the test case. Actually, I didn't get how that test case would verify the change at the first glance 😅
Or alternatively, how about adding one more extra test case that looks like the following, and add a comment noting the above thing to it?
(with-open [v (vcf/reader test-vcf-complex-file)
g (vcf/reader test-vcf-complex-gz-file)]
(is (= (vcf/read-variants v)
(vcf/read-variants g))))
4ac7fe2
to
f4779bb
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.
Thank you for updating! I will merge the changes 💪
Problem
cljam.io.vcf/read-variants
throwsjava.lang.ClassCastException
for bgzipped VCF files.Cause
#180 introduced switching of reader type between
java.io.BufferedReader
andbgzf4j.BGZFInputStream
but did not modify the existing code.Changes
Switch methods based on the type of reader instance.
Tests
lein check
✅lein test :all
✅lein cloverage
✅