예제 #1
0
파일: POIM.py 프로젝트: mcvidomi/ML2Motif
 def plot_poim(self, mode, Q, tofile):
     '''
     plot poim to file
     :param mode:
         1 - plot poim
         2 - plot diffPOIM
     :param Q: poim
     :param tofile: path to file
     :return: -
     '''
     if mode == 1:
         view.figurepoimsimple(Q, tofile, False)
     if mode == 2:
         view.figuremaxPOIM(Q, tofile, False)
예제 #2
0
파일: POIM.py 프로젝트: mcvidomi/ML2Motif
 def plot_poim(self, tofile):
     view.figurepoimsimple(self.gPOIM, tofile, show=False)
예제 #3
0
if __name__ == '__main__':
    
    
    #datapath = "/Users/marinavidovic/Documents/work/POIM/data/human_acceptor_splice_data.txt"
    #savepath = "/Users/marinavidovic/Documents/work/POIM/data/human_acceptor_splice_data_xy.pkl"
    #poimfolder = "/Users/marinavidovic/Documents/work/POIM/data/human_acceptor_splice_data"
    #poimpath = "/Users/marinavidovic/Documents/work/POIM/data/human_acceptor_splice_data"+str(lines)+".pkl"
    #path = "/Users/marinavidovic/Documents/work/POIM/experiments/" + experiment_name + "/"
    
    #read data
    experiment_name = "toy1"
    if not os.path.exists(experiment_name):
        os.makedirs(experiment_name)
    poimpath=experiment_name+"poim.pkl"
    tally=30
    positives=25
    sequenceno=100
    mutation_prob=0.0
    motif="ATTTT"
    mu=13
    x,y = makePOIM.gensequences(tally,positives,sequenceno,mutation_prob,motif,mu)
    
    #compute POIM
    poim_degree = 6
    kernel_degree = 8
    print "start poim computation"
    poims = makePOIM.computePOIM(x,y,poim_degree,kernel_degree,poimpath)
    Q2 = poims[0][1]
    #view.test()
    view.figurepoimsimple(Q2, "poim_pic", 0)