https://github.com/ekg/freebayes
Raw File
Tip revision: 60850dc518fc453622cbb40ad6dd9f67644ed859 authored by Pjotr Prins on 16 December 2020, 10:18:06 UTC
Disable cmake, but leave the file with a message
Tip revision: 60850dc
phred.py
import math

M_LN10 = math.log(10)
M_LOG10E = math.log10(math.e)

def phred2ln(qual):
    return M_LN10 * qual * -.1

def ln2phred(prob):
    return -10 * M_LOG10E * prob

def phred2float(qual):
    return math.pow(10, qual * -.1)

def float2phred(prob):
    return min(-10 * math.log10(prob), 99)

back to top