def mode(vals): """Computes the mode of a list of numbers""" top = 0 topkey = None for key, val in util.histDict(vals).iteritems(): if val > top: top = val topkey = key return topkey
def gcContent(seq): hist = util.histDict(seq) total = hist["A"] + hist["C"] + hist["T"] + hist["G"] return (hist["C"] + hist["G"]) / float(total)