-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.sh
executable file
·72 lines (49 loc) · 1.41 KB
/
test.sh
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
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
function runDiff(){
if [[ ! -e $2 ]]
then
echo "FAILED Test :: $3 output file $2 not generated"
exit 1
fi
diff $1 $2 > d.txt 2>err.txt
if [[ -s err.txt ]] || [[ -s d.txt ]]
then
echo "FAILED Test :: $3 output file $2 does not match reference"
exit 1
fi
}
function checkError(){
if [[ -s $2 ]]
then
echo "FAILED Test :: $1 exited with errors"
exit 1
fi
}
cd testFiles
# clean up prior tests
if [[ -e err.txt ]]
then
rm err.txt
fi
# clean up prior tests
if [[ -e d.txt ]]
then
rm d.txt
fi
tar -xf referencefiles.tgz
../ringmapper.py --fasta ref_addWTfull.fa --untreated ref_untreated.mut ref_modified.mut test_ring-corrs.txt --mincount 50 > test_ring.out 2>err.txt
checkError ringmapper err.txt
#runDiff ref_ring-corrs.txt test_ring-corrs.txt ringmapper
runDiff ref_ring-corrs.txt test_ring-corrs.txt_N1 ringmapper
runDiff ref_ring.out test_ring.out ringmapper
../pairmapper.py --profile ref_profile.txt --untreated ref_untreated.mut --mod ref_modified.mut --out test_pm --over --mincount 50 --secondary_react 0.5 --renorm > test_pm.out 2>err.txt
checkError pairmapper err.txt
#runDiff ref_pm.out test_pm.out pairmapper
runDiff ref_pm-allcorrs.txt test_pm-allcorrs.txt pairmapper
runDiff ref_pm-pairmap.txt test_pm-pairmap.txt pairmapper
runDiff ref_pm.dms test_pm.dms pairmapper
runDiff ref_pm.bp test_pm.bp pairmapper
echo 'All tests PASSED'
# clean up
rm ref_* err.txt d.txt
cd ../