def aa_frequencies(seq, gap_chars='<STR_LIT>'):
aa_counts = Counter(seq)<EOL>for gap_char in gap_chars:<EOL><INDENT>if gap_char in aa_counts:<EOL><INDENT>del aa_counts[gap_char]<EOL><DEDENT><DEDENT>scale = <NUM_LIT:1.0> / sum(aa_counts.values())<EOL>return dict((aa, cnt * scale) for aa, cnt in aa_counts.iteritems())<EOL>
Calculate the amino acid frequencies in a sequence set.