示例#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)