Entering edit mode
                    3.2 years ago
        jkim
        
    
        ▴
    
    220
    Hello,
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?
I tried 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.
Thank you!