seqan/seqan3

appending records to a .bam

notestaff opened this issue · 1 comments

Is it possible with seqan3 to open a .bam file for writing in append mode, so that any records pushed to it get appended to the end, but the file header of the existing file is not touched (and a new file header is not mistakenly appended)? Thanks! @eseiler

Hi @notestaff,

interesting use case. No, currently this is not possible because a header is always written. There might be even more issues but this one I am sure of.

The problem with allow appending to a BAM file is that you have to extremely careful that the header information in the file-to-be-appended-to is the same as the one in memory of the program writing new records. Do you know if other tools allow this?

An obvious workaround (that you are probably already using) is to write individual files and then, as a postprocessing step, concatenate them all.