AutoDock Vina is an open-source molecular-docking program that predicts ligand poses and assigns docking scores for a protein binding site. In an active-learning workflow, it acts as an oracle: each submitted molecule receives a computational benchmark label, but docking millions of compounds is usually impractical. section 9.1.4 section 9.2.6
A practical Vina experiment follows this sequence:
- Prepare protein and ligand structures as PDBQT files, retaining attention to protonation, atom typing, and hydrogen placement. section 9.1.4
- Define a three-dimensional binding box from a crystallized ligand’s coordinates, adding enough padding for ligand movement and rotation. section 9.1.4
- Initialize the Vina engine with the receptor, box, number of poses, and exhaustiveness, then write docking results to a PDBQT file. section 9.1.4
- For a SMILES library, add hydrogens, generate and optimize missing three-dimensional conformers, and submit each molecule to the docking oracle. section 9.2.6
Docking setup
A compact Python workflow initializes Vina with nine poses and exhaustiveness 8, then docks a prepared ligand: docker = VinaDocking(receptor_prep_file, box, num_poses=9, exhaustiveness=8); results = docker.dock(ligand_pdbqt, docking_output_file). section 9.1.4
Listing 9.2 Define Binding Box for Docking
class Point: #A
# See Python notebook for full implementation
class Box: #B
# See Python notebook for full implementation
def create_box_from_ligand(
ligand: mdtraj.Trajectory, padding: float = 5.0
) -> Box:
xyz = ligand.xyz[0] * 10 #C
pocket_center = \
(xyz.max(axis=0) + xyz.min(axis=0)) / 2 #D
pocket_size = \
xyz.max(axis=0) - xyz.min(axis=0) + padding #E
return Box.from_array(pocket_center, pocket_size)
ligand_traj = mdtraj.load(ligand_file) #F
box = create_box_from_ligand(ligand_traj, padding=5.0)Inspect the coordinate-based calculation that derives a binding-box center and size from a ligand trajectory. section 9.1.4
Listing 9.9 Defining the Oracle
def vina_oracle( #A
smiles_list, #B
box, #C
receptor_file, #D
num_poses=5, **kwargs):
params = Chem.SmilesParserParams()
params.removeHs = False
scores = []
for smiles in smiles_list:
mol = Chem.MolFromSmiles(smiles, params)
mol = Chem.AddHs(mol)
has_3d = False
try: has_3d = mol.GetConformer().Is3D()
except: has_3d = False
if not has_3d:
AllChem.EmbedMolecule(mol, randomSeed=42)
AllChem.MMFFOptimizeMolecule(mol)
docking_program = VinaDocking(
receptor_file, box, num_poses=num_poses
)
score = docking_program.dock_mol(mol) #E
scores.append(score)
return scores
def deepdock_oracle(smiles_list, **kwargs): #F
score_column = kwargs.get("score_column", "r_i_docking_score")
score_lookup = (
reference_df
.drop_duplicates(subset="SMILES", keep="first")
.set_index("SMILES")[score_column]
)
missing_smiles = [
smiles for smiles in smiles_list
if smiles not in score_lookup.index
]
if missing_smiles:
raise KeyError(f"{len(missing_smiles)} SMILES not found.")
return score_lookup.loc[smiles_list].to_numpy(dtype=float)Inspect the oracle implementation that converts SMILES molecules into Vina docking scores and contrasts it with a faster proxy oracle. section 9.2.6
