What Is Molecular Docking?
Molecular docking is a computational technique that predicts how a small molecule (called the ligand) fits into the binding site of a protein (called the receptor). Think of it as a digital lock-and-key experiment: the protein is the lock, the molecule is the key, and docking software tests whether the key fits and how well it holds in place.
Docking is one of the most widely used methods in drug discovery because it lets researchers test thousands of potential drug molecules against a protein target on a computer, long before any laboratory experiments. This saves enormous amounts of time and money by narrowing down candidates to the most promising ones.
Core Concepts You Need to Know
The Receptor (Protein Target)
The receptor is the protein you want to target with a drug. In most drug discovery programs, this is a protein that plays a role in disease. For example, COX-2 is a protein involved in inflammation and pain signaling. By finding molecules that bind tightly to the COX-2 active site, researchers can develop anti-inflammatory drugs.
Receptor structures come from experimental methods like X-ray crystallography and cryo-EM, stored in the Protein Data Bank (PDB). Each structure has a four-character identifier (like 5KIR for a COX-2 structure) that you can use to access the 3D coordinates.
The Ligand (Drug Molecule)
The ligand is the small molecule you are testing for binding. Ligands are typically represented as SMILES strings, which encode molecular structure as text. For example, aspirin is encoded as CC(=O)OC1=CC=CC=C1C(=O)O. The docking software converts this 2D representation into 3D coordinates and tests multiple orientations and shapes (conformations) within the binding pocket.
The Binding Site (Pocket)
The binding site is a specific region on the protein surface where the ligand fits. It is usually a cavity or groove with amino acid residues that form favorable interactions with the ligand. Most proteins have one primary active site, but some have multiple pockets where molecules can bind.
The Scoring Function
AutoDock Vina uses a scoring function to estimate how strongly a ligand binds to the receptor. This function combines several physical interaction terms:
- Van der Waals forces: shape complementarity between the ligand and receptor surfaces
- Hydrogen bonds: directional interactions between donor and acceptor atoms that stabilize binding
- Hydrophobic contacts: favorable packing of nonpolar groups away from water
- Torsional penalty: an entropy cost for each rotatable bond in the ligand that becomes restricted upon binding
The final output is a predicted binding affinity in kcal/mol. More negative values indicate stronger predicted binding.
Walkthrough: Docking Aspirin to COX-2
This step-by-step example docks aspirin against the COX-2 enzyme, a classic drug-target pair. Aspirin inhibits COX enzymes to reduce inflammation and pain. We will use the SciRouter API, which handles all receptor and ligand preparation automatically.
Step 1: Set Up Your Environment
pip install requests
export SCIROUTER_API_KEY="sk-sci-your-api-key"Step 2: Submit the Docking Job
import requests
import time
import os
API_KEY = os.environ["SCIROUTER_API_KEY"]
BASE = "https://api.scirouter.ai/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Aspirin SMILES docked against COX-2 (PDB: 5KIR)
response = requests.post(
f"{BASE}/docking/vina",
headers=headers,
json={
"ligand_smiles": "CC(=O)OC1=CC=CC=C1C(=O)O", # Aspirin
"receptor_pdb": "5KIR", # COX-2
"exhaustiveness": 8, # Search thoroughness
"num_poses": 9 # Number of poses to return
}
)
job = response.json()
print(f"Job submitted: {job['job_id']}")Step 3: Poll for Results
# Poll until the job completes
while True:
result = requests.get(
f"{BASE}/docking/vina/{job['job_id']}",
headers=headers
).json()
if result["status"] == "completed":
print(f"\nDocking complete. {len(result['poses'])} poses found:\n")
for i, pose in enumerate(result["poses"]):
print(f" Pose {i+1}: {pose['affinity']:>6.1f} kcal/mol")
break
elif result["status"] == "failed":
print(f"Error: {result['error']}")
break
time.sleep(5)
# Save the best pose for visualization
with open("aspirin_cox2.sdf", "w") as f:
f.write(result["poses"][0]["sdf"])
print(f"\nBest pose saved to aspirin_cox2.sdf")Step 4: Interpret the Results
After the docking run completes, evaluate the results using these guidelines:
- Check the top score: aspirin typically scores between -6.0 and -8.0 kcal/mol against COX-2, consistent with its moderate binding affinity
- Look at pose consistency: if the top 3 poses share a similar orientation, the predicted binding mode is more reliable
- Visualize the best pose: open the saved SDF file in PyMOL or ChimeraX alongside the receptor to check for sensible interactions
- Compare to other compounds: dock additional molecules against the same target to rank candidates
Screening Multiple Compounds
Once you can dock a single molecule, scaling to many is straightforward. Here is a pattern for screening a small library:
compounds = {
"Aspirin": "CC(=O)OC1=CC=CC=C1C(=O)O",
"Ibuprofen": "CC(C)CC1=CC=C(C=C1)C(C)C(=O)O",
"Naproxen": "COC1=CC2=CC(=CC=C2C=C1)C(C)C(=O)O",
"Celecoxib": "CC1=CC=C(C=C1)C2=CC(=NN2C3=CC=C(C=C3)S(N)(=O)=O)C(F)(F)F",
}
jobs = {}
for name, smiles in compounds.items():
resp = requests.post(
f"{BASE}/docking/vina",
headers=headers,
json={"ligand_smiles": smiles, "receptor_pdb": "5KIR"}
)
jobs[name] = resp.json()["job_id"]
print(f"Submitted {name}: {jobs[name]}")
# Collect results
import time
for name, job_id in jobs.items():
while True:
r = requests.get(f"{BASE}/docking/vina/{job_id}", headers=headers).json()
if r["status"] == "completed":
print(f"{name:>12}: {r['poses'][0]['affinity']:.1f} kcal/mol")
break
elif r["status"] == "failed":
print(f"{name:>12}: FAILED")
break
time.sleep(3)Next Steps
With the fundamentals of molecular docking covered, here are directions to explore next:
- Read our comparison of Vina, Glide, and GOLD to understand how Vina compares to commercial docking software
- Try AI-based docking with DiffDock which uses diffusion models instead of physics-based scoring
- Predict protein structures for targets without crystal structures using ESMFold
- Screen compounds for drug-likeness before docking with Molecular Properties
Try AutoDock Vina from the SciRouter tools page. Sign up for a free API key and start docking molecules in minutes.