def proba_to_quality_sanger(pe):
"""A value between 0 and 93
:param pe: the probability of error.
:return: Q is the quality score.
- a high probability of error (0.99) gives Q=0
- q low proba of errors (0.05) gives Q = 13
- q low proba of errors (0.01) gives Q = 20
"""
if pe > 1:
pe = 1
if pe < 1e-90:
pe = 1e-90
Qs = -10 * log10(pe)
if Qs > 93:
Qs = 93
return Qs
评论列表
文章目录