Published using Google Docs
PyRX Molecular Docking Module
Updated automatically every 5 minutes


PyRX Molecular Docking Module

Techniques to Master:

  1. Converting macromolecules and small molecules to PDBQT format
  2. Designing and building a ligand library
  3. Conduct a ligand docking exercise with your target protein
  4. Interpret the results of the docking exercise

Learning Objectives:

  1. Explain the file types used in PyRX
  2. Master inputs and outputs for PyRX
  3. Differentiate between good binding and poor binding in PyRX
  4. Modify a ligand to increase binding affinity to your target protein in PyRX
  5. Visualize the ligand-protein results from PyRX and identify binding partners
  6. Compare the ligand binding pocket suggested by PyRX with the ligand binding pocket suggested by LigPlot+.


A. The nature of ligand binding to proteins. First we should define the term “ligand”. According to, a ligand is “a molecule, as an antibody, hormone, or drug, that binds to a receptor.” One way to predict the function of a protein is to look for the ligands that can bind tightly to the protein. Perhaps these ligands will be substrates, cofactors or inhibitors. Ligands usually bind to proteins through noncovalent interactions, including hydrogen bonds, charge-charge interactions, hydrophobic interactions and metal ion coordinate bonds. Figure 1 contains an image of the ligand, heme, as it is bound to myoglobin. The image indicates the hydrogen bonds and the bonds to the metal ion in heme. We elected not to show the hydrophobic interactions - there are more than 20, making the image difficult to view.

Since we are trying to predict the function of proteins, you may want to modify a promising ligand (one with a negative free energy of binding) to improve its binding, by adding a positively or negatively charged group, a potential hydrogen bond donor, such as an amino group, or a potential hydrogen bond acceptor, such as an aldehyde or ketone group. You should keep in mind that there are tradeoffs when designing a ligand. The additional size of the added group may sterically interfere with binding. The ligand may also be bound in such a way that the added group actually decreases binding affinity by causing a repulsion based on polarity differences.

B. History of Docking Software

Molecular docking software allows us to computationally predict the binding of a macromolecule, in our case a protein, to a ligand. Consider this an experiment in the computer. The use of docking software to predict binding interactions enables scientists to select ligands that likely to bind to a target macromolecule, leading to the selection of the best experiments to run in the wet lab. There are many docking programs available, both as commercial products and as open source software, dating back to the 1990s [2].

C. Strengths and Weaknesses of Computational Docking Studies. The advantage of computational docking studies is that you can explore binding by dozens of ligands in a few minutes on a standard desktop computer with PyRX. The disadvantage is that the results are virtual - they need to be verified in the lab. Sources of error include the fact that the macromolecules are considered only as fixed objects in PyRX (for the sake of speed), but in fact the macromolecules are highly flexible. Koshland’s induced fit theory is based on the fact that proteins often change shape when ligands bind [3]. Autodock Vina (and PyRX) is not able to predict binding energies in cases where the protein changes shape during the binding interaction. Furthermore the binding energies are based on electrostatics and do not account for changes in protein behavior during binding such as changes in pKa value of acidic or basic amino acid side chains due to solvent or proximity effects.  The errors are not systematic, so rank ordering ligands based on free energies of binding is not advised. According to David Goodsell’s video entitled, “Using AutoDock 4 and AutoDock Vina with AutoDock Tools”, it is best to consider the free energy values to be reliable +/- 2-3 kcal/mol [4].

D. Autodock Vina and PyRX

In this project, you will focus on using PyRX, a wrapper program that brings together several tools that are used together for ligand docking to macromolecules:

Before going further, it will be helpful to explain the difference between PDB and PDBQT files. PDB files contain the results for protein structure determination by multiple experimental methods, mainly x-ray diffraction, NMR or electron microscopy. The files that are published on the PDB website [9] are models that best fit the data. While all protein structures contain hydrogen atoms, very few PDB models determined by x-ray diffraction include hydrogen atoms - the method does not have sufficient resolution to provide that level of detail. However, docking interactions between ligands and macromolecules depend very strongly on the hydrogens on both the ligand and the macromolecule, so those hydrogens must be introduced computationally. Open Babel is a program that converts PDB files to PDBQT files, by adding hydrogens where appropriate. The addition of hydrogens is not straightforward. The conversion must take into account the hybridization of the atom bound to the hydrogen (e.g. sp2 or sp3), the pH of the solution and the pKa values for ionizable side chains. Once this conversion is complete, the AutoDock Vina program within PyRX can then perform the binding studies.


