-
Notifications
You must be signed in to change notification settings - Fork 459
Open
Description
htslib appears to lack a clean index querying API. The internals of hts_idx_t are not publicly visible, and there does not appear to be a function to find the appropriate position to seek to.
Looking at the source code, the following options appear to be available:
- create a
hts_itr_tusinghts_itr_query()then peek in hts_itr_t.curr_off. Unfortunately,This structure should be considered opaque by end users. - Wrap a call to
hts_itr_multi_next()with no-op callbacks except forhts_seek_functhat saves the seek position that can then be returned. The mock htsFile cannot be NULL nor a cram file due to the internalcram_set_optioncalls withinhts_itr_multi_next.
Other approaches such as handing over ownership of your FP to BGZF, call hts_itr_next() with a no-op hts_readrec_func, letting the seek happen and querying fp->seeked mihgt work but I want to handle the compression myself.
What is the 'correct' way of querying an index for the file position(s)/internals(s) that a genomic interval/position(s) could be located in?
Metadata
Metadata
Assignees
Labels
No labels