Molecular Docking Basics

Lesson 10 of 12 · 11 min

Visualizing Docking Results in PyMOL

AutoDock Vina writes every docked pose into a single PDBQT file, ordered from best affinity to worst. In this lesson you pull the top pose into PyMOL, frame the binding pocket, and mark the hydrogen bonds that explain why the ligand binds. Every command below is typed at the PyMOL command line unless it is labelled as a shell command.

Convert PDBQT to PDB

bash
# Vina writes poses best-first; -l 1 keeps only model 1, the top pose.
# Drop -l 1 to convert all poses; PyMOL then loads each MODEL as a state.
obabel receptor.pdbqt -O receptor.pdb
obabel ligand_out.pdbqt -O ligand_best.pdb -l 1
1 molecule converted
1 molecule converted

Load into PyMOL

text
load receptor.pdb, receptor
load ligand_best.pdb, ligand
hide everything
show cartoon, receptor
show sticks, ligand
util.cbag ligand

Focus on the pocket

text
select pocket, byres (polymer within 4.5 of ligand)
show sticks, pocket
hide sticks, hydro
set cartoon_side_chain_helper, on
set cartoon_transparency, 0.5
bg_color white
orient ligand
zoom (pocket or ligand), 3

Annotate and render

text
distance hbonds, ligand, pocket, mode=2
set dash_color, yellow, hbonds
label pocket and name CA, "%s-%s" % (resn, resi)
set label_size, 16
deselect
set ray_opaque_background, 0
ray 2400, 1800
png best_pose.png, dpi=300

The distance command with mode=2 is PyMOL's polar-contacts finder: it infers hydrogen bonds from donor and acceptor heavy atoms between the two selections, so you do not need explicit hydrogens on the pose. It does trust the input protonation, so double-check His, Asp, and Glu states if a contact looks wrong. Reading best_pose.png back shows the ligand in green sticks, contact residues labelled by name and number, and yellow dashes marking each hydrogen bond.

Try it yourself: Load your own receptor and its top Vina pose, isolate the pocket with a 4.5 A selection, then use mode=2 polar contacts to find at least one hydrogen bond between the ligand and a receptor residue. Label that residue, ray-trace the scene, and save a 300 dpi PNG you could drop straight into a figure.