-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0--MakePipeline.py
executable file
·55 lines (43 loc) · 1.1 KB
/
0--MakePipeline.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 getopt,sys
import scriptMaker
def usage():
print "Outputs all pipeline scripts given a configuration file."
print "Usage: 0--MakePipeline.py [-h --help] [-c --conf <configuration file>]"
try:
opts, args = getopt.getopt(sys.argv[1:], "hc:", ["help", "conf"])
except getopt.GetoptError:
usage()
sys.exit(2)
## Default settings
conf=None
####################
for o, a in opts:
if o in ("-h", "--help"):
usage()
sys.exit()
if o in ("-c", "--conf"):
conf=a
#####################
if conf:
print "Starting..."
try:
f=open(conf,"rU")
except IOError, e:
print "File not found: [", conf, "]"
sys.exit(2)
param={}
for i in f.readlines():
tmp=i.strip().split("\t")
param[tmp[0]]=tmp[1]
f.close()
scriptMaker.FastQC(param)
scriptMaker.MappingAndPreProcessing(param)
scriptMaker.QualityControl(param)
scriptMaker.HaplotypeCaller(param)
scriptMaker.GenotypingAndRecalibrating(param)
print "Done."
####################
else:
usage()
sys.exit()