by T. M. (tomas.malinauskas@gmail.com)
July 23, 2008
Molecular docking is a method which predicts preferred conformation of one molecule (ligand) to a second one (receptor). This document describes a step by step docking of multiple ligands (high-throughput molecular docking) to a receptor using free tools (software and databases). Atomic coordinates of the ligands and a receptor were retrieved from databases ZINC 8 and PDB, respectively. To automate procedure of the docking, a program (script) Docker 1.0 was developed. Docker 1.0 uses AutoDockTools 1.5.2 as an internal docking engine. To illustrate a high-throughput method, docking of the inverse agonist (carazolol)-like ligands to a human beta-2 adrenergic G protein-coupled receptor was performed.
It is assumed that user of Docker 1.0 is familiar with AutoDock thus detailed explanations are omitted.
Molecular docking was performed on a PC (2 GB RAM, Intel Pentium Dual-Core Processor T2310, 1.46 GHz) running Ubuntu Linux 8.04.
AutoDockTools 1.5.2 should be installed on the system before using Docker 1.0. A step
by step installation of MGLTools 1.5.2 (AutoDockTools, Python Molecular Viewer and Visual
Programming Environment) on Ubuntu Linux 8.04 is described here:
http://users.ox.ac.uk/~jesu1458/installation_of_autodock_on_ubuntu_linux/
Open a terminal window by going to Applications --> Accessories --> Terminal. Type cd ~ and press Enter; type pwd and press Enter. Name of your home directory (e.g. /home/tomas) will be displayed on the screen.

Type mkdir docking and press Enter. It will create a directory titled docking in your home directory. We will keep all the files of this experiment in this directory. Type cd docking and press Enter to enter into the docking.

