#$ -S /bin/csh
#$ -cwd
#$ -q all.q
#$ -o /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/logs/stdout_xaaaaba
#$ -e /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/logs/stderr_xaaaaba

# source enviorment. 
source ~stefan/.cshrc_dbgen_corina
source /nfs/soft/jchem/jchem-19.15/env.csh
echo /nfs/soft/corina/current:/nfs/soft/python/envs/complete/python-2.7.7/bin:/nfs/soft/ccp4/7.0/ccp4-7.0/etc:/nfs/soft/ccp4/7.0/ccp4-7.0/bin:/mnt/nfs/soft/schrodinger/2019-3:/mnt/nfs/soft/schrodinger/2019-3/utilities:/nfs/soft/openeye/openeye-201505/bin:/nfs/soft/pgi/v12_10/linux86-64/12.10/bin:/nfs/home/tbalius/zzz.svn/dockenv/trunk/etc:/nfs/home/tbalius/zzz.svn/dockenv/trunk/scripts:/nfs/home/tbalius/zzz.svn/dockenv/trunk/devtools:/nfs/home/tbalius/zzz.svn/dockenv/trunk/mudtools:/nfs/home/tbalius/zzz.svn/dockenv/trunk/bin/Linux:/nfs/home/tbalius/zzz.svn/dockenv/trunk/private:/nfs/soft/cactvs:/usr/share/gridengine/bin/lx26-amd64:/nfs/soft/corina/current:/mnt/nfs/soft/python/envs/complete/python-2.7.7/bin:/nfs/soft/python/envs/complete/python-2.7.7/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/nfs/soft/jchem/jchem-19.15/bin:/nfs/home/stefan/bin:/nfs/soft/jchem/jchem-19.15/bin:/mnt/nfs/soft/schrodinger/2019-3/thirdparty/desmond_to_trj:/nfs/software/plop:/nfs/soft/jchem/jchem-19.15/bin:/nfs/soft/openbabel/openbabel-2.3.2/bin:/nfs/soft/jchem/jchem-19.15/bin
hostname
date

set SCRATCH_DIR = /scratch
if ! (-d $SCRATCH_DIR ) then
    SCRATCH_DIR=/scratch
endif
set username = stefan

set TASK_DIR = "$SCRATCH_DIR/${username}/$JOB_ID"
echo $TASK_DIR

mkdir -p ${TASK_DIR}
cd ${TASK_DIR}
pwd

cp /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/xaaaaba .

# note that the pining script's inputs should not be in quotes ('' or "").
/nfs/home/tbalius/zzz.github/DOCK/common/on-one-core - /nfs/home/rstein/zzz.github/DOCK/ligand/generate/build_database_ligand.sh -H 7.4 xaaaaba --no-db --no-mol2 --no-solvation --single --save-table

cd /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M
mkdir /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/xaaaaba_build

echo copying
ls -l ${TASK_DIR}/finished/*/*.db2.gz
ls -l ${TASK_DIR}/finished/*/*.db.gz 

# copy finshed directory
mv ${TASK_DIR}/finished/*db2.gz /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/xaaaaba_build/.
mv ${TASK_DIR}/finished/*.xls /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/xaaaaba_build/.
rm -r ${TASK_DIR}

mv xaaaaba /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/Each-pattern/BUILD/pattern1/All-check1-5M-8M/xaaaaba_build/.

which cxcalc

