コード例 #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)