-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-entrypoint.sh
executable file
·103 lines (88 loc) · 2.12 KB
/
docker-entrypoint.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
99
100
101
102
103
#!/bin/bash
function help {
cat <<EOF
Syntax: [options] [ANALYSIS]
networks :: Predict tissue-specific functional networks
predictions :: Predict disease genes
Options:
-h | --help :: this help
EOF
}
function predictions() {
echo "Running disease prediction"
if [[ "$#" -ne 2 ]]
then
echo "need disease, tissue network arguments"
exit 1
fi
base_dir="/dq/data"
dpred_dir="$base_dir/disease_prediction"
disease_gold="$dpred_dir/gold_standard/${1}.label"
tissue_net="$base_dir/network_integration/networks/${2}.dab"
if [ ! -f $disease_gold ]
then
echo "disease not found"
exit 1
fi
if [ ! -f $tissue_net ]
then
echo "tissue network not found"
exit 1
fi
python /dq/src/predict_disease_genes.py -b /dq/bin/SVMperfer \
-t $tissue_net \
-l $disease_gold \
-o /dq/outputs/${1}tmp \
-p $dpred_dir/params/${1}.param
mv /dq/outputs/${1}tmp* /dq/outputs/${1}.predictions
}
function networks() {
echo "Running network integration"
if [[ "$#" -ne 1 ]]
then
echo "need tissue name"
exit 1
fi
echo $1
base_dir="/dq/data/network_integration/"
python /dq/src/network_integration.py -L -N -P \
-B /dq/bin \
-a $base_dir/gold_standard/global.dab \
-A $1 \
-z $base_dir/zeros.txt \
-e $base_dir/genes.txt \
-r $base_dir/alphas.txt \
-d $base_dir/data_compendium/ \
-s $base_dir/gold_standard/ \
-W $base_dir/weights/ \
-F -n \
-w /dq/outputs/
python /dq/src/network_integration.py --reprior 0.5 \
-B /dq/bin \
-a $base_dir/gold_standard/global.dab \
-A $1 \
-d $base_dir/data_compendium/ \
-s $base_dir/gold_standard/ \
-W $base_dir/weights/ \
-w /dq/outputs/
chmod 777 -R outputs/all
}
while [ "$1" ]
do case "$1" in
-h | --help | help ) help
exit
;;
* ) break
;;
esac
done
if [ -z $1 ] || [ $1 = 'networks' ]
then
set -- "${@:2}"
networks $@
fi
if [ -z $1 ] || [ $1 = 'predictions' ]
then
set -- "${@:2}"
predictions $@
fi