Dock small molecule ligands into a known protein structure to identify different binding conformations.  Study the binding site of the ligand and identify what residues in the protein it interacts with.  Develop and test chemical modifications to try to improve the ligand binding.

Experimental Design Considerations:


The software should be installed on the computers in your lab. If not, please use these links to obtain PyRX and LigPlot+. Please keep in mind that you may need to request licenses for the software.

Safety Concerns:

For most of the this lab module, you will be focused closely on a computer screen. You are encouraged to take periodic breaks (at least every 15 minutes) to reduce eye fatigue.


  1. Loading the protein
  1. Select a protein from the Protein Data Bank: 2hnt.pdb
  2. Download the PDB file.                        
  3. Go to PyRX. Click the molecules tab. Then use File → Load Molecule to upload 2hnt.pdb.
  4. Once you see it in the Molecules tab, right click it to convert it to a .pdbqt file by selecting Make Macromolecule.  
  1. Loading the ligands
  1. Go to the PDB page and find the EC class
  2. Click on the EC class.
  3. Select the Ligands tab.
  4. Scroll through the list of ligands and choose 5 or 6 that you want to dock.  Don’t choose simple things like acids or single molecule ions.  Note the 3 letter code for each ligand that you choose.  
  5. Enter the list at :
  6. Download as a single .sdf files, and use the ideal coordinates from CCD option. Check the following boxes: Include instances with missing heavy atoms, Exclude atom labels from SDF files.   Save the ligand file.  
  7. In PyRX, use File → Import (Chemical Table File - SDF) command for the sdf file. Everything will be downloaded into PyRX and appears in the Open Babel tab on the bottom of the application.
  8. Right click on one of the ligand file names and choose Minimize all.  
  9. Now right click again and select Convert All to Autodock Ligand (.pdbqt). All the ligands will now be in the Ligands window on the top of the application under the Autodock tab.
  1. Docking
  1. Go to Vina Wizard - the far left tab in the bottom left window and click the Start button.  
  2. In the top left panel, select your ligands by clicking on each one.  Hold down Command/Ctrl when you click to select more than one.  Then click on the protein to select it as the macromolecule.  The wizard will tell you how many ligands and how many macromolecules you have selected.  
  3. Click forward in Vina, which will compile the list of ligands.
  4. You can then specifically isolate the binding site of the protein, if desired, and eliminate extraneous binding locations. A white box encircling the protein can be minimized or expanded as needed (Figure 2). Next, click the Run Vina button (on lower left side) or the Forward button on the right side.

  1. Once complete, Click Analyze Results in Vina.
  1. For each ligand, you will see a list of results.  There will be multiple results for each ligand.  These are different conformations of the ligand docked into the protein.  Mode 0 is the conformation that had the most favorable (biggest negative number) binding affinity for that ligand.  
  2. To save a list of all your ligands and the binding affinity, click on the Save as CSV file button.  This button is the next to last button on the far right and has a little blue disk icon.  This will enable you to open your results in Excel later.  

  1. To save your whole workspace, including all the newly created .pdbqt files, which have the coordinate space in them, select File → Export, and save everything in a tarball (a compressed file format originally used in the Unix operating system). Otherwise it is all saved to a hidden folder that you can’t use Finder to get to easily.

  1. Visualizing the binding results.
  1. Once you have completed the analysis for your ligand, you should see the free energies of binding for each conformation under the Analyze Results tab.
  2. Click on one of these and the ligand will appear bound to the macromolecule in the molecular viewing window in PyRX. Zoom in a bit, and you should be able to see your ligand docked in your protein (Figure 3).
  3. If you then click down the list of modes for that ligand, you can see the different conformation for each one.  It’s a bit difficult to explore (everything is in stick format), but you can export the results as a .pdb file that you can view in your favorite visualization software.
  4. In the Molecules tab, right click on the protein name and save it as a PDB file.  Then right click the name of the ligand and save it as a PDB.  Note:  You will have to save each conformation of the ligand separately.  Click on each different mode in the docking results list and save the PDB for each one.  

  1. Identifying the binding site with LigPlus
  1. To identify the binding site, you need to create one PDB file that contains both the protein and the ligand.  The easiest thing to do is open the protein PDB you generated in the previous section in a text editor like TextWrangler.  Then open the ligand PDB file and cut and paste the ligand into the protein’s PDB file.  BE SURE TO SAVE THE NEW COMBINED PDB FILE WITH A NEW NAME.  
  2. Open LigPlus by double clicking on LigPlus.jar, which is in the LigPlus folder within the Applications folder.  
  3. Click on File → Open → PDB file.  Click the browse button and navigate to find the PDB file you just created.  
  4. LigPlus will then tell you how many protein chains and how many ligands it has found in your file.  If there is only one ligand, it will already be highlighted.  Click Run.  
  5. Green dashed lines indicate hydrogen bonds and half circles of red lines indicate hydrophobic contacts.  Go to File → Print Screen and then use the PDF menu in the lower left corner to save your picture as a PDF file.  


