def aa_frequencies(aln, weights=None, gap_chars='<STR_LIT>'):
counts = aa_counts(aln, weights, gap_chars)<EOL>scale = <NUM_LIT:1.0> / sum(counts.values())<EOL>return dict((aa, cnt * scale) for aa, cnt in counts.iteritems())<EOL>
Frequency of each residue type in an alignment.

    Alignment is a MultipleSeqAlignment or iterable of SeqRecords.