You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The (now merged) Samtools PR samtools/samtools#516 copies over the aux_type2size and skip_aux functions as it has a mechanism of iterating through the tag list.
Something akin to these functions ought to be public, although perhaps not these explicit interfaces. I think a more iterator focused approach would work. Eg in a similar fashion to kstring initialisations:
bam_tag_iter_t it = BAM_TAG_ITER_INITIALIZE; // or bam_tag_iter_initialize(&it) if we want it opaque.
uint8_t *tag;
while ((tag = bam_aux_next(b, &it))) {
// do stuff
}
The tag initialise function just nulls the contents. The bam_aux_next function skips to the next tag, or identifies the first one if the pointer hasn't been set. The BAM data end pointer from skip_aux can be internalised into the data type and hidden from the user. Alternatively we just expose skip_aux as it is now and have an aux_end function to avoid the mess of grubbing through b->data + b->l_data internals.
aux_type2size may be useful as-is, as we already have search functions so being able to return how big it is would be helpful for more than this case. However it could be renamed perhaps - maybe bam_aux_size.
The text was updated successfully, but these errors were encountered:
(Put here simply so we don't forget it.)
The (now merged) Samtools PR samtools/samtools#516 copies over the
aux_type2size
andskip_aux
functions as it has a mechanism of iterating through the tag list.Something akin to these functions ought to be public, although perhaps not these explicit interfaces. I think a more iterator focused approach would work. Eg in a similar fashion to kstring initialisations:
The tag initialise function just nulls the contents. The
bam_aux_next
function skips to the next tag, or identifies the first one if the pointer hasn't been set. The BAM data end pointer fromskip_aux
can be internalised into the data type and hidden from the user. Alternatively we just exposeskip_aux
as it is now and have anaux_end
function to avoid the mess of grubbing throughb->data + b->l_data
internals.aux_type2size
may be useful as-is, as we already have search functions so being able to return how big it is would be helpful for more than this case. However it could be renamed perhaps - maybebam_aux_size
.The text was updated successfully, but these errors were encountered: