-
Notifications
You must be signed in to change notification settings - Fork 80
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
Accessing the index file from a bam::IndexedReader
#386
Comments
bam::IndexedReader
bam::IndexedReader
I looked into this a bit and the issue is that https://docs.rs/rust-htslib/latest/src/rust_htslib/bam/mod.rs.html#603 This means that accessing
I'm not familiar enough with the code to say whether 2) is a good idea but I quickly tested the first solution and your test case works. HTH, |
Yes, that helps indeed, thanks a lot! |
Looking at the htslib code I don't think that the |
The index is now accessible via |
I noticed that there was neither a non-unsafe way of accessing the actual index of an
IndexedReader
nor any "convenience" methods related to the index.Therefore, I've tried translating
samtools idxstats
using the htslib FFI interface, but stumbled upon the following issue:When accessing the index of an
IndexedReader
, the result is different than when loading the index manually throughsam_index_load
, as can be reproduced with the following code and the example BAM file and index in data.zip.I assume the two resulting stats being different is due to internal state, but I hoped it would at least error instead of silently always returning 0.
In any case, I think it would be good to have a safe way to retrieve information from the corresponding index (if there already is such a way, please let me know!)
The text was updated successfully, but these errors were encountered: