I am planning to calculate my own phred quality score. I need to share some idea how to calculate my own Q Score. I have sequences like below:

```
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
....
TAAAAAAAAAAAAAAAAAAAAA
```

So in the above case, There is A: 100 and T: 1 on the first base. So that position has 99% accuracy. And from 99% accuracy how I can get Q = 20?

What if there is A: 151 and 1 T on the first position? Anyone knows how to calculate that score from the percentage?

Thank you