Open a web browser and go to the Protein Data Bank (http://www.rcsb.org/). Type 2rh1 in the search field to find a structure of receptor protein.

Download coordinates of the receptor (file 2RH1.pdb) to the directory docking.

Go back to the terminal window and type gedit 2RH1.pdb to edit file 2RH1.pdb with a text editor (gedit).

Select coordinates of amino acid residues 29 to 230, cut them out. Note that automatic procedure will treat residues 29 and 230 as terminal residues of the protein which is not correct but is good enough to a certain approximation. In addition, residues 29-230 represent only five out of seven transmembrane helices of the protein.

Create a new document (press button New) and paste coordinates.

Save coordinates as a file receptor.pdb in the directory docking.

Go back to the terminal window, type ~/MGLTools-1.5.2/bin/adt to start AutoDockTools.

Select AutoDock 4.1 in the AutoDock Mode window (if it pops up) and press Dismiss.

Press File --> Read Molecule and open a file receptor.pdb.

Press Edit --> Hydrogens --> Add and add hydrogen atoms to the receptor.

Save modified file by going to File --> Save --> Write PDB.

Go to Grid --> Macromolecule --> Choose... Click on receptor and press Select Molecule.

Press OK in the pop up Warning window and wait for the next window to appear.

Save an automatically generated file receptor.pdbqt in the directory docking.

Go to Grid --> Grid box... and set the following parameters for a grid box: number of points in x-direction 100, number of points in y-direction 126, number of points in z-direction 80, spacing 0.525 angstroms, x center -33.088, y center 19.766, z center 7.029. Press File --> Close saving current in the Grid Options window.

Go to Grid --> Output --> Save GPF... and save grid parameters as a file raceptor.gpf in the directory docking.

Go back to web browser, type http://users.ox.ac.uk/~jesu1458/docker/docker in the address bar and press Enter. Source code of the Docker 1.0 will be displayed in the browser.

Save Docker 1.0 by going to File --> Save Page As... as a file docker in the directory docking.

Go back to the terminal window and type chmod +x docker.

Go back to web browser and open http://zinc.docking.org/.

Click on Search and Browse. Set number of H-donors and H-acceptors to 4, limit Molecular Weight to the range 299.39-299.40 g/mol. Click QUERY DATABASE.

Click on Create Subset. Wait a second.

Click Browse Subset *, where * - automatically generated number (e.g. 9220). You will be redirected to a download page containing ligand coordinates.

Download file *_p0.0.mol2.gz to directory docking by clicking on *_p0.0.mol2.gz link with a right mouse button and selecting Save Link As...

Go to the terminal window, type gzip -d *_p0.0.mol2.gz and press Enter (replace * with automatically generated number before typing, e.g. gzip -d 9220_p0.0.mol2.gz).

Type mv *_p0.0.mol2 ligands.mol2 and press Enter (replace * with automatically generated number before typing, e.g. mv *_p0.0.mol2 ligands.mol2) to rename file containing coordinates of the ligands.

To start molecular docking of all the ligands to the receptor type ./docker and press Enter.

Docker 1.0 will start to run. How long will it take? About 1 day using default parameters set in Docker 1.0 leading to a relatively accurate docking. You can modify them (e.g. maximum number of energy evaluations, number of hybrid GA-LS runs) by manually editing file docker with your favourite text editor. You can also limit size of the grid box to a certain area of protein (e.g. binding pocket of interest).


Docker 1.0 will inform you about completion of the docking by saying Docking completed!. Results of the docking (i.e. list of the ligands exhibiting the lowest free energy of binding) will be summarized in a file results.txt in the directory docking.

Open file results.txt using your favourite text editor (e.g. type gedit ~/docking/results.txt in the terminal window). In this case, the first line of the file says that the most favourable conformation of a ligand with ZINC code (number) 11960600 binds to the receptor with a free energy of binding equal to -9.93 kcal/mol. It is relatively low free energy of binding (i.e. this compound might be considered as a potential drug or modulator of receptor signalling) corresponding to the estimated inhibition constant (Ki) of 52.51 nM.

In order to view complex receptor-ligand 11960600, go to the AutoDockTools window and open receptor coordinates (File --> Read Molecule --> receptor.pdbqt (directory ~/docking/receptor/).

Open coordinates of the ligand 11960600 by going to Analyze --> Dockings --> Open all --> ZINC11960600.dlg (directory ~/docking/ligands/ZINC11960600_receptor/). Click Yes in the pop up window.


To view conformation of the ligand corresponding to the lowest free energy of binding, go to Analyze --> Conformations --> Play, ranked by energy; click on the & button in a newly opened player window; check Show Info in the Set Play Options window.

Zoom, colour molecules as you like using bottom window of AutoDockTools (e.g. display secondary structure of the receptor by clicking on Rib. and display ligand atoms as spheres by clicking onto CPK).

In order to save complex between the receptor and ligand in the current conformation, go to Analyze --> Macromolecule --> Choose... and select receptor as a macromolecule. Then click on Write Complex in the Set Play Options window and save complex as a file complex.pdbqt.


In order to view complex with a conventional visualization program (e.g. PyMOL) that accepts PDB files (but not PDBQT), re-open (File --> Read Molecule) a file complex.pdbqt and save it as a ccomplex.pdb in the directory docking (File --> Save --> Write PDB).

If PyMOL is installed on your system, type pymol complex.pdb to view complex and visualize it as you like.


In a similar way, you can also compare conformation of a carazolol determined by x-ray crystallography (shown in grey below) and its conformation determined by the molecular docking. Two enantiomers of carazolol, ZINC codes 01999243 and 01567835, are shown in blue and red below, respectively.

Any comments are greatly appreciated.
Jeffrey D. for noticing redundant code.
#!/bin/bash # # Docker 1.0 # # Docker 1.0 is a free program (script) for a high-throughput molecular docking. It enables prediction of binding energies between multiple small molecules (ligands) and a target protein (receptor). Docker 1.0 uses atomic coordinates of the ligands and proteins retrieved from free public databases (ZINC 8 and PDB, respectively). AutoDockTools 1.5.2 is used as an internal molecular docking engine. # # Developed by T. M. # Email: tomas.malinauskas@gmail.com # Website: http://users.ox.ac.uk/~jesu1458/ # # Any comments are greatly appreciated! # # July 23, 2008 # # References # ZINC: # Irwin JJ, Shoichet BK. J Chem Inf Model. 2005. 45 (1): 177-82; # AutoDockTools: # Morris GM et al. J Comput Chem. 1998. 19 (14): 1639-1662; # Docker 1.0: # Malinauskas T. Docker 1.0. http://users.ox.ac.uk/~jesu1458/docker/ # echo "Starting Docker 1.0 - a free program for high-throughput molecular docking..." echo "Preparing environment for the AutoDockTools..." # Setup environment for the AutoDockTools. source ~/MGLTools-1.5.2/bin/mglenv.sh # Go to ~/docking where all the files of ligands, receptor and docking results will be stored. cd ~/docking # Make directories for the ligands and receptor. mkdir ~/docking/ligands mkdir ~/docking/receptor # Split file (mol2 format) containing atomic coordinates of the ligands into separate files. echo "Preparing atomic coordinates of the ligands..." cd ~/docking/ligands cat ~/docking/ligands.mol2 | csplit -ftmp -n4 -ks - '%^@.TRIPOS.MOLECULE%' '/^@.TRIPOS.MOLECULE/' '{*}' for f in * do mv -v $f `grep ZINC $f`.mol2 done # Prepare each ligand file for docking with AutoDock. echo "Preparing ligands for docking..." for f in * do echo $f python ~/MGLTools-1.5.2/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py -l $f done cd ~/docking/ # Copy an interactively (with AutoDockTools) prepared receptor file (pdbqt format) containing atomic coordinates to the directory ~/docking/receptor. cp ~/docking/receptor.pdbqt ~/docking/receptor/receptor.pdbqt # Copy an interactively prepared receptor file (gpf format) containing parameters for AutoGrid to the directory ~/docking/receptor. cp ~/docking/receptor.gpf ~/docking/receptor/receptor.gpf # Prepare a receptor file for docking with AutoDock. echo "Preparing receptor for docking..." cd ~/docking/receptor autogrid4 -p receptor.gpf -l receptor.glg cd ~/docking/ligands # Make a temporary directory ~/docking/ligands/dlgs where docking log files (dlgs) will be stored. mkdir ~/docking/ligands/dlgs # Prepare a file containing docking parameters for each ligand-receptor pair and perform docking with AutoDock. echo "Docking ligands to the receptor..." for f in ~/docking/ligands/*.pdbqt do foo=$f file=${foo##*/} base=${file%%.*} echo $base mkdir "$base"_receptor cd "$base"_receptor mv ~/docking/ligands/"$base".pdbqt . mv ~/docking/ligands/"$base".mol2 . ln -s ~/docking/receptor/receptor.pdbqt . ln -s ~/docking/receptor/receptor*map* . # Typical parameters for docking using the genetic algorithm (GA) or Lamarckian GA (LGA): # ga_num_evals=1000000 - maximum number of energy evaluations; # ga_pop_size=100 - number of individuals in population; # ga_run=30 - do this many hybrid GA-LS runs. # Increase of the above mentioned numbers leads to higher accuracy of docking but also increases computational time required to perform it. python ~/MGLTools-1.5.2/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_dpf4.py -l "$base".pdbqt -r receptor.pdbqt \ -p ga_num_evals=1000000 \ -p ga_pop_size=100 \ -p ga_run=30 autodock4 -p "$base"_receptor.dpf -l "$base".dlg cp "$base".dlg ~/docking/ligands/dlgs/"$base".dlg cd .. done cd ~/docking/ligands/dlgs # Summarize results of the docking. echo "Summarizing results of the docking..." for d in * do foo=$d file=${foo##*/} base=${file%%.*} mkdir "$base" cp $d ~/docking/ligands/dlgs/"$base" echo $d python ~/MGLTools-1.5.2/MGLToolsPckgs/AutoDockTools/Utilities24/summarize_results4.py -d ~/docking/ligands/dlgs/"$base" -b -a -o ~/docking/ligands/dlgs/results_temporary.txt done cd ~/docking # Sort ligands in order of increasing lowest free energy of binding. cat ~/docking/ligands/dlgs/results_temporary.txt | sort -k5n -r -t ',' > results.txt # Remove temporary directory ~/docking/ligands/dlgs. rm -rf ~/docking/ligands/dlgs/ echo "Docking completed!" echo "Results of the docking are summarized in ~/docking/results.txt" echo "Thank you for using Docker 1.0 and AutoDockTools 1.5.2!"