-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathroast.py
executable file
·38 lines (33 loc) · 1.17 KB
/
roast.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
#!/usr/bin/env python
import argparse
from qsub import *
# arguments
parser = argparse.ArgumentParser()
parser.add_argument('-maf_dir', help='Maf directory', required=True)
parser.add_argument('-ref', help='Reference species name', required=True)
parser.add_argument('-tree', help='Species tree',
default="'((Greattit Groundtit) (Flycatcher Zebrafinch))'")
parser.add_argument('-out', help='Output path and filename', required=True)
parser.add_argument('-evolgen', help='If specified will run on lab queue', default=False, action='store_true')
args = parser.parse_args()
# variables
maf_dir = args.maf_dir
mafs = maf_dir + '*.maf'
ref_name = args.ref
out_maf = args.out
out_dir = out_maf[:out_maf.rfind('/')+1]
if not os.path.isdir(out_dir):
os.mkdir(out_dir)
temp_dir = out_dir + 'roast_temp'
if not os.path.isdir(temp_dir):
os.mkdir(temp_dir)
tree = args.tree
evolgen = args.evolgen
# construct and submit command line
roast = ('roast + '
'T=' + temp_dir + ' '
'E=' + ref_name + ' ' +
tree + ' ' +
mafs + ' ' +
out_maf)
q_sub(['cd ' + maf_dir, roast], out=out_dir + 'roast', t=168, jid='roast.sh', evolgen=evolgen)