I am trying to remove paired-end reads from a .SAM file where neither segment is mapped (i.e. having both 0x4 AND 0x8 set). When I try the command "samtools view -F 12" it appears to remove reads where either 0x4 OR 0x8 are set.
1) Am I correct in understanding the samtools help notes that -F performs a logical OR (and that -f performs a logical AND)?
2) If so, any thoughts on how to perform this aside from awk?
Have a look at this: http://www.novocraft.com/documentation/novoalign-2/novoalign-ngs-quick-start-tutorial/1040-2/
Serially filtering with -f 4 -F 264 and -f 8 -F 260, and then merge/sort -n did the trick. Thanks!
PS. Any way to flag this as an answer?
Copy and paste it into the answer field. I believe you can accept your own answer.
Hrmm... when I try and click the green check symbol, I get a "You may not vote on your own post"