-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathburst.py
43 lines (27 loc) · 886 Bytes
/
burst.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
#!/usr/bin/env python
import sys
import re
import glob
import subprocess as sp
import os
digits = re.compile(r'(\d+)')
def tokenize(filename):
return tuple(int(token) if match else token
for token, match in
((fragment, digits.search(fragment))
for fragment in digits.split(filename)))
folder = sys.argv[1]
filelist=glob.glob(folder)
filelist.sort(key=tokenize)
outfolder=sys.argv[2]
outsuffix=sys.argv[3]
db=sys.argv[4]
db1=db+".edx"
db2=db+".acx"
pid=sys.argv[5]
threads=sys.argv[6]
print filelist
for i in filelist:
print i
outputfile=outfolder+"/"+i.split("/")[-1].split(".")[0]+outsuffix+".burst"
p1= sp.Popen("/stornext/HPCScratch/home/allnutt.t/bin/BURST/bin/burst_linux_DB15 -r %s -a %s -q %s -o %s -fr -w -m FORAGE -i %s -t %s -n --skipambig" %(db1,db2,i,outputfile,pid,threads), shell=True).wait()