#!/bin/csh
#$ -S /bin/csh
#$ -cwd
#$ -o /nfs/exa/work/stefan/Anions/MWT-300-400/carboxylates/Filt-Enamine-300-400-xaadh/Filt-Enamine-300-400-xaadh-xan/CovFilt-Enamine-300-400-xaadh-xan-pattern.out
#$ -e /nfs/exa/work/stefan/Anions/MWT-300-400/carboxylates/Filt-Enamine-300-400-xaadh/Filt-Enamine-300-400-xaadh-xan/CovFilt-Enamine-300-400-xaadh-xan-pattern.err 
#$ -t 1-1
hostname
date
#cd /scratch
#mkdir -p stefan/CovFilt-Enamine-300-400-xaadh-xan-pattern
#cd stefan/CovFilt-Enamine-300-400-xaadh-xan-pattern
#cp /nfs/exa/work/stefan/Anions/MWT-300-400/carboxylates/Filt-Enamine-300-400-xaadh/Filt-Enamine-300-400-xaadh-xan/Filt-Enamine-300-400-xaadh-xan.smi .
set name=Filt-Enamine-300-400-xaadh-xan
set num1=`cat Filt-Enamine-300-400-xaadh-xan.smi | wc -l`
cp /mnt/nfs/exa/work/stefan/Anions/MWT-300-400/carboxylates/carboxylates.txt . 
source /nfs/soft/www/apps/zinc15/envs/production/env.csh
setenv molgrep /nfs/soft/tools/apps/molgrep/molgrep.py
$molgrep smarts -f carboxylates.txt Filt-Enamine-300-400-xaadh-xan.smi filter-Filt-Enamine-300-400-xaadh-xan.smi
rm carboxylates.txt
set num2=`cat filter-Filt-Enamine-300-400-xaadh-xan.smi | wc -l`
echo "${name}	$num1	$num2 in 50000"
date
#cp -r filter-Filt-Enamine-300-400-xaadh-xan.smi /nfs/exa/work/stefan/Anions/MWT-300-400/carboxylates/Filt-Enamine-300-400-xaadh/Filt-Enamine-300-400-xaadh-xan/.
#cd ../
#rm -rf CovFilt-Enamine-300-400-xaadh-xan-pattern
