Connect with us


How to perform Flexible Docking using Autodock Vina?



flexible docking using autodock vina

Flexible docking is when some residues in the interacting bodies (receptor and ligand) are kept flexible leaving the rest of the part rigid. In this article, we have demonstrated the site-specific docking with flexible side chains in the receptor using Autodock Vina [1].

We are using Human serum albumin (HSA) as the receptor and sodium octanoate (SO) as the ligand. As it is a site-specific docking and HSA is already complexed with 3-carboxy-4-methyl-5-propyl-furanpropanoic acid (CMPF). We want to bind SO in the same site where CMPF has already bound in HSA. For simple site-specific docking, read this article.

We need the following files prepared for docking with AutoDock Vina:

  1. Pdbqt files of protein and the ligand
  2. Configuration file
  3. Grid file

Preparation of receptor PDB file

  1. Download a protein crystal structure of HSA complexed with 3-carboxy-4-methyl-5-propyl-furanpropanoic acid (CMPF) (PDB ID: 2BXA) from PDB.
  2. Open the PDB file and remove HETATOMS.
  3. After removing hetatoms, we will keep only one of the four chains (here, Chain A was taken) and remove the rest of the three chains and save this file as “protein.pdb”
  4. Now save the file as “protein.pdb”.

To know the details on how to remove hetatoms, read this article.

