Molecular Docking Basics

Lesson 6 of 12 · 12 min

Defining the Search Box and Grid

AutoDock Vina does not search the whole protein by default. It only samples poses inside a rectangular search box that you define, so getting that box right is the single most important decision when you set up a docking run. Aim it at your pocket and Vina finds real poses; aim it wrong and even a perfectly prepared receptor returns garbage.

The six box parameters

The box is fully described by six numbers in your Vina config file: center_x, center_y, and center_z fix where its middle sits, while size_x, size_y, and size_z set the full length of the box along each axis (not a half-width or radius). All six are in Angstroms, and Vina reads them literally. This is a key difference from AutoGrid, which instead expects a number of grid points plus a spacing value.

text
receptor = receptor.pdbqt
ligand   = ligand.pdbqt

center_x = 15.190
center_y = 53.903
center_z = 16.917

size_x = 22.0
size_y = 24.0
size_z = 20.0

exhaustiveness = 8
num_modes = 9

Method 1: center on a ligand

If your structure was solved with a ligand bound in the pocket, that ligand marks exactly where to aim. Extract its HETATM records, average their coordinates to get the center, and take the min-to-max span plus padding for the size. Read the coordinates from the fixed PDB columns (31-38, 39-46, 47-54) with substr rather than whitespace field-splitting, because negative coordinates can run two columns together and shift every field.

bash
awk 'substr($0,1,6)=="HETATM" && substr($0,18,3)=="STI" {
    x=substr($0,31,8)+0; y=substr($0,39,8)+0; z=substr($0,47,8)+0
    sx+=x; sy+=y; sz+=z; n++
    if (n==1) { xmin=xmax=x; ymin=ymax=y; zmin=zmax=z }
    if (x<xmin) xmin=x; if (x>xmax) xmax=x
    if (y<ymin) ymin=y; if (y>ymax) ymax=y
    if (z<zmin) zmin=z; if (z>zmax) zmax=z
}
END {
    pad=5
    printf "center_x = %.3f\n", sx/n
    printf "center_y = %.3f\n", sy/n
    printf "center_z = %.3f\n", sz/n
    printf "size_x = %.1f\n", (xmax-xmin)+2*pad
    printf "size_y = %.1f\n", (ymax-ymin)+2*pad
    printf "size_z = %.1f\n", (zmax-zmin)+2*pad
}' complex.pdb
center_x = 15.190
center_y = 53.903
center_z = 16.917
size_x = 22.0
size_y = 24.0
size_z = 20.0

A box too small clips valid poses, because the ligand cannot rotate or slide into its true binding mode and gets truncated at the wall. A box too large dilutes sampling: Vina spreads the same search effort over more volume, lowering the chance of finding the global minimum and slowing the run. Keep each dimension under roughly 30 Angstroms for a single pocket, and raise exhaustiveness if a larger box is unavoidable.

Method 2: by hand in ADT

When there is no bound ligand, place the box visually in AutoDockTools. Load the receptor, open Grid then Grid Box, and drag the sliders for the number of points along x, y, and z until the wireframe cube encloses your pocket, using the Center menu to snap it onto a chosen residue or atom. ADT stores the box as grid points times a spacing (0.375 Angstroms by default), so convert to Vina's size with points times spacing: 60 points times 0.375 gives 22.5 Angstroms per side.

Try it yourself: Fetch PDB 1IEP (Abl kinase bound to imatinib, ligand code STI), run the awk script above on it to compute all six box parameters, and append them to config.txt. Dock once with vina --config config.txt, then subtract 10 from each size value and dock again. The clipped box should return worse, less negative affinities as valid poses get cut off at the walls.