import math


def get_entropy(a_freq, c_freq, g_freq, t_freq):
    """ 
    Get entropy for a set of nucleotide frequencies. 
    """
    if a_freq == 0:
        a_ent = 0
    else:
        a_ent = a_freq * math.log(a_freq, 2)

    if c_freq == 0:
        c_ent = 0
    else:
        c_ent = c_freq * math.log(c_freq, 2)

    if g_freq == 0:
        g_ent = 0
    else:
        g_ent = g_freq * math.log(g_freq, 2)

    if t_freq == 0:
        t_ent = 0
    else:
        t_ent = t_freq * math.log(t_freq, 2)

    return -1 * (a_ent + c_ent + g_ent + t_ent)