def identity_avg(aseq, bseq):
    """Compute absolute identity (# matching sites) between sequence strings."""
    match = identity_abs(aseq, bseq)
    alen = len(aseq.replace('-', '').replace('.', ''))
    blen = len(bseq.replace('-', '').replace('.', ''))
    avg_len = 0.5 * (alen + blen)
    return match / avg_len