#!/bin/csh -f 
echo "you must edit this file to use it"
exit
#
# step 1. get the file that maps vendor ID codes to ZINC ID. 
# wget  http://files.docking.org/catalogs/1/bitterdb/bitterdb.info.txt.gz  
# the tab-separated columns are:  
# A. vendor ID
# B. ZINC ID
# C. InChIKey (for cross referencing)
# D. Annotations (e.g. fda, in-man, biogeneic, etc.)
#
# step 2. 
#
# decide on lead-like or frag-like and get the ?? files
# wget -e robots=off -r -l1 --no-parent  "http://files.docking.org/catalogs/1/bitterdb/frag-like/"
# mv files.docking.org/catalogs/1/bitterdb/frag-like/?? . 
# rm -rf files.docking.org
#
# step 3. script to download 3D models from the ZINC15 website
# decide on db2 db sdf mol2 pdbqt etc  here we have mol2
# decide on ref mid high low default is ref mid
#
foreach i ([ABCDE][ABCDEFG]) 
	foreach j (ref mid)
		cut -f 3,11 $i | awk '{if (/ref/) print $1}' > ${i}-${j}
		sed -e 's/^/http:\/\/files.docking.org\/protomers\//' ${i}-$j | sed -e 's/$/.mol2.gz/'  >  $i.txt
		mkdir -p d.$i/$j
		pushd d.$i/$j
		cat ../../$i.txt | xargs -L1 curl -sLO 
		popd
	end
end
#
# step 4. the files you requested should be in the d.?? directories
# email John Irwin :  chemistry4biology at gmail.com if you have trouble.
#
