From a359937ff24e7b198954711d42aff74b43a39012 Mon Sep 17 00:00:00 2001 From: nicolang1 <89869286+nicolang1@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:51:20 -0700 Subject: [PATCH] Update setup_databases.sh Edited the setup_databases.sh bash script to include a conditional check to determine if the target file already exists and is of non-zero size before attempting to download it. If the file exists and is not empty, the function echoes a message indicating that the file exists and skips the download process. --- setup_databases.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup_databases.sh b/setup_databases.sh index 7c4e8256..40c71a6f 100755 --- a/setup_databases.sh +++ b/setup_databases.sh @@ -26,6 +26,11 @@ fi downloadFile() { URL="$1" OUTPUT="$2" + # Check if the file already exists and is greater than 0 bytes (to avoid using partially downloaded files) + if [ -s "$OUTPUT" ]; then + echo "$OUTPUT exists and is not empty. Skipping download." + return 0 + fi set +e for i in $STRATEGY; do case "$i" in @@ -46,6 +51,7 @@ downloadFile() { fail "Could not download $URL to $OUTPUT" } + # Make MMseqs2 merge the databases to avoid spamming the folder with files export MMSEQS_FORCE_MERGE=1 @@ -98,4 +104,4 @@ if [ ! -f PDB_MMCIF_READY ]; then rsync -rlpt -v -z --delete --port=${PDB_PORT} ${PDB_SERVER}/data/structures/divided/mmCIF/ pdb/divided rsync -rlpt -v -z --delete --port=${PDB_PORT} ${PDB_SERVER}/data/structures/obsolete/mmCIF/ pdb/obsolete touch PDB_MMCIF_READY -fi \ No newline at end of file +fi