seqan3 icon indicating copy to clipboard operation
seqan3 copied to clipboard

appending records to a .bam

Open notestaff opened this issue 4 months ago • 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

notestaff avatar Mar 05 '24 17:03 notestaff

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.

smehringer avatar Mar 14 '24 11:03 smehringer