Skip to content

Docking

This document describes how to dock a set of ligands to a protein using Deep Origin tools.

Prerequisites

We assume that we have an initialized and configured a Complex object:

from deeporigin.drug_discovery import Complex, EXAMPLE_DATA_DIR

sim = Complex.from_dir(EXAMPLE_DATA_DIR) # or replace with your folder

For more details on how to get started, see Getting Started .

Find pockets

First 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:

Starting a docking run

Using pocket

To dock all ligands in the complex to the protein, using the pocket we found, we can do:

pocket = pockets[0] # or choose as needed
sim.docking.run(pocket=pocket)

Using residue ID

Coming Soon

Ability to dock ligands using a residue ID is coming soon.

Using pocket center and box size

To dock all ligands to the protein, parallelizing and batching across all ligands, we do the following:

job = sim.docking.run(
    box_size=(15, 15, 15),      # match to your protein
    pocket_center=(13, -6, 22), # match to your protein
)
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.

This queues up tasks on Deep Origin. When it completes, the results of docking can be viewed.

Viewing status of docking

A job object is returned from docking.run. This job object can be inspected to show the status of the job when created.

The job object can also be used monitor a job as it completes:

job.watch()

Doing so creates a widget that automatically updates and monitors a job as long as its running.

To stop watching a job, do:

job.stop_watching()

Results

Viewing results

After completion of docking, we can view results using:

sim.docking.show_results()

This shows a table similar to:

Docking results

Viewing docked poses

To view the docked poses of all ligands in the complex, use:

sim.docking.show_poses()

Exporting for further analysis

To obtain the raw dataframe for further analysis, use:

df = sim.docking.get_results()

Exporting a SDF with docked poses

To export a SDF with docked poses, use:

sim.docking.get_poses("/path/to/output.sdf")

This generates a SDF file with the docked poses for all ligands in the Complex.