-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsgeqsub.py
63 lines (61 loc) · 3.85 KB
/
sgeqsub.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
58
59
60
61
def generate_rmsubs(BATCH_COUNT, QUEUE, PREFIX, LIBRARY, SPECIES, XSMALL, NOLOW, SPEED, PROC):
RMPATH = '/lustre/work/daray/software/RepeatMasker/'
for BATCH in range(BATCH_COUNT):
BATCHNUMBER = '{:03}'.format(BATCH)
QSUBFILENAME = 'batch-'BATCH'.sh'
if QUEUE = 'hrothgar':
PROJECT = 'communitycluster'
KUE = 'Chewie'
elif QUEUE = 'quanah':
PROJECT = 'quanah'
KUE = 'omni'
else:
sys.exit('Please choose hrothgar or quanah as the queue to use.')
with open("RMPart/" + BATCH + "/" + QSUBFILENAME, 'w') as THISFILE:
THISFILE.write('#!/bin/sh' + '\n')
THISFILE.write('#$ -V' + '\n')
THISFILE.write('#$ -cwd' + '\n')
THISFILE.write('#$ -S /bin/bash' + '\n')
THISFILE.write('#$ -N ' + PREFIX + '-' + BATCH + '\n')
THISFILE.write('#$ -o $JOB_NAME.o$JOB_ID' + '\n')
THISFILE.write('#$ -e $JOB_NAME.e$JOB_ID' + '\n')
THISFILE.write('#$ -q ' + KUE + '\n')
THISFILE.write('#$ -pe sm ' + str(PROC) + '\n')
THISFILE.write('#$ -P ' + PROJECT + '\n')
THISFILE.write('\n')
THISFILE.write('cd RMPart/' + BATCH)
FLAGS = [LIBRARY, SPECIES, XSMALL, NOLOW, SPEED]
#Default RepeatMasker if no flags are raised.
if not FLAGS:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
#All other possibilities.
else LIBRARY:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and NOLOW:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -nolow -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and NOLOW:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -nolow -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and NOLOW and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -nolow -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and NOLOW and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -nolow -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and SPEED:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -s -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and SPEED:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -s -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and SPEED and XSMALL :
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -s -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and SPEED and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -s -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and SPEED and NOLOW :
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -s -nolow -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and SPEED and NOLOW:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -s -nolow -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else LIBRARY and SPEED and NOLOW and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -lib ' + LIBRARY + ' -s -nolow -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'
else SPECIES and SPEED and NOLOW and XSMALL:
THISFILE.write(RMPATH + 'RepeatMasker -species ' + SPECIES + ' -s -nolow -xsmall -a -inv -gff -s -pa ' + PROC + '. ' + BATCH + '.fa >& run.log\n'