hts_itr_t reuse
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c
- Domain
- api, bioinformatics
Research direction
Start by reviewing the hts_itr_t lifecycle described here, including sam_itr_queryi() and sam_itr_next(), and the linked mailing-list discussion. Compare the proposed clone/fork and reset behaviors, then define the API and tests needed to show that repeated iteration over the same file and region is safe.
Written by the indexing model from the issue text.
Description
This is a follow-up to a question I asked in the samtools-devel mailinglist found here.
The problem in question arises if one wants to use an identical instance of a hts_itr_t struct multiple times (same file, same region). Since the struct gets changed during the iteration process (e.g. through sam_itr_next()) it would be ideal to have a sort of "source" iterator which stays in the iterators original state (e.g. created through sam_itr_queryi()), from which the iterator used within sam_itr_next() gets cloned so only the clone gets changed. Alternatively, if the iterator could be reset safely in between uses that would also solve the problem. At present, this seems to be not safe without destroying and recreating the struct.
The two scenarios I describe above could be handled with something like a hts_itr_clone()/hts_itr_fork() function, or with a hts_itr_reset() function as Rob proposes in his mailing list answer. Would an implementation of something like that be feasible?
Thanks!
- Dominant language
- C
- Stars
- 950
- Forks
- 475
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samtools/htslib
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
-
tabix performance Open
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100