-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add methods sam_hdr_get and sam_hdr_set #1052
Conversation
Rebased. To be reviewed and squashed. |
This field was only recently introduced for use (internally) with iterators on SAM files (4c2c536). Does letting user code change it interfere with that? Why can't it be cleared via What is the reason for now providing this functionality to user code? |
It is needed by samtools/samtools#1211, as a more efficient way of carrying around a reference to a header struct for a dynamic number of output files.
It doesn't in this case. It is only used here on the write side, whereas the iterator functionality implies
I didn't see a use case for this, but can be amended. |
It is desired by the samtools PR, but as this adds general API functionality to HTSlib it needs to be considered on its own merits. The legacy samtools API embedded its header struct in its This is a big step towards reverting that (the next step will be for |
It could be argued that the samtools API was better. I've never entirely seen the point of having to pass in the header to Maybe a better interface would be a |
The
samFile::bam_header
can be used by applications to carry around a pointer to the header structure, corresponding to that particular file. These methods allow for access to this internal pointer.