Docking Ligands to a Protein¶
This document describes how to dock ligands to a Protein.
Prerequisites¶
- You have a prepared Protein
- You have a Ligand or LigandSet
- You have protonated your ligands
- You have found pockets in your Protein using the Pocket Finder
Docking a single Ligand¶
Use Docking with your protein, pocket, and ligand. Here pocket is a Pocket from the Pocket Finder . Both Docking.run() and Docking.start() use client.executions.create: run() sets sync=True for one ligand (one blocking request until completion), and start() sets sync=False for a single persisted async job with two or more ligands. Docking.run() returns a LigandSet of poses.
from deeporigin.drug_discovery import Docking
docking = Docking(protein=protein, pocket=pocket, ligand=ligand)
poses = docking.run()
Estimating cost¶
To get a cost estimate without running the docking, call quote() on the Docking instance:
docking = Docking(protein=protein, pocket=pocket, ligand=ligand)
docking.quote() # populates docking.estimate
docking.estimate # estimated cost in dollars
docking.cost # None until a billable run completes
After a completed run, the actual cost is on the same object:
docking = Docking(protein=protein, pocket=pocket, ligand=ligand)
poses = docking.run()
docking.cost # actual cost in dollars
Viewing docked poses¶
Docked poses for that ligand can be viewed using:
protein.show(poses=poses)
You will see something similar to the following. Use the arrows to inspect individual poses.
Viewing pose scores and binding energy¶
Every pose is assigned a pose score and a binding energy. These can be viewed using:
poses
A widget similar to the following will be shown:
LigandSet with 15 poses
SMILES: Cc1[nH]c2cc(Cl)cc(Cl)c2c1CCN
Properties: Binding Energy, POSE SCORE, SMILES, initial_smiles
Use .to_dataframe() to convert to a dataframe, .show_df() to view dataframewith structures, or .show() for 3D visualization
To work with a dataframe containing this data, use:
df = poses.to_dataframe()
Exporting poses to SDF¶
Poses can be saved to a SDF file using:
poses.to_sdf()
Docking a LigandSet¶
Using Batch Jobs¶
Tutorial
Follow the tutorial on how to dock ligands using Batch Jobs. This is best suited for large jobs with 100+ ligands.
Using Functions¶
Several ligands in a LigandSet can be docked by passing ligands to Docking, then Docking.start() (async). Poll with sync() or Jupyter helpers until the job completes, then call get_results() to retrieve a LigandSet of poses.
docking = Docking(protein=protein, pocket=pocket, ligands=ligands)
docking.start()
# … wait for completion (docking.sync() in a loop, or watch() in notebooks) …
poses = docking.get_results()
poses is a LigandSet containing the docked poses. To work with a DataFrame:
df = poses.to_dataframe()
To filter poses to keep only top poses, use:
top_poses = poses.filter_top_poses()
These poses can be visualized as before:
protein.show(poses=poses)
If you need SDF files for the poses (e.g. for export), use get_poses() instead, which downloads the SDF files from the platform:
poses = docking.get_poses()
poses.to_sdf("my_poses.sdf")
To estimate the cost of docking a full LigandSet without running it:
docking = Docking(protein=protein, pocket=pocket, ligands=ligands)
docking.quote()
docking.estimate # total estimated cost across all ligands
Constrained Docking¶
Under development
Constrained Docking is under active development and is not generally available.
We can use constrained docking to dock a Ligand to a Protein while constraining certain atoms to certain locations.
Typically, these constraints are computed from a reference docked pose for another (similar) ligand, using a Maximum Common Substructure (MCS) shared across ligands.
Assuming we have docked a ligand to a protein and picked a pose to be the "reference". When constrained docking is available, it will be configured through Docking (reference-pose parameters are not exposed yet). A standard run looks like:
docking = Docking(protein=protein, pocket=pocket, ligand=ligand)
poses = docking.run()
# view poses
protein.show(poses=poses)
To view new poses together with the reference pose, combine the LigandSet values (for example):
protein.show(poses=reference_pose + poses)