Calculate the amino acid frequencies in a sequence set.

def aa_frequencies(seq, gap_chars='-.'):
    """Calculate the amino acid frequencies in a sequence set."""
    aa_counts = Counter(seq)
    # Don't count gaps
    for gap_char in gap_chars:
        if gap_char in aa_counts:
            del aa_counts[gap_char]
    # Reduce to frequencies
    scale = 1.0 / sum(aa_counts.values())
    return dict((aa, cnt * scale) for aa, cnt in aa_counts.iteritems())