blachlylab / dhtslib

D bindings and OOP wrappers for htslib
MIT License
7 stars 1 forks source link

hts_open doesn't create BGZF pointer in htsFile #5

Closed charlesgregory closed 5 years ago

charlesgregory commented 5 years ago

After using hts_open in SAMFile, the htsFile.fp.bgzf pointer is not set. Below are some work-arounds for dealing with this as the BGZF pointer is required for using the query iterator functions hts_itr_queryi and hts_itr_querys. Another side effect (or a potentially separate issue) is that the BGZF created in the workaround below cannot be closed using bgzf_close without segfault.

https://github.com/blachlylab/dhtslib/blob/bab86a8286819623c1d8ab5bcab674f6e514eb27/source/dhtslib/sam.d#L288-L310

jblachly commented 5 years ago

Fixed in 9258e3a92a95146030d6d074b85b809a28ff17b3