SeqLib icon indicating copy to clipboard operation
SeqLib copied to clipboard

Add different modes to BamWriter.Open

Open 1dayac opened this issue 6 years ago • 2 comments

Hello, Jeremiah! I use SeqLib and bxtools in my research really extensively, thank you a lot:) Is it possible to add "append" mode for BamWriter.Open function? I faced a problem when this is an only fast solution requires opening bam-files multiple times.

Thanks, Dima

1dayac avatar Aug 23 '18 01:08 1dayac

Thanks! Could you describe more what you mean by append? BamWriter is read-only for BAMs. Is there an append functionality in htslib you are thinking of?

walaj avatar Aug 26 '18 23:08 walaj

I have bam-file a.bam. Imagine that I want to add several records from the b.bam. Now I can't do something like writer.Open("a.bam", 'a') because BamWriter doesn't have an interface like this and just opening the file will overwrite it. Htslib has append functionality and I was able to change the code to do it in a forked version (you can take a look), but I'm just slightly familiar with the SeqLib code and it is definitely a workaround

Dima

вс, 26 авг. 2018 г. в 19:36, Jeremiah Wala [email protected]:

Thanks! Could you describe more what you mean by append? BamWriter is read-only for BAMs. Is there an append functionality in htslib you are thinking of?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/walaj/SeqLib/issues/26#issuecomment-416081292, or mute the thread https://github.com/notifications/unsubscribe-auth/AFT9rXlshx2QrXbLDeYAV5suzGMTwFGbks5uUzD5gaJpZM4WIpxB .

1dayac avatar Aug 27 '18 05:08 1dayac