Interpreting Results: 

Analyze your data in two ways:

Going Further with your PyRX Exercise

Discovery Exercise:  Improving the binding of your ligand

  1. Study your ligand bound to your protein.  Think about chemical modifications you might make to your ligand to improve the ligand binding.  For example, if pi stacking is a dominant mode of binding, think about what chemical modifications you could make to the ligand that would enhance the pi stacking.  
  2. Build a model of your ligand in WebMO.  If your molecule is complicated, you might want to import it instead of building it from scratch.   When you are on the Molecule Building screen, click Import Molecule and choose PDB file.  Browse to find your file and click the Generate Bonds box.  
  3. Since WebMO generated your bonds for you, you should double check and make sure everything is correct.  In particular, it may have missed the double bonds in aromatic rings.  If you need to add any bonds, go into build mode, and click and drag between the atoms to add additional bonds.  
  4. Your molecule will not include any hydrogen atoms.  To add hydrogens and clean up the geometry of your structure, click the broom icon.  
  5. Go back to build mode, and make chemical modifications to your molecule.  Click the broom icon again to optimize the geometry.
  6. Click the Export Molecule button.  Choose PDB file format.  
  7. Go back to PyRx and load your new molecule using File → Load Molecule.  Right click on the molecule’s name and choose AutoDock → Make Ligand.
  8. Run AutoDock Vina again with your new ligand and compare its results to your other ligands.  


  1. Feng, Z., Chen, L., Maddula, H., Akcan, O., Oughtred, R., Berman, H. M., and Westbrook, J. (2004) Ligand Depot: a data warehouse for ligands bound to macromolecules. Bioinformatics. 20, 2153–2155
  2. Docking (Molecular) (2016) Wikipedia, the free encyclopedia. [online] (Accessed July 14, 2016)
  3. Koshland, D. E. (1995) The Key–Lock Theory and the Induced Fit Theory. Angew. Chem. Int. Ed. Engl. 33, 2375–2378
  4. Calit2ube (2015) Using AutoDock 4 - David Goodsell, University of California, San Diego, [online] (Accessed July 14, 2016)
  5. O’Boyle, N. M., Banck, M., James, C. A., Morley, C., Vandermeersch, T., and Hutchison, G. R. (2011) Open Babel: An open chemical toolbox. Journal of Cheminformatics. 3, 33
  6. Morris, G. M., Goodsell, D. S., Huey, R., and Olson, A. J. (1996) Distributed automated docking of flexible ligands to proteins: parallel applications of AutoDock 2.4. J. Comput. Aided Mol. Des. 10, 293–304
  7. Morris, G. M., Huey, R., Lindstrom, W., Sanner, M. F., Belew, R. K., Goodsell, D. S., and Olson, A. J. (2009) AutoDock4 and AutoDockTools4: Automated Docking with Selective Receptor Flexibility. J Comput Chem. 30, 2785–2791
  8. Trott, O., and Olson, A. J. (2010) AutoDock Vina: Improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. J. Comput. Chem. 31, 455–461
  9. Berman, H. M., Westbrook, J., Feng, Z., Gilliland, G., Bhat, T. N., Weissig, H., Shindyalov, I. N., and Bourne, P. E. (2000) The Protein Data Bank. Nucl. Acids Res. 28, 235–242

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.