How to prepare a ligand file for AutoDock 4
This How-to applies to:
This How-to is intended for: User
AutoDock 4 requires the ligand file to be written in PDBQT format. PDBQT format is very similar to PDB format but it includes partial charges ('Q') and AutoDock 4 (AD4) atom types ('T'). There is one line for each atom in the ligand, plus special keywords indicating which atoms, if any, are to be flexible during the AutoDock experiment. Preparing the ligand involves ensuring that its atoms are assigned the correct AutoDock 4 atom types, adding Gasteiger charges if necessary, merging non-polar hydrogens, detecting aromatic carbons if any, and setting up the 'torsion tree'. For most atoms, the AD4 atom type is the same as its element; the exceptions are "OA", "NA", "SA" for hydrogen-bond acceptor O, N and S atoms; "HD" for hydrogen-bond donor H atoms; "N" for non-hydrogen bonding nitrogens; and "A" for carbons in aromatic rings. The AD4 atom types and their parameters can be found in the "AD4_parameters.dat" file, which is included in the source code of the AutoDock 4 distribution, in the "autodocksuite-4.0.0/src/autodock-4.0.0" directory.
The ligand file can be prepared interactively using AutoDockTools (ADT) or with prepare_ligand4.py, a Python script which can be found in MGLTools/MGLToolsPckgs/AutoDockTools/Utilities24. Typing just the name of the script at a shell prompt and pressing <Enter> causes the script to print the usage documentation, which gives an overview of the flags it understands and how to use the script.
prepare_ligand4.py -l filename
Description of command...
[-v] verbose output
[-o pdbqt_filename] (output filename)
[-d] dictionary to write types list and number of active torsions
[-A] type(s) of repairs to make:
bonds_hydrogens, bonds, hydrogens
[-C] do not add charges
[-p] preserve input charges on atom type, eg -p Zn
[-U] cleanup type:
nphs_lps, nphs, lps, ''
[-B] type(s) of bonds to allow to rotate
[-R] index for root
[-F] check for and use largest non-bonded fragment (False)
[-M] interactive (default is automatic)
[-I] string of bonds to inactivate composed of
of zero-based atom indices eg 5_13_2_10
will inactivate atoms-atoms bond
and atoms-atoms bond
(default is '')
[-Z] inactivate all active torsions
(default is leave active)
Procedure1. Install MGLTools if you have not already done so. This will install the graphical user interface and the Python shell scripts for ADT (AutoDockTools). See also: How to setup ADT scripts.
2. In your working directory either copy 'prepare_ligand4.py' from "MGLTools/MGLToolsPckgs/AutoDockTools/Utilities24", or make sure your path includes 'yourpath', the directory where MGLTools is installed locally.
yourpath = local_install/MGLTools/MGLToolsPckgs/AutoDockTools/Utilities24
On Linux, "local_install" is either "/usr/local" or "$HOME", on Mac OS X it is "/Library". For Windows, see 1. above.
3. Run the script at the command prompt with the desired flags and arguments:
pythonsh [yourpath or .]/prepare_ligand4.py -l ligand.pdb [options]
InputThe input file should contain only one molecule, which will be formatted as the ligand. Ideally, it should already have all hydrogens added (but see option '-A' below).
OutputThe output filename default is the input file stem plus .pdbqt. For example, 'ind.pdb' by default is written to 'ind.pdbqt'.
adds hydrogens. PyBabel is used for adding all hydrogens, not just polar-hydrogens
if, after having built bonds by-distance, there are any atoms that do not have any bonds, this builds a bond between each of these atoms and the atom nearest to it. This is necessary for building the torsion tree.
adds hydrogens and builds bonds to any non-bonded atoms.
(The default is not to perform any repairs, i.e. to not add hydrogens and not build bonds.)
does not add Gasteiger partial atomic charges. If this option is used, the input ligand should already have partial atomic charges; the best input formats here would be SYBYL mol2 or AutoDock 3 PDBQ, since these store charges.
preserves the input charge on a specific atom type; this is useful for metals where the charge has already been set, e.g. -p Zn
performs various kinds of clean-up.
merges non-polar hydrogens by adding the charge of each non-polar hydrogen to the carbon to which it is bonded and then removes the non-polar hydrogen from the ligand molecule, thus implementing the 'United-Atom' model.
merges lone-pairs by adding the charge of each lone pair to the atom to which it is 'bonded' and then removes the lone-pair.
merges both non-polar hydrogens and lone pairs. (This is the default.)
(this is two quote characters, not one double-quote) Does not perform any clean-up
(The default is 'nphs_lps')
defines which types of bonds to allow to rotate
allows peptide-backbone-bonds (i.e. phi and psi) are rotatable. (This is the default).
allows amide bonds to be rotatable. (They are non-rotatable by default).
allows guanidinium bonds to be rotatable. (They are non-rotatable by default).
(The default is 'backbone')
defines the 0-based index of the atom that will become the root of the torsion tree.
(The default is to find the root automatically: this will be the atom with the smallest-largest-subtree)
checks for and uses largest non-bonded molecule or fragment in the input. Some files contain more than one molecule. By default, the first found is processed. If this option is used, the largest molecule found is used.
This option processes the molecule according to the input options but does not write the outputfile. For example:
pythonsh -i prepare_ligand4.py -l ind.pdb -M(The default is automatic mode which exits after writing the output file.)
defines the string of bonds to inactivate, defined using a string of zero-based atom indices separated by underscore characters. For example:
will inactivate the bond between atoms and atoms and the bond between atoms and atoms
(Note this flag is the capital i)
inactivates all active torsions. This results in a rigid ligand molecule.
Known problems1. This script requires MGTools version 1-4-5. Previous versions of MGLTools/AutoDockTools/MolecularPreparation.py had a bug in the depth-first-order traversal used to write the ligand file which could result in files which would be rejected by autodock4 with this error message:
autodock4: ERROR: All ATOM and HETATM records must be given before any
nested BRANCHes; see line ## in PDBQT file "xxx.pdbqt"
3. Formatting the ligand involves building bonds between atoms which are within the van der Waals radii of each other to determine the torsion tree. For this reason, some input atom coordinates cannot be processed without using the -A 'bonds' repair option.