#!/bin/bash  

# define resource
resource=oma

# add the time stamped folder
cd /data/projects/glygen/downloads/$resource/

new_dir=$(date +%Y_%m_%d)
mkdir $new_dir

# download files to new folder
cd /data/projects/glygen/downloads/$resource/$new_dir

python3 /data/projects/glygen/downloads/download_scripts/oma_species.py
wget https://omabrowser.org/All/oma-uniprot.txt.gz  #oma to uniprot mapping file

# unzip the mapping file 
gunzip oma-uniprot.txt.gz

# update new folder permissions
chmod -R 775 /data/shared/glygen/downloads/$resource/$new_dir/

# create symbolic link
cd /data/projects/glygen/downloads/$resource/
rm current
ln -s $new_dir current

echo "Download Complete"
