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
Improve index file search and load #870
Conversation
2f3a09d
to
8dc5121
Compare
Add method |
a7c5347
to
9ab11ad
Compare
Add internal method `idx_check` to verify the existence an index file along the alignment file.
Change the names of static index methods to reflect their use.
… file is remote. Also fix possible read past end of string in hopen_fd_fileuri()
Specifically range querying e.g. https://server/a/b/c.bam?param=val will now retrieve https://server/a/b/c.bam.bai?param=val and locally write this to c.bam.bai. Fixes samtools#784
Allow missing .tbi indexes to be silently ignored and use this capability in vcf_hdr_read() and synced_bcf_reader. This stops unexpected error messages about indexes from being printed out when reading vcf files that otherwise don't need one. To enable this, add new function hts_idx_load3() which takes a flags field that can control both downloading and printing of errors when the index file is missing. The specialisations sam_index_load3(), tbx_index_load3() and bcf_index_load3() are updated (or added) to take the same flags and interpret them in the same way so that the API is consistent over all formats. Make other adjustments needed to ensure the flags get passed around correctly. Update functions to use the new API. Add documentation. There is one difference in behaviour. This makes bcf_index_load() only look for a .csi suffix (previously it would try .tbi as well). .csi is the only index format generated for BCF files, and .tbi can't be used on them so the only way this would have worked would be if a .csi index had been deliberately saved with a .tbi suffix for some reason. (.bai might work, but it looks like HTSlib never made them for BCF and it certainly did not look for them).
I've added a commit to stop |
*.bam.csi
,*.csi
,*.bam.bai
,*bai
).Fixes samtools/samtools#1045