-
Notifications
You must be signed in to change notification settings - Fork 8
/
EcTest.sh
executable file
·98 lines (81 loc) · 2.35 KB
/
EcTest.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
usage(){
cat << EOF
$0 - run Enzyme Classification (EC) benchmark
Compute benchmark results for the Enzyme Classification benchmark for a single
orthology method. You can specify the reference dataset and similarity measure
using the below options
Options
-m similarity measure. Can be one of 'avg Sim', 'max Sim', 'avg Info',
'max Info' or 'avg Schlicker'
-o output directory, where raw data file will be stored.
Raw data is a file that contains the evaluated orthologs and their
similarity score.
-a assessment filename, where the assessemnt json stub will be stored
-c community_id, Name or OEB permanent ID for the benchmarking community
Positional arguments:
project_db Path to project database
title Name of the project
refset Path to refset data
EOF
}
measure="avg Schlicker"
out_dir=""
assessment_fname="EC.json"
community_id="QfO"
while getopts "a:c:m:o:h" opt ; do
case $opt in
h) usage
exit 0
;;
m) measure="$OPTARG"
if [[ $measure != "avg Sim" && $measure != "max Sim" && $measure != "avg Info" && \
$measure != "max Info" && $measure != "avg Schlicker" ]] ; then
echo "invalid similarity measure" >&2
exit 1
fi
;;
o) out_dir="$OPTARG"
;;
a) assessment_fname="$OPTARG"
;;
c) community_id="$OPTARG"
;;
\?) echo "invalid option" >&2
usage
exit 1
;;
:) echo "option -$OPTARG requires an argument" >&2
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
echo $@
project_db="$1"
if [ ! -f $project_db ] ; then
echo "invalid path to project_database" >&2
exit 1
fi
title="$2"
refset="$3"
benchmark_dir="$(dirname $0)"
if [[ -z "$out_dir" ]]; then
echo "output is a mandatory argument"
exit 1
fi
if [ ! -d "$out_dir" ] ; then mkdir -p "$out_dir"; echo "created $out_dir"; fi
darwin -E << EOF
project_db := '$project_db':
measure := '$measure':
title := '$title':
refset_path := '$refset':
out_dir := '$out_dir':
assessment_fname := '$assessment_fname':
community_id := '$community_id':
ReadProgram('$benchmark_dir/lib/darwinit');
ReadProgram('$benchmark_dir/EcTest.drw');
done;
EOF
exit $?