예제 #1
0
파일: stats.py 프로젝트: gofflab/biolib
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
예제 #2
0
파일: stats.py 프로젝트: mdrasmus/spimap
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
예제 #3
0
파일: seqlib.py 프로젝트: sarab609/scraps
def gcContent(seq):
    hist = util.histDict(seq)
    total = hist["A"] + hist["C"] + hist["T"] + hist["G"]
    
    return (hist["C"] + hist["G"]) / float(total)
예제 #4
0
파일: seqlib.py 프로젝트: mdrasmus/spimap
def gcContent(seq):
    hist = util.histDict(seq)
    total = hist["A"] + hist["C"] + hist["T"] + hist["G"]

    return (hist["C"] + hist["G"]) / float(total)