I'm just curious about this. I searched a lot and see similar posts but seems the author doesn't give out detailed explanations in their manual, unless you're willing to read the source code. However I found their explaining from MAQ documentation:
http://maq.sourceforge.net/qual.shtml
The calculation of mapping qualities is simple, but this simple calculation considers all the factors below:
The repeat structure of the reference. Reads falling in repetitive regions usually get very low mapping quality.
The base quality of the read. Low quality means the observed read sequence is possibly wrong, and wrong sequence may lead to a wrong alignment.
The sensitivity of the alignment algorithm. The true hit is more likely to be missed by an algorithm with low sensitivity, which also causes mapping errors.
Paired end or not. Reads mapped in pairs are more likely to be correct.
This makes sense pretty much to me. I'm just wondering if BWA is also like this. Or any information is welcomed; maybe I've lose some key points.
thx