That will depend completely on the tool. For open source tools, see the source code/papers. For base calls you might have to ask Illumina (unless they've published the algorithm)
It's important to know that log() is log10() here (I realize that this is ambiguous), so it's just simple algebra.
Yeah, it's unfortunate that log() is such a common function but also has an ambiguous base. Sometimes it's log10() (like here), other times it's ln(), still other times it's log2() (I'm sure some group uses yet another base).
As simple as this problem is there are plenty of gotchas. First the Phred Score was originally defined to quantify error, not correctness. In other words a high Phred score means there is a low chance of error. Widely used programs (not to be named) Phred scale probabilities of something being correct. Ask yourself when un-Phreding: Is the probability representing correctness or incorrectness.
The probability of the base or genotype being incorrectly called can be computed by:
10^(-phredScore/10)
Drop a couple of these lines into [R] to prove the correctness of the equation:
10^(-10/10) = 0.1 probability of error
10^(-20/10) = 0.01 probability of error
10^(-50/10) = 1e-5 probability of error
Summing it up watch our for Phred Scaled Likelihoods. They are not Phred Scores.
for (2), I did arrived to that
-Q/10= logP
, then I cannot make it as what isshould be
e^Q/10=P
Yeah, it's unfortunate that
log()
is such a common function but also has an ambiguous base. Sometimes it'slog10()
(like here), other times it'sln()
, still other times it'slog2()
(I'm sure some group uses yet another base).Also, you forgot a negative sign