Skip to content

hts_itr_multi_t versus hts_itr_t #785

@jmarshall

Description

@jmarshall

The documentation in htslib/hts.h of the multi-iterator functionality is minimal, so it is unclear how to use it and when exactly to use it rather than the existing hts_itr_t.

What is the reason for there to be a separate hts_itr_multi_t and a separate bunch of API functions for dealing with it? Is the functionality of hts_itr_t now a subset of that of hts_itr_multi_t, or does each flavour have things that the other can't do? I note that samtools/sam_view.c appears to have separate code for one region and multiple regions, which does not seem ideal.

Is the reason for the new separate hts_itr_multi_t struct simply a question of binary ABI compatibility and not wanting to add fields to the existing hts_itr_t?

If so, as HTSlib is currently in an ABI-breaking mode, it would be possible to unify the two forms of iterator by renaming hts_itr_multi_t to hts_itr_t, making hts_itr_multi_t a typedef alias of it, and adjusting the API function implementations accordingly, adding hts_itr_multi_next()/etc compatibility wrappers in htslib/hts.h as necessary.

Is this on the roadmap for the ABI-breaking HTSlib release?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions