Unreleased code
This page describes APIs and workflows for which we haven't released a package yet. This functionality is coming soon!
Docking¶
This document describes how to dock ligands to a protein using Deep Origin tools.
Prerequisites¶
First, import the necessary classes:
from deeporigin.drug_discovery import (
BRD_DATA_DIR,
Docking,
Ligand,
Pocket,
PocketFinder,
Protein,
)
Load protein¶
Load a protein from a PDB file and remove water molecules:
protein = Protein.from_file(BRD_DATA_DIR / "brd.pdb")
protein.remove_water()
Sync the protein to the platform so it can be used for docking:
protein.sync()
Load ligand¶
Load a ligand from an SDF file:
ligand = Ligand.from_sdf(BRD_DATA_DIR / "brd-2.sdf")
Sync the ligand to the platform and to your project:
ligand.sync()
Find pockets in Protein¶
Run Pocket Finder on the synced protein to detect binding sites. Create a PocketFinder with that protein (use pocket_count to request more than one pocket), then call run() to execute the tool and get a list of Pocket objects:
pf = PocketFinder(protein, pocket_count=1)
pockets = pf.run()
pocket = pockets[0]
We can visualize the pocket using:
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¶
Create a Docking object with the protein, pocket, and ligand, then get a cost estimate:
docking = Docking(protein=protein, pocket=pocket, ligand=ligand)
docking.quote()
docking.estimate
The estimate property shows the predicted cost in dollars for the docking run.
Controlling effort
By default, the docking effort level is 3 (on a scale of 1–5). Lower effort is faster, higher effort is more thorough.
docking.effort = 1
Start the docking run¶
To run docking synchronously (blocking), use:
poses = docking.run()
The returned poses is a LigandSet containing the docked poses.
Monitoring jobs
For more details about how to monitor jobs, look at this How To section.
Results¶
Viewing results¶
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.
When you load tabular results with docking.get_results(), each row includes a best_pose boolean: True for the single pose with the highest pose_score among poses for that ligand (for example, one of sixteen poses per ligand), and False for the others.
You can inspect the properties of individual poses:
poses[0].properties
Viewing docked poses¶
To visualize the docked poses on the protein, use:
protein.show(poses=poses)
Retrieving poses from the platform¶
For async docking runs, you can retrieve docked poses after completion:
poses = docking.get_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()