Lets say we have two reads A and B that are paired. Suppose A is uniquely mappable, but B is not uniquely mappable. B maps in two spots. One close to A (say 400 bp) and one far away (100000 bp). Does BWA use that information about proximity to uniquely map B? So mapq > 0 for B in this case.
So, I guess what I'm asking is: are there situations where A and B would have mapq=0 if they were treated as single-end reads, but they have mapq >0 when treated as paired-end, assuming all other things are equal?
The reason I am asking this question is I computed mappability for single-end reads and I noticed that some of my paired-end fragments end in places that shouldn't be uniquely mappable. I used the samtools option to remove reads that have mapq=0, so I think I should only have uniquely mapped reads.
I am not writing it as an answer because I am not sure about it but I think that BWA uses insert size information if it has to choose out of two alignments for one of the reads. First it aligns each read from a pair independently and stores the first few best matches. It does the same thing for the other read. Finally, depending on the insert sizes it tries to give you the best mapping.