Do you know how can I filter out supplementary alignments from a bam file? I was reviewing http://broadinstitute.github.io/picard/explain-flags.html and I am aware that the flag for this kind of alignments is "2048". However, depending on another features (ex: paired read, second in pair, etc), the flag can vary.
So, I am not sure about how can I filter out this kind of alignments.
Hi all, I am very new to all these tools and analysis. I have a bam file and I wanted to eliminate the supplementary alignments but when I use samtools view -b -F 2145 tow.sort.bam > new.bam
The new.bam file is empty. However, if what I do is to select them in a new file:
samtools view -b -f 2145 tow.sort.bam > filtered.bam
The filtered.bam file contains the supplementary aligments I saw in flagstat.
Anyone can tell me why the first command is not working as I expect?
-F 2145will remove all paired-end reads. You want