def make_entropy_col_consensus(bg_freqs):
def col_consensus(col):<EOL><INDENT>col_freqs = sequtils.aa_frequencies(col)<EOL>entroper = entropy_func(col_freqs, bg_freqs)<EOL>return max(col_freqs.keys(), key=entroper)<EOL><DEDENT>return col_consensus<EOL>
Consensus according to maximal relative entropy term (MET).

    For a given column i, choose the residue j with the highest relative
    entropy term::

        f_ij ln(f_ij/b_j)

    where f_ij = column aa frequency, b_j = background aa frequency.

    Source: http://bioinformatics.oxfordjournals.org/content/24/18/1987.long