Entering edit mode
9 months ago
jkim ▴ 140
I saw this post filter reads in BAM having a tag / but I couldn't figure out how to filter out the reads having hidden tags (SA) - like the screen shot below. Is there an easy way of removing only those reads?
samtools view -e/-d but it didn't work for me. Any advice would be appreciated.
You can combine with this
--unmaptoo which changes it to marking the unselected reads as unmapped instead of removing them. This an be a useful way of retaining all data in the BAM so you can still use it for going back to the original FASTQ if required (potentially saving on disk space for a second copy).
Thanks! I will try it too.