-
Notifications
You must be signed in to change notification settings - Fork 5
/
annapurna-tests.sh
executable file
·79 lines (58 loc) · 2.16 KB
/
annapurna-tests.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
72
73
74
75
76
77
78
79
#!/bin/bash
testFiles="tests/testFiles"
outputsDir="tests/outputs"
expectedOutputsDir="tests/outputs_expected"
source activate base
conda activate annapurna
function compare {
for f in $(find $expectedOutputs/ -name *.pdb -or -name *.csv -or -name *.phar -type f); do
newFile=$outDir/$(basename $f)
echo "Comparing $f with $newFile..."
if diff -q $f $newFile; then
echo -e "\e[92mOK\e[39m"
else
echo "\e[41mDifferent!\e[49m"
diff -y -W 175 $f $newFile
exit 1
fi
done
}
echo "AnnapuRNA testing program, version 0.991"
# ------------------------------------------------------------------------- #
method=kNN
echo "*** testing $method method"
outDir="$outputsDir/$method"
expectedOutputs="$expectedOutputsDir/$method"
mkdir -p $outDir
cp $testFiles/* $outDir/
./annapurna.py -r $outDir/1AJU.pdb -l $outDir/ARG.sdf -m kNN_modern -o $outDir/output -s --overwrite --groupby --merge
compare
# ------------------------------------------------------------------------- #
method=kNN_clust
echo "*** testing $method method"
outDir="$outputsDir/$method"
expectedOutputs="$expectedOutputsDir/$method"
mkdir -p $outDir
cp $testFiles/* $outDir/
./annapurna.py -r $outDir/1AJU.pdb -l $outDir/ARG.sdf -m kNN_modern -o $outDir/output -s --overwrite --groupby --merge --cluster_fraction 1.0 --cluster_cutoff 2.0 --clustering_method AD
compare
# ------------------------------------------------------------------------- #
# starting h2o.ai server (will kill it after this test script finishes)
./start_h2o.sh 1> /dev/null 2>&1 &
sleep 2s
# ------------------------------------------------------------------------- #
method=DL
echo "*** testing $method method"
outDir="$outputsDir/$method"
expectedOutputs="$expectedOutputsDir/$method"
mkdir -p $outDir
cp $testFiles/* $outDir/
./annapurna.py -r $outDir/1AJU.pdb -l $outDir/ARG.sdf -m DL_modern -o $outDir/output -s --overwrite --groupby --merge -p 30000
compare
# ------------------------------------------------------------------------- #
## killing the h2o server
if pgrep -f h2o &> /dev/null 2>&1; then
echo "h2o is running"
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
fi
#conda deactivate