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

def make_entropy_col_consensus(bg_freqs):
    """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
    """
    def col_consensus(col):
        col_freqs = sequtils.aa_frequencies(col)
        entroper = entropy_func(col_freqs, bg_freqs)
        return max(col_freqs.keys(), key=entroper)
    return col_consensus