-
Notifications
You must be signed in to change notification settings - Fork 1
/
pipeline_layout.py
59 lines (41 loc) · 1.91 KB
/
pipeline_layout.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
55
56
57
#!/usr/bin/python
import sys
import os
import subprocess
bact_id = sys.argv[1]
path_to_hinge = sys.argv[2]
st_point = 0
if len(sys.argv) >= 4:
st_point = int(sys.argv[3])
base_path='data/'+bact_id+"/"
if len(sys.argv) >= 5:
base_path = sys.argv[4]
bact_name = bact_id
print bact_name
cmd = 'mkdir -p '+base_path+'log/'
os.system(cmd)
if st_point <= 1:
Reads_filter_cmd = "Reads_filter --db "+bact_name+" --las "+bact_name+".las -x "+bact_name+" --config "+path_to_hinge+"utils/nominal.ini"
print Reads_filter_cmd
subprocess.check_output(Reads_filter_cmd,cwd=base_path, shell=True)
if st_point <= 2:
hinging_cmd = "hinging --db "+bact_name+" --las "+bact_name+".las -x "+bact_name+" --config "+path_to_hinge+"utils/nominal.ini -o "+bact_name
print hinging_cmd
subprocess.check_output(hinging_cmd, cwd=base_path, shell=True)
if st_point <= 3:
json_flname = bact_id+'.mapping.4.json'
print json_flname
if os.path.isfile(base_path+json_flname) and os.stat(base_path+json_flname).st_size > 0:
pruning_cmd = "python "+path_to_hinge+"scripts/pruning_and_clipping.py "+bact_name+".edges.hinges "+bact_name+".hinge.list A "+ json_flname
else:
pruning_cmd = "python "+path_to_hinge+"scripts/pruning_and_clipping.py "+bact_name+".edges.hinges "+bact_name+".hinge.list A"
print pruning_cmd
subprocess.check_output(pruning_cmd, cwd=base_path, shell=True)
# json_flname = base_path+bact_id+'.mapping.5.json'
# print json_flname
# if os.path.isfile(json_flname) and os.stat(json_flname).st_size > 0:
# pruning_cmd = "python ~/AwesomeAssembler/scripts/pruning_and_clipping.py "+bact_name+".edges.hinges "+bact_name+".hinge.list E "+ json_flname
# else:
# pruning_cmd = "python ~/AwesomeAssembler/scripts/pruning_and_clipping.py "+bact_name+".edges.hinges "+bact_name+".hinge.list A"
# print pruning_cmd
# subprocess.check_output(pruning_cmd, cwd=base_path, shell=true)