Hello,
I'm a bit confused about the various SAM flags and how to selectively pull reads from a BAM file. I got a little carried away with samtools merge, and now I have a BAM file that includes paired as well as unpaired reads. Having both paired and unpaired reads in the same file is hindering some downstream analyses. I've figured out how to pull paired reads from the BAM file and put them into another BAM file, but does anyone know how I can pull unpaired reads from a BAM file and put them into a new BAM file? Or, alternatively, delete all paired reads from a BAM file, leaving only unpaired reads?
Thanks!
I'm a bit confused about the various SAM flags and how to selectively pull reads from a BAM file. I got a little carried away with samtools merge, and now I have a BAM file that includes paired as well as unpaired reads. Having both paired and unpaired reads in the same file is hindering some downstream analyses. I've figured out how to pull paired reads from the BAM file and put them into another BAM file, but does anyone know how I can pull unpaired reads from a BAM file and put them into a new BAM file? Or, alternatively, delete all paired reads from a BAM file, leaving only unpaired reads?
Thanks!
Comment