I am aligning paired-end reads using bwa-mem2 mem
with default parameters. The sequences have low diversity, so often only one of the mates maps uniquely. This is fine, as long as the mates are in proper pair. However, this is sometimes not the case.
Below I have IGV information for 2 paired-end reads. As you can see, read length, CIGAR, clipping, mate is mapped, insert size, pair orientation, MC, NM, AS, XS is all the same for the left/right alignment between these paired end reads.
But the first left alignment has flag 161 and MAPQ=0, while the second left alignment has flag 163 and MAPQ=40 (and first right alignment has flag 81, mapq=60, second right alignment has flag 83, mapq=60). What can cause the first paired-end mates to not be properly paired, when all the above mentioned metrics are the same?
Paired end read 1 (with flag 161):
Paired end read 2 (with flag 163):
well , they're not: as you said, the first read as a MAPQ=0
Maybe my question then should have been why the second case has MAPQ=40, as AS==XS so it is also multimapping and should also have been set to 0.
Are the sequences for the reads on the left identical? I would check that first.
If the sequences are not identical then that is probably the explanation for the difference.
If the sequences are identical then the discrepancy might be caused by the heuristics in the alignment used by bwa. Which is also interesting.