def eval(repeats,size):
    result=[]
    for i in range(repeats):
        graphs=get_sequences_with_names(size=size, rand=(i+3)*10)
        zz=fit_sample(graphs)
        z=[b for a ,b in zz]
        cmpath='../%s.cm' % RFAM
        result+=rna.infernal_checker(z,cmfile=cmpath, cmsearchbinarypath='../toolsdata/cmsearch')
        
    a = numpy.array(result)
    mean = numpy.mean(a, axis=0)
    std = numpy.std(a, axis=0)
    
    print 'size:%d mean:%f std:%f' % (size,mean,std)
    return mean,std
Beispiel #2
0
def eval(repeats, size):
    result = []
    for i in range(repeats):
        graphs = get_sequences_with_names(size=size, rand=(i + 3) * 10)
        zz = fit_sample(graphs)
        z = [b for a, b in zz]
        cmpath = '../%s.cm' % RFAM
        result += rna.infernal_checker(
            z, cmfile=cmpath, cmsearchbinarypath='../toolsdata/cmsearch')

    a = numpy.array(result)
    mean = numpy.mean(a, axis=0)
    std = numpy.std(a, axis=0)

    print 'size:%d mean:%f std:%f' % (size, mean, std)
    return mean, std
def evaluate(repeats, size, fitsample, RFAM,inputdict,debug):
    means = []
    stds = []
    for i in range(repeats):
        if debug: print 'start rep'
        sequences,void = utils.get_seq_tups(RFAM+'.fa',size,1)
        zz = fitsample(sequences,inputdict)
        # print zz[:3]
        zz=[b for a ,b in zz]
        result = rna.infernal_checker(zz, cmfile='../toolsdata/%s.cm' % RFAM,
                                      cmsearchbinarypath='../toolsdata/cmsearch')
        a = np.array(result)
        means.append(np.mean(a, axis=0))
        stds.append(np.std(a, axis=0))
    means.sort()
    stds.sort()
    #print (size, means, stds)
    return means[repeats / 2] * 100, stds[repeats / 2] * 100
def evaluate(repeats, size, fitsample):
    print 'eval:',
    means = []
    stds = []
    for i in range(repeats):
        sequences = get_sequences_with_names(size=size, rand=10)
        zz = fitsample(sequences)
        # print zz[:3]
        # z=[b for a ,b in zz]
        result = rna.infernal_checker(
            zz,
            cmfile='../toolsdata/%s.cm' % RFAM,
            cmsearchbinarypath='../toolsdata/cmsearch')

        a = np.array(result)
        means.append(np.mean(a, axis=0))
        stds.append(np.std(a, axis=0))

    means.sort()
    stds.sort()
    print(size, means, stds)
    return [means[repeats / 2] * 100, stds[repeats / 2] * 100]