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.
|
athos
left a comment
There was a problem hiding this comment.
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
athos
left a comment
There was a problem hiding this comment.
Thank you for updating! I will merge the changes 💪
Problem
cljam.io.vcf/read-variantsthrowsjava.lang.ClassCastExceptionfor bgzipped VCF files.Cause
#180 introduced switching of reader type between
java.io.BufferedReaderandbgzf4j.BGZFInputStreambut did not modify the existing code.Changes
Switch methods based on the type of reader instance.
Tests
lein check✅lein test :all✅lein cloverage✅