-
Notifications
You must be signed in to change notification settings - Fork 56
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 always falling back to non-bgzip reader && allow .bgz extension #109
Conversation
I think all that's required to get the desired effect is to change the single line:
to
this will make it so the query file can be .bgz, and bix has been updated to support ".bgz" extension. |
Hi @brentp, the line you posted above has slightly different behaviour than my PR, it will try to open both .gz and .bgz extensions as block gzipped input. But my PR allows regular gzip to be opened as well. With the current code, if you try to open a |
the current code allows regular gzip to be opened. (that's why it sets I still think that all that's needed is the line I posted above. If I misunderstand, then a test will help to clarify. |
} | ||
qrdr = nil |
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.
Without an else clause here, when bgzip reader succeeds OR fails, qrdr is unconditionally being set to nil, thus always falls back to non-bgzip reader (xopen)
@brentp I have identified that the bgzip reader is never being used in the current code. I have provided a brand new fix above that is basically your suggested change plus a couple of else clauses. |
great! thank you for noticing and fixing this. I'll make a new release soon. |
Previously, files with .gz extension were assumed to be bgzip files.
Now,
.gz
is assumed gzip and.bgz
is assumed bgzip.I think it makes more sense this way, and hope the author agrees.
EDIT: This is not an adequate assumption, but I discovered that bgzip reader was never being used and is fixed below.