-
Notifications
You must be signed in to change notification settings - Fork 88
Allow index-filename to differ from bam_filename + .bai default #124
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
Conversation
Somethings wrong with the CI - those tests passed locally :(. |
Indeed, I have the same problem. I have no idea what is wrong though. I am about to leave for a week of vacation. I won't be able to fix this until I am back. Until then, any insights would be greatly appreciated! |
The first error that occurs is a simple one: it complains that (the most recent) |
This does remove the The testing errors appeared first in: And it was still working with: I have compared the two setups in quite some detail, and can't spot any differences in versions of anything used. Not in the Travis worker version, not in the rust installation(s), not in the apt sources, not in the crates that cargo downloads. And the only code that changed in between is the addition of No clue, sorry... |
Did a lot of digging, and finally found the problem: The pointer action required to interact with the htslib API was not working as expected. All the failing file reads seem to have been collateral damage from that. A fix is in #125, so once this is merged, you can rebase against the new master and tests should work as expected, again. |
@TyberiusPrime: the test failures should now be fixed by #125 and #126, so you should be able to rebase onto the new master HEAD to get your branch to pass the tests. |
Here we go. |
Pull Request Test Coverage Report for Build 597
💛 - Coveralls |
Just a couple of thoughts in regards to code style. The function I think it might be easier to read if you do an early return if either of the paths doesnt exist at the top of the function: if !path.as_ref().exists() || !index.as_ref().exists() {
return IndexedReaderPathError::InvalidPath
}
... I would then consider pulling out the strings or returning an error when a None value is encountered: let p = path.as_ref().to_str().ok_or(IndexedReaderPathError::InvalidPath)?;
let idx_p = ... The There should be no nesting then and hopefully easier to follow. |
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 and what he said: #124 (comment)
;)
You're of course right. I just stuck to the initial style but have changed it accordingly. |
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.
With the changes that @thomasmulvaney suggested implemented and the tests passing, this looks good to go, for me. Thanks for contribution and the patience with the master branch!
rust-bio#124 was missing the Changelog entry. Sorry about that.
htslib allows the user to specify an index name that is not 'bam_file.bam.bai'.
This exposes it on IndexReader as ::from_path_and_index.
(I'm very new to rust - any and all feedback is appreciated).