about summary refs log tree commit diff
path: root/sourcecodes/run.sh
blob: 9b4e6e2deb33c0763e3811418cb7cee732cc96c3 (plain)
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
#!/bin/bash
#d=`dirname $0`
#ess=1
#DIR="$d/data/$1"
#DIR_1="$d/data/$1/"

# The C binaries (network_score, structure, k-best/...) are deployed
# with THIS script in the bnw package: <package>/sourcecodes/run.sh and
# <package>/var_lib_genenet_bnw/{network_score,structure,k-best,...}.
# They are self-locating via the script's own directory, so the flow
# works regardless of what /var/lib/genenet/bnw contains (an earlier
# version cd'ed there and depended on activation having copied the
# binaries -- on production that copy was incomplete and the run died
# with "./network_score: No such file or directory").
BNW_BIN_DIR="$(cd "$(dirname "$0")/.." && pwd)/var_lib_genenet_bnw"

cd /var/lib/genenet/bnw


mkdir -p /var/lib/genenet/bnw/$1

maxparent=$2
k=$3
THR=$4

"$BNW_BIN_DIR/network_score" /var/lib/genenet/bnw/$1continuous_input.txt /var/lib/genenet/bnw/$1ban.txt /var/lib/genenet/bnw/$1white.txt $maxparent /var/lib/genenet/bnw/$1

"$BNW_BIN_DIR/k-best/src/data2netk_poster.sh" /var/lib/genenet/bnw/$1continuous_input.txt /var/lib/genenet/bnw/$1 $k $maxparent

"$BNW_BIN_DIR/structure" /var/lib/genenet/bnw/$1continuous_input.txt /var/lib/genenet/bnw/$1/postProbEachEdge.txt /var/lib/genenet/bnw/$1structure_input_temp.txt /var/lib/genenet/bnw/$1structure_input.txt $THR

rm -r /var/lib/genenet/bnw/$1

if [ $k = 1 ]
then
    rm -r /var/lib/genenet/bnw/$1structure_input_temp.txt
fi