forked from cmhill-zz/assembly-testing
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_practical_tests.py
More file actions
executable file
·40 lines (36 loc) · 1.43 KB
/
run_practical_tests.py
File metadata and controls
executable file
·40 lines (36 loc) · 1.43 KB
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
#!/usr/bin/python
'''
Created on Dec 8, 2013
@author: kzampog
'''
import os, subprocess, glob, shutil
# import sys
if __name__ == '__main__':
os.chdir('practical_tests')
test_dirs = os.listdir('.')
test_dirs = [d for d in test_dirs if os.path.isdir(d)]
for d in test_dirs:
os.chdir('./' + d)
# Clean-up
shutil.rmtree('./out', ignore_errors=True)
for f in glob.glob('*.fq'):
os.remove(f)
# Run clipper
f = open('./clipper.args')
clipper_args = [l for l in f][0].strip()
f.close()
clipper_cmd = 'python ../../assembly-read-coverage/org/umd/assemblytest/readcoverage/clipper.py ' + clipper_args
clipper_stdout = open('clipper.stdout', 'w')
subprocess.call(clipper_cmd, stdout=clipper_stdout, shell=True)
clipper_stdout.close()
for f in glob.glob('./out/*.bt2') + glob.glob('./out/*.sam') + glob.glob('./out/*.stderr') + glob.glob('./out/*.stdout'):
os.remove(f)
# Run pythia
o_file = glob.glob('*.oracle')[0]
m_file = glob.glob('./out/*_OVER_BP.cov')[0]
# o_file = m_file
pythia_cmd = 'python ../../assembly-read-coverage-test/test/org/umd/assemblytest/readcoverage/pythia.py -m ' + m_file + ' -o ' + o_file
pythia_stdout = open('pythia.stdout', 'w')
subprocess.call(pythia_cmd, stdout=pythia_stdout, shell=True)
pythia_stdout.close()
os.chdir('..')