biopython/biopython — pull request #158 by sefakilic (2013-02-12 21:57:25+00:00)
Title: motif IC method fixed for non-uniform base distribution

The ic() method in Motif class computes information content as

\sum_b [2 + f(b) * lg(f(b))], where b is base. This formula computes information content for only one position in the motif. The current implementation assumes equal frequency of bases. I modified it to handle nonuniform base frequencies. For each position in the motif, the information content is computed as

\sum_b [-bg(b) * lg(bg(b)) + f(b) * lg(f(b))],

where bg(b) is the background frequency of base b, f(b) is the frequency of base b in that position of the motif.