def get_average_quality(qualities):
    """ Calculates average quality as Phred quality score
    
    Parameters
    ----------
    qualities: str
        Read qualities for a certain position
    
    Returns
    -------
    float
        Average quality
    """
    
    sum_quality = 0
    
    for q in qualities:
        sum_quality += 1 - 10 **-((ord(q) - 33) / 10.0)
        
    return sum_quality / len(qualities)