Downloading ligand

  1. Open PubChem ( and search for the compound. We are using “sodium octanoate” as a ligand. We can download the structure from the ZINC database also.
  2. Click on Sodium octanoate and look under the “3D Structure” section, click on “Download” and then you will see four different formats for downloading it. We will download the file in SDF format.
  3. Since we need the protein and the ligand in a PDB format, therefore, we have to convert SDF to PDB. We will use PyMol for this purpose and never use online converters because they may ruin your ligand file.
  4. Open PyMol, and open the downloaded ligand. Click on File --> Save Molecule --> select the molecule --> click OK. You can save it to your desired folder.

We will rename the ligand as “SO.pdb” just to avoid any kind of confusion. Now we have a PDB file of protein and that of the ligand. In order to perform docking, we need to prepare .pdbqt files from the .pdb files of the protein and the ligand, because docking through AutoDock Vina requires .pdbqt file format to dock.

Preparation of PDBQT file of ligand

  1. Open AutoDock Tools --> Ligand --> Input--> Open

It will ask you to select your ligand, we will go to the folder where we have saved our ligand’s .pdb file and click “SO.pdb”.

  1. Click Ligand --> Torsion Tree --> Detect Root .

It will show the torsion angle on the ligand from where it can be rotated.

  1. Click Ligand --> Output --> Save as PDBQT

We can rename the ligand, but we will use the same name as before and will name it as “SO.pdbqt” and save it in the same folder.

Preparation of PDBQT file of receptor

At first, we will prepare the PDBQT file of receptor protein using the same procedure as used for simple site-specific docking. Then we will define flexible and rigid residues in the receptor.

Let’s prepare a simple PDBQT file.

  1. Open AutoDock Tools, click File --> Read Molecule --> select protein.pdb .
  2. We will delete water molecules from the protein as they can make unnecessary bonds with the ligand. Click Edit --> Delete water.
  3. We will add polar hydrogens in order to avoid any empty group/ atom left in the protein. Click Edit --> Add Hydrogens --> Polar only
  4. We will save this file as .pdbqt, click Edit Grid --> Macromolecule --> Choose --> select the “protein.pdb” --> OK. It will ask for a folder to save, then save it as “protein.pdbqt“, in the same folder where the pdbqt file of the ligand was saved.
  5. Define binding site. For details, read this article.
  6. Define the grid box. For details, read this article.

Defining flexible residues in the receptor

For flexible docking, you will have to create two PDBQT files. One for a rigid portion of the receptor and the other for the flexible portion.

  1. Open Autodock tools.
  2. Go to Flexible Residues--> Input --> Open Macromolecule. This will open a browsing window for you to select a PDBQT file. Select the previously saved file, ‘protein.pdbqt’.
  3. Go to Flexible Residues--> Input --> Choose Macromolecule. Select the opened file (protein).
  4. Now select the residues that you want to keep as flexible from the left side panel. Click on the checkbox shown in front of the residue name under column name “S”. Here, we are selecting Tyr150, Lys199, Arg222, Arg257, and His242.
  5. Go to Flexible Residues--> ChooseTorsionsInCurrentlySelectedResidues. This will assign the selected residues as flexible. (As for the ligand, you can select the bonds to keep them rotatable). After that, it will display only the selected residues.
  6. Go to Flexible Residues--> RedisplayMacromolecule. The macromolecule will reappear.
  7. Now, save the rigid portion. Go to Flexible Residues--> Output --> SaveRigidPDBQT. It will prompt you to select a directory where you want to save it. Select the working directory and save it as “rigid.pdbqt”.
  8. Now, save the flexible portion. Go to Flexible Residues--> Output --> SaveFlexiblePDBQT. It will prompt you to select a directory where you want to save it. Select the working directory and save it as “flexible.pdbqt”.

As for now, we have successfully created flexible and rigid PDBQT files of the receptor. Let’s prepare a configuration file.

Preparation of Configuration file

Create a new file and write the center_x, y, and z coordinates, and also the size_x, y, and z of the grid box from the “grid.txt” file. Save this file as “conf.txt” in the same directory.

receptor= protein.pdbqt

ligand= SO.pdbqt


center_x= 4.402

center_y= -8.060

center_z= 8.874


size_x= 66

size_y= 56

size_z= 54

out= vina_out_SO.pdbqt

log= log_SO.txt

exhaustiveness= 8

Perform flexible docking

Put all the following in the same folder (i.e., dock):

  1. protein.pdbqt
  2. rigid.pdbqt
  3. flex.pdbqt
  4. SO.pdbqt
  5. conf.txt

Please keep in mind that you have named the files properly and kept all the setup files in the same folder otherwise you may get errors while running the docking.


  1. Open the terminal and move inside the “dock” folder.
  2. Type the following command:

$ vina --config conf.txt --receptor rigid.pdbqt --flex flexible.pdbqt --ligand SO.pdbqt

  1. Press “enter”.


  1. Open the command prompt and enter the folder where all the docking files are placed.
  2. Type the following command:

>vina.exe --config conf.txt --receptor rigid.pdbqt --flex flexible.pdbqt --ligand SO.pdbqt

It may take a few minutes depending upon the number of residues you have selected. Also, it takes more time than simple site-specific docking. After completion, it will output a log file and a vina output file that you can further analyze using Pymol and other viewers.

Share if you like this article!


  1. Trott, O., & Olson, A. J. (2010). AutoDock Vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. Journal of computational chemistry31(2), 455-461.

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba


What values are considered as good or bad in computational docking?



After performing computational docking, a question that comes to mind most is “what docking score is considered good or bad”. In this article, we will discuss this in detail. (more…)

Continue Reading

Bioinformatics Programming

How to sort binding affinities based on a cutoff using script?



How to sort binding affinities based on a cutoff using script?

Previously, we have provided a Python script ( to analyze the virtual screening (VS) results of Autodock Vina. Now, we have updated this script to sort binding affinities based on user inputted cutoff value. (more…)

Continue Reading


Virtual Screening using Autodock Vina: Frequently Asked Questions & Answers for Starters



Virtual Screening using Autodock Vina: Virtual Screening: Frequently Asked Questions & Answers for Starters

Virtual Screening (VS) is one of the important techniques in bioinformatics. It can be easily performed using Autodock Vina. We have provided detailed articles on this topic. In this article, we are trying to answer some FAQs for beginners. (more…)

Continue Reading