-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.sh
83 lines (81 loc) · 2.2 KB
/
update.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
#!/bin/sh
# launch with: bash update.sh &> ../update.log &
date
echo "Starting Update ..."
if test -f "../send_message.py"; then
python ../send_message.py -m "Starting Update ..."
fi
cd ..
if test -f "wget-log"; then
rm wget-log
fi
wget https://github.com/LucaMenestrina/COVIDrugNet/archive/refs/heads/master.zip
unzip master.zip
rm master.zip
if test -d "COVIDrugNet.bkp"; then
rm -r COVIDrugNet.bkp
fi
mv COVIDrugNet COVIDrugNet.bkp
mv COVIDrugNet-master COVIDrugNet
if test -f ".env"; then
cp .env COVIDrugNet/.env
else
if ! test $DISGENET_EMAIL && $DISGENET_PASSWORD; then
echo "No DisGeNET credentials found, gene-disease associations will not be collected"
fi
fi
cd COVIDrugNet
start_time="$(date -u +%s)"
python collector.py
end_time="$(date -u +%s)"
elapsed="$(($end_time-$start_time))"
date
echo "Database Updated"
if test -f "../send_message.py"; then
python ../send_message.py -m "Database Updated"
fi
if [ "$elapsed" -gt 3600 ] # it is assumed that if the database takes less than 1 hour to update there are not any new drugs/proteins
then
echo "Download time: $elapsed"
echo "Starting Analyses ..."
if test -f "../send_message.py"; then
python ../send_message.py -m "Starting Analyses ..."
fi
cd analysis
python fitting.py
date
echo "Fitting Analysis Done"
if test -f "../../send_message.py"; then
python ../../send_message.py -m "Fitting Analysis Done"
fi
python robustness.py
date
echo "Robustness Analysis Done"
if test -f "../../send_message.py"; then
python ../../send_message.py -m "Robustness Analysis Done"
fi
cd ..
cd data/imgs/figures
echo "Updating Figures"
if test -f "../../../../send_message.py"; then
python ../../../../send_message.py -m "Updating Figures"
fi
python first_level_atc_distribution.py
python draw_ER_comparison.py
date
echo "Figures Updated"
if test -f "../../../../send_message.py"; then
python ../../../../send_message.py -m "Figures Updated"
fi
cd ../../../
else
echo "Nothing to Update"
if test -f "../send_message.py"; then
python ../send_message.py -m "Nothing to Update"
fi
fi
date
echo "Update Completed!"
if test -f "../send_message.py"; then
python ../send_message.py -m "Update Completed!"
fi