def calculate_EE(qual):
    """
    Calculate expect error given a Sanger-encoded qual string.
    """
    phreds = [ord(c)-33 for c in qual]
    probs = [10**(-float(Q)/10) for Q in phreds]
    EE = sum(probs)
    return(EE)