-
Notifications
You must be signed in to change notification settings - Fork 83
[IO] Make seqan3::sam_file_header::program_info_t
easier to copy
#3137
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
Comments
seqan3::sam_file_header::program_info_t
easier to copyseqan3::sam_file_header::program_info_t
easier to copy
Here’s a suggestion:
|
Hi @tsnorri, thanks for reaching out and sorry for the delay. You are absolutely right. This copy should be way easier. Let me investigate a little and then get back to you. Thanks in advance for volunteering to help! This copy (for anyone following the thread): #include <seqan3/io/sam_file/all.hpp>
int main()
{
seqan3::sam_file_input in{"in.sam"};
seqan3::sam_file_output out{"out.sam"};
auto it = in.begin(); // cache first record which also reads the header
out.header().program_infos = in.header().program_infos; // error :(
} |
Hi @tsnorri, after a quick dive into the code, we agree with your suggestion. The tasks would be:
It would be great if you can tackle this. Otherwise just drop a note that you have no time and we can work on this. Best, |
Hi @smehringer and sorry about the delay! I finally had some time to fix the issue; the pull request above should have everything needed. Best, |
Actually scratch that. I just realised that the test I wrote did not actually test the intended functionality. I’ll re-refine it. |
- The purpose of the test is to check that copying headers works in a situation where ref_id_types of the source and the destination differ. - See seqan#3137.
I had noticed earlier but forgotten that the solution to this may not be the one that I first thought was the obvious one. If In any case, now |
- The purpose of the test is to check that copying headers works in a situation where ref_id_types of the source and the destination differ. - See seqan#3137.
- The purpose of the test is to check that copying headers works in a situation where ref_id_types of the source and the destination differ. - See seqan#3137.
* [MISC] Make seqan3::sam_file_header::program_info_t easier to copy See #3137
When processing alignments in such a way that both the input and the output are SAM/BAM files, one would typically like to append a
@PG
record to the SAM file headers and, to that end, copy the existing@PG
records. Currently this is not very easy under some circumstances assam_file_header::program_info_t
depends onsam_file_header
’s template parameterref_ids_type
(i.e. when the input and output files have a different type forref_ids_type
).Suggested solutions include:
program_info_t
not depend onref_ids_type
by e.g. moving it outsidesam_file_header
program_info_t
.(I’m not sure what would be the best approach but once one is chosen, I could volunteer to contribute a patch.)
The text was updated successfully, but these errors were encountered: