How Mapq In Bwa Is Calculated?
1
5
Entering edit mode
12.4 years ago
Bioscientist ★ 1.7k

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

bwa quality • 19k views
ADD COMMENT
8
Entering edit mode
12.4 years ago
Benm ▴ 710

They come from the same formula.

In MAQ:

If the mapping quality of a read alignment is $mQ, the probability $me that the alignment is wrong can be calculated with: $me = 10 ** (-$mQ / 10.0);

BWA is in SAM format, you can find the MAPQ definition in SAMtools's manuals, The manual is described:

MAPQ: MAPping Quality. It equals -10 log10 {Prfmapping position is wrong}, rounded to the nearest integer. A value 255 indicates that the mapping quality is not available.

--The SAM Format Specication (v1.4-r962)

So, here $mQ=MAPQ, $me={Prfmapping position is wrong}, the example mentioned with from the MAQ documentation:

Given 1000, for example, read alignments with mapping quality being 30, one of them will be wrong in average.

So, if the error probabilities are the same, then you will get the same MAPQ of MAQ and BWA. The error probability both scaled in the Phred is the mapping quality.

ADD COMMENT

Login before adding your answer.

Traffic: 2998 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6