Entering edit mode
7 months ago
kmyers2
▴
90
I want to filter a SAM file for read pairs that align to the same strand. That is for R1 and R2, I want the alignment to be either both on the forward strand (FF) or both on the reverse strand (RR).
I used samtools view -F 0x2
to exclude any instance where the pairs align correctly (FR) but it looks like it's still including some FR reads with short read 1 lengths.
How can I filter a SAM file to only give me read pairs that align on the same strand, either both reads on the forward strand or both reads on the reverse strand?