annotate saint_wrapper.py @ 19:2a7cd3429767 draft

Uploaded
author bornea
date Tue, 17 Nov 2015 13:09:02 -0500
parents 333b4c487fc3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
1 import os
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
2 import sys
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
3
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
4 inter_file = sys.argv[1]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
5 prey_file = sys.argv[2]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
6 bait_file = sys.argv[3]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
7 num_of_rep = sys.argv[4]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
8 vc_bool = sys.argv[5]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
9 vc_num = sys.argv[6]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
10 go_bool = sys.argv[7]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
11 go_file = sys.argv[8]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
12 output_file = sys.argv[9]
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
13
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
14 def default_run(inter_file1,prey_file1,bait_file1,output_file1,num_of_rep1):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
15 cmd = r"SAINTexpress-spc " + r"-R" + str(num_of_rep1) + " " + str(inter_file1) + " " + str(prey_file1) + " " + str(bait_file1)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
16 os.system(cmd)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
17 open('list.txt')
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
18 os.rename('list.txt', str(output_file1))
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
19
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
20 def with_L(inter_file1,prey_file1,bait_file1,output_file1,vc_num1,num_of_rep1):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
21 cmd = r"SAINTexpress-spc "+ r"-R" + str(num_of_rep1) + " " + r"-L" + str(vc_num1) + " " + str(inter_file1) + " " + str(prey_file1) + " " + str(bait_file1)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
22 os.system(cmd)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
23 open('list.txt')
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
24 os.rename('list.txt', str(output_file1))
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
25
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
26 def external_data_no_L(inter_file1,prey_file1,bait_file1,output_file1,go_file1,num_of_rep1):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
27 cmd = r"SAINTexpress-spc "+ r"-R" + str(num_of_rep1) + " " + str(inter_file1) + " " + str(prey_file1) + " " + str(bait_file1) + " " + str(go_file1)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
28 os.system(cmd)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
29 open('list.txt')
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
30 os.rename('list.txt', str(output_file1))
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
31
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
32 def external_data_with_L(inter_file1,prey_file1,bait_file1,output_file1,go_file1,num_of_rep1,vc_num1):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
33 cmd = r"SAINTexpress-spc "+ r"-R" + str(num_of_rep1) + " " + r"-L" + str(vc_num1) + " " + str(inter_file1) + " " + str(prey_file1) + " " + str(bait_file1) + " " + str(go_file1)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
34 os.system(cmd)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
35 open('list.txt')
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
36 os.rename('list.txt', str(output_file1))
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
37
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
38 if (vc_bool == "true"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
39 if (go_bool == "false"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
40 with_L(inter_file, prey_file, bait_file, output_file, vc_num, num_of_rep)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
41 elif (go_bool == "true"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
42 external_data_with_L(inter_file, prey_file, bait_file, output_file, go_file, num_of_rep, vc_num)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
43 elif (vc_bool == "false"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
44 if (go_bool == "false"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
45 default_run(inter_file, prey_file, bait_file, output_file, num_of_rep)
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
46 elif (go_bool == "true"):
333b4c487fc3 Uploaded
bornea
parents:
diff changeset
47 external_data_no_L(inter_file, prey_file, bait_file, output_file, go_file, num_of_rep)