#!/bin/bash

URL="https://yanglab.qd.sdu.edu.cn/Q-BioLiP/DATA/rec_pdb_part"
FILES=(
    "rec_pdb.part00"
    "rec_pdb.part01"
    "rec_pdb.part02"
    "rec_pdb.part03"
    "rec_pdb.part04"
    "rec_pdb.part05"
    "rec_pdb.part06"
)
 
DOWNLOAD_DIR="./downloads_rec_pdb"
mkdir -p $DOWNLOAD_DIR

for FILENAME in "${FILES[@]}"; do
    wget -O "$DOWNLOAD_DIR/$FILENAME" "$URL/$FILENAME" --no-check-certificate
    
    
    echo "Downloaded $FILENAME from $URL"
done

echo "All files downloaded."

cat $DOWNLOAD_DIR/rec_pdb.tar.gz.part* > $DOWNLOAD_DIR/rec_pdb.tar.gz
rm $DOWNLOAD_DIR/rec_pdb.tar.gz.part*

echo "All files merged."