I just want to make sure my interpretation is correct: a MAPQ value of 255 indicates that the mapping quality is "not available" because it's a unique alignment, and a unique alignment means that it has a 0 probability of mapping to the wrong place, therefore: -10*log10(0 probability of error) = inf (ie. "not available")
Whether 255 actually means that an alignment is unique or "I don't want to bother returning a meaningful value" is aligner dependent. In practice, tools that produce MAPQ of 255 are doing so because they aren't calculating a real MAPQ and are just indicating, "this is a more likely alignment than anything else I could find". How much more likely this particular alignment is is purely a matter of the settings you use, which are pretty arbitrary. As a rule of thumb, assume that MAPQ values from splice-aware aligners lack any standard phred-scale interpretation.
The situation with -10*log10(0 probability of error) = inf does probably not occur in practice as there is no probability of exactly zero in genomics (or biology in general). There is always a probability that a certain region is a false-positive alignment. With a large MAPQ this is small but never 0.
I see, thanks! So when doing MAPQ filtering, would one generally filter out 255 since it could potentially be a really bad mapping?
Please read the documentation for whichever aligner you're using to determine if 255 is a good alignment or just a meaningless value.
What aligner are you using? I did not come across 255 in a while?
I have not encountered it myself but I know it's possible so was curious about it's mathematical interpretation.
The situation with
-10*log10(0 probability of error) = inf
does probably not occur in practice as there is no probability of exactly zero in genomics (or biology in general). There is always a probability that a certain region is a false-positive alignment. With a large MAPQ this is small but never 0.