Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
DockingDrug DiscoverySoftwareTools

Prepare receptor and ligand files for docking using Python scripts

Dr. Muniba Faiza
Last updated: June 2, 2021 4:41 pm
Dr. Muniba Faiza
Share
3 Min Read
python scripts
SHARE

Docking software such as Autodock4 [1] and Autodock Vina [2] require input receptor and ligand files in a specific format called pdbqt. Sometimes, preparing files using Autodock Tools (ADT) gives various errors that are not easily understandable. Especially, when we are performing virtual screening (VS), we need to convert a lot of files from pdb to pdbqt format. Converting each file one by one using ADT is a tedious job. Therefore, python scripts provided by Autodock are quite helpful.

In this article, we will prepare the input receptor and ligand docking files using Python scripts.

  1. Preparing Ligands

At first, locate the ‘prepare_ligand.py’ (or ‘prepare_ligand4.py’ for Autodock4) file in the MGLTools directory you have already installed. The script will be present in /path/to/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/Utilities24/ or download from here or here.

Keep your ligands in a directory in pdb format and run this script as follows:

$ python prepare_ligand.py -l ligand.pdb -v -o ligand.pdbqt

Here, -l defines the ligand filename, -o is the output file, and -v is for displaying processing (default is minimal output).

There are other arguments that you can define such as

  • -d dictionary to write types list and number of active torsions “
  • -A type(s) of repairs to make:\n\t\t bonds_hydrogens, bonds, hydrogens (default is to do no repairs)”
  • -B type(s) of bonds to allow to rotate.
  • -M interactive (default is automatic output), and so on.

To know more options, type $ python prepare_ligand.py -h.

You can set parameters for the first ligand PDB file and then use the same command for all ligand files.

2. Prepare receptors

Similarly, receptors can be prepared from a Python script ‘prepare_receptor.py’ (or ‘prepare_receptor4.py’ for Autodock4) present in the directory mentioned above. You can also download it from here or here.

Keep your receptor files in a directory in pdb format and run this script as follows:

$ python prepare_receptor.py -r receptor.pdb -v -o receptor.pdbqt -A

Here, -r defines the receptor filename, -o is the output file, -v is for displaying processing (default is minimal output), and -A is used for checking hydrogens.

For more arguments, type $ python prepare_receptor.py -h.


References

  1. Morris, G. M., Huey, R., Lindstrom, W., Sanner, M. F., Belew, R. K., Goodsell, D. S., & Olson, A. J. (2009). AutoDock4 and AutoDockTools4: Automated docking with selective receptor flexibility. Journal of computational chemistry, 30(16), 2785-2791.
  2. 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 chemistry, 31(2), 455-461.

 

 

TAGGED:autodock toolsAutodock Vinaautodock4prepare ligandprepare receptorpythonubuntu
Share This Article
Facebook Copy Link Print
ByDr. Muniba Faiza
Follow:
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
4 Comments
  • sivaprasathibt@gmail.com says:
    November 26, 2021 at 3:17 pm

    Hi Team

    I use this command – python prepare_ligand.py -l ligand.pdb -v -o ligand.pdbqt

    I am getting below error

    File “prepare_ligand.py”, line 26
    print ” Description of command…”
    ^
    SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(” Description of command…”)?

    Could you please rectify any error in the prepare_ligand.py file

    Log in to Reply
  • Dr. Muniba Faiza says:
    November 26, 2021 at 4:47 pm

    Hi,

    It seems that you have a different Python version installed on your system. Try running it with Python3.

    Log in to Reply
  • Yousif Ali Ahmed Suleiman says:
    August 21, 2025 at 12:33 pm

    Hi, Dr,
    how can I download autodock vina in my windows

    Log in to Reply
  • User says:
    August 21, 2025 at 4:27 pm

    Hi,
    Visit the following link for the tutorial to install Vina on Windows.
    https://bioinformaticsreview.com/20200807/tutorial-installing-autodock-vina-on-windows/

    Best

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Starting in Bioinformatics? Do This First!
Starting in Bioinformatics? Do This First!
Tips & Tricks
[Editorial] Is it ethical to change the order of authors’ names in a manuscript?
Editorial Opinion
Installing bbtools on Ubuntu
[Tutorial] Installing BBTools on Ubuntu (Linux).
Sequence Analysis Software Tools
wes_data_analysis Whole Exome Sequencing (WES) Data visualization Toolkit
wes_data_analysis: Whole Exome Sequencing (WES) Data visualization Toolkit
Bioinformatics Programming GitHub Python

You Might Also Like

single-cell rna-seq
RNA-seq analysisSoftwareTools

Most widely used web servers/software for single-cell RNA-seq analysis

July 26, 2020
Installing FASTX-toolkit on Ubuntu
Sequence AnalysisSoftwareTools

Installing FASTX-toolkit on Ubuntu

November 11, 2020
Common mistakes made during docking.
Tips & Tricks

Common mistakes made during computational docking.

September 16, 2023
python programming
Bioinformatics Programming

How to search for a specific character in a file using Python?

October 27, 2020
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up