-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_svm_toy.py
48 lines (41 loc) · 1.33 KB
/
run_svm_toy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'''
Created on 08.06.2015
@author: marinavidovic
'''
import os
import pdb
import utils_svm
import pickle
import numpy as np
import copy
import genQ
import makePOIM
import view
import matplotlib
matplotlib.use('Agg')
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)