-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_flu_subtrees_dataset_submit.py
54 lines (41 loc) · 1.48 KB
/
generate_flu_subtrees_dataset_submit.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
49
50
51
52
53
54
#!/usr/bin/env python
import subprocess as sp
import numpy as np
import os
CLUSTER = True
if __name__ =="__main__":
# root dir to store all results
work_dir = "./flu_H3N2/subtree_samples"
#sub-directories and file names
out_dir = os.path.join(work_dir, "dataset")
treetime_res_file = os.path.join(work_dir, "treetime_res.csv")
lsd_res_file = os.path.join(work_dir, "lsd_res.csv")
beast_res_file = os.path.join(work_dir, "beast_res.csv")
# LSD run configuration
lsd_parameters = ['-c', '-r', 'a', '-v']
n_iter = 10
N_leaves_array = [20, 50, 100, 200, 500, 750, 1000, 1250, 1500, 2000]
#N_leaves_array = [20]
#n_iter = 1
for N_leaves in N_leaves_array:
for iteration in np.arange(n_iter):
subtree_fname_suffix = str(iteration)
if CLUSTER:
call = ['qsub', '-cwd', '-b','y',
'-l', 'h_rt=23:59:0',
#'-o', './stdout.txt',
#'-e', './stderr.txt',
'-l', 'h_vmem=50G',
'./generate_flu_subtrees_dataset_run.py']
else:
call = ['./generate_flu_subtrees_dataset_run.py']
arguments = [
str(N_leaves),
out_dir,
subtree_fname_suffix,
treetime_res_file,
lsd_res_file,
beast_res_file
]
call.extend(arguments)
sp.call(call)