Docking¶
This document describes how to dock a large set of ligands to a protein using Deep Origin tools.
Looking to dock a few ligands?
This document describes how to dock more than a handful of ligands (>10) using a batch job. To dock a single (or a few ligands), you might prefer to use the .dock() function of the Protein class, as described here.
Prerequisites¶
We assume that we have an initialized and configured a Complex object:
from deeporigin.drug_discovery import Complex, BRD_DATA_DIR
sim = Complex.from_dir(BRD_DATA_DIR)
Find pockets¶
We find pockets in the protein using:
pockets = sim.protein.find_pockets(pocket_count=1)
We can visualize the pocket using:
sim.protein.show(pockets=pockets)
You should see something along the lines of:
We can see that the protein is shown together with the identified pocket in red.
The Pocket Finder Function
For more details on how to use the Pocket Finder, look at the How To section for the Pocket Finder.
The pocket object can be inspected, too:
pocket
Expected Output
Pocket:
╭─────────────────────────┬──────────────╮
│ Name │ pocket_1 │
├─────────────────────────┼──────────────┤
│ Color │ red │
├─────────────────────────┼──────────────┤
│ Volume │ 545.0 ų │
├─────────────────────────┼──────────────┤
│ Total SASA │ 1560.474 Ų │
├─────────────────────────┼──────────────┤
│ Polar SASA │ 762.11224 Ų │
├─────────────────────────┼──────────────┤
│ Polar/Apolar SASA ratio │ 0.95459515 │
├─────────────────────────┼──────────────┤
│ Hydrophobicity │ 15.903226 │
├─────────────────────────┼──────────────┤
│ Polarity │ 17.0 │
├─────────────────────────┼──────────────┤
│ Drugability score │ 0.83243614 │
╰─────────────────────────┴──────────────╯
Estimate the cost of a docking run¶
To estimate the cost of docking all the Ligands in the Complex to the Protein, using the pocket we found, we can do:
pocket = pockets[0] # or choose as needed
jobs = sim.docking.run(pocket=pocket)
We get back a widget representing the Jobs that will run. These Jobs are in the Quoted state, and provide an estimate of how much this will cost.
Example widget
Prices shown here are for demonstrative purposes only. Actual prices can vary.
Start the docking run¶
To approve this Job and start all executions, use:
jobs.confirm()
jobs
The jobs object now reflects the Running state of all executions.
To monitor the progress of this Docking Job, use:
jobs.watch()
jobs
The widget will update as ligands are docked, as shown below:
Controlling batch size
By default, all ligands are docked in batches of 32 ligands.
This can be controlled in two ways. First, you can control the batch size using the batch_size parameter.
sim.dock(
batch_size=32,
...
)
You can also specify the number of workers using:
sim.dock(
n_workers=2,
...
)
You can specify either the number of workers or the batch size, but not both.
Monitoring jobs
For more details about how to monitor jobs, look at this How To section.
Results¶
Viewing results¶
After completion of docking, we can retrieve docked poses using:
poses = sim.docking.get_poses()
Each docked pose is assigned a Pose Score and a Binding Energy.
- The
pose_scoreis a score that evaluates the quality of each ligand's pose, where higher scores indicate better predicted binding poses. This score can be more informative than binding energy for identifying the optimal conformation. - The
binding_energyis the predicted binding energy typically used to estimate the strength of interaction between the ligand and the protein. The units are in kcal/mol and generally the lower energy scores (more negative values) mean higher chances that the ligand would bind to the protein strongly.
We can view the pose scores and binding energies of all ligands using:
poses.plot()
This generates an interactive scatter plot similar to:
Viewing docked poses¶
To view the docked poses of all ligands in the complex, use:
sim.docking.show_poses()
Exporting for further analysis¶
Poses can be converted into a dataframe for further analysis or export:
df = poses.to_dataframe()
Filtering poses¶
You typically want to filter these poses to only retain the top pose for each ligand. To do that, use:
poses = poses.filter_top_poses()