update to use htsFile in synced reader (for #1862) #1868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1862
Added bcf_sr_add_hreader to add already opened htsfile to reader list.
The file added can be set to close along with reader or closed explicitly by user. Aux data in synced_bcf_reader.c is updated to hold the file closure status.
When the file name is passed along with file pointer, the index can be anywhere and mentioned using ##idx## method with file name. As file name in htsfile does not maintain index information, the index has to be present in default location with default name (i.e. same location as file with file name.) when no filename is passed to this method.
bcf_sr_add_reader updated to open the file and passes the file to bcf_sr_add_hreader with autoclose enabled.
Test utility and script updated to use the new interface. With -u argument, it uses the new interface where file pointer is made and used.