def phredqual_to_prob(phredqual):
    """
    Turns a phred quality into an error probability

    >>> '%.2f' % phredqual_to_prob(20)
    '0.01'

    """

    assert isinstance(phredqual, int)
    #assert phredqual >= 0, ("Phred-quality must be >= 0, but is %s" % phredqual)
    # also works for phredqual=0
    return 10**(-phredqual/10.0)