walaj / SeqLib

C++ htslib/bwa-mem/fermi interface for interrogating sequence data
http://bioinformatics.oxfordjournals.org/content/early/2016/12/21/bioinformatics.btw741.full.pdf+html
Other
133 stars 36 forks source link

Add different modes to BamWriter.Open #26

Open 1dayac opened 6 years ago

1dayac commented 6 years ago

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

walaj commented 6 years ago

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?

1dayac commented 6 years ago

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 notifications@github.com:

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 .