Entering edit mode
9.4 years ago
le2336
▴
70
Hello,
I have a BAM file of paired-end reads that have been quality filtered. I would like to salvage those reads whose mates have been filtered out and continue using them in my analysis (I would also appreciate any input on whether this is acceptable practice). Since some of my downstream tools give me errors if they see only one mate of a paired end read, is there a way to fix the SAM flags (to 0 or 16, for example) so that these reads are treated as single-end reads?
Thank you!
This works perfectly. Thank you so much!
Just for information, you should be able to use pipes to avoid intermediate files and have a final bam file coordinate sorted and mate fixed:
I would like to salvage those reads whose mates have been filtered out and continue using them in my analysis (I would also appreciate any input on whether this is acceptable practice)
That's what I also do. When I filter for, say, mapping quality I don't mind if one mate fails and the other passes.
This is useful to know. Thank you!