Skip to content

Commit

Permalink
allow to skip db update on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiykol committed Feb 7, 2024
1 parent d2fed7a commit 74f842e
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,28 @@ if ! test -f "$file"; then
# create docker-entrypoint.lock to see that data was already imported
# used for development, otherwise db reset after each docker-start at system start
# to reload db on docker restart, simply delete the file
sh import-data.sh

echo "building graphs"
python3 manage.py make_graphs

echo "building minimum spanning trees"
python3 manage.py make_min_span_trees
# python manage.py make_shortest_distance_files
# python manage.py populate_db --add_data shortest_distances

# add polyphen2 data for SNP lookup
mkdir data/poly phen2/
wget https://cloud.uni-hamburg.de/s/4dDob7rNisAjd2Q/download/polyphen-2.2.2-whess-2011_12.sqlite.bz2 -O data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
# unpack the bz2 sqlite database and delete compressed file
bzip2 -d data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
chmod 777 data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite

if [ -z "$DB_UPDATE_ON_START" ] || [ "$DB_UPDATE_ON_START" = "0" ]
then
echo "Update on startup disabled!"
else
sh import-data.sh

echo "building graphs"
python3 manage.py make_graphs

echo "building minimum spanning trees"
python3 manage.py make_min_span_trees
# python manage.py make_shortest_distance_files
# python manage.py populate_db --add_data shortest_distances

# add polyphen2 data for SNP lookup
mkdir data/poly phen2/
wget https://cloud.uni-hamburg.de/s/4dDob7rNisAjd2Q/download/polyphen-2.2.2-whess-2011_12.sqlite.bz2 -O data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
# unpack the bz2 sqlite database and delete compressed file
bzip2 -d data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
chmod 777 data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite
fi

touch $file
fi
Expand Down

0 comments on commit 74f842e

Please sign in to comment.