#!/bin/bash
while IFS= read -r line; do
    assem=${line}_df38
    # test if directory exists
    if [ -d ./$assem ]; then
        echo "$assem directory exists"
    else 
        mkdir -p $assem;
    fi
    # test if directory is empty
    if [ -z "$( ls -A ./$assem)" ]; then
        echo "Building $line";
        (cd ./$assem; /bin/time python3 /home/agray/projects/Dfam-umbrella/Server/buildFullRegion.py -a $line -r 3.8 &> "/usr/local/Dfam-warehouse/releases/annotations_exports/_logs/${assem}_reg_build.log";)
    else
      echo "$assem has files in it"
    fi

done < "$1"