In [1]:
from dotenv import load_dotenv

load_dotenv()
Out[1]:
True
In [2]:
%load_ext autoreload
%autoreload 2

Docking a single ligand¶

This notebook shows you how to dock a single ligand to a protein

Setup¶

First, we'll import the necessary Deep Origin drug discovery modules.

In [3]:
from deeporigin.drug_discovery import (
    BRD_DATA_DIR,
    Pocket,
    Protein,
    Docking,
    Ligand,
)
from deeporigin.platform import DeepOriginClient
import deeporigin

deeporigin.__version__
Out[3]:
'0.0.0.dev0'

You don't have to explictitly initialize a client, but you can if you want:

In [4]:
client = DeepOriginClient()
client
/home/runner/work/do-dd-client/do-dd-client/.venv/lib/python3.11/site-packages/jwt/api_jwt.py:147: InsecureKeyLengthWarning: The HMAC key is 6 bytes long, which is below the minimum recommended length of 32 bytes for SHA256. See RFC 7518 Section 3.2.
  return self._jws.encode(
Out[4]:
DeepOrigin Platform Client for Local User (org_key=deeporigin, base_url=http://127.0.0.1:4931/)

Load protein and register on the platform¶

We use the same BRD protein as registered_protein in tests/test_functions_with_data_platform.py: load brd.pdb, remove waters, then sync so the structure exists on the platform for docking.

In [5]:
protein = Protein.from_file(BRD_DATA_DIR / "brd.pdb")
protein.remove_water()
protein.sync()
protein.id
Out[5]:
'brd'
In [6]:
## Load ligand
In [7]:
ligand = Ligand.from_sdf(BRD_DATA_DIR/"brd-2.sdf")
ligand.sync()
ligand
<rdkit.Chem.rdchem.Mol object at 0x7fc35e1a43c0>
Out[7]:
In [8]:
ligand.id
Out[8]:
'brd-2'

Work with a pocket¶

Here, we will use a previously identified novel pocket using the PocketFinder tool.

In [9]:
pockets = Pocket.from_result(protein_id=protein.id)
pocket = pockets[0]
pocket
Out[9]:
Pocket:
╭─────────────────────────┬──────────────────────────────────────╮
│ Name                    │ pocket_1                             │
├─────────────────────────┼──────────────────────────────────────┤
│ ID                      │ c002d6b3-0d66-4265-91db-8bec0392751d │
├─────────────────────────┼──────────────────────────────────────┤
│ Protein ID              │ brd                                  │
├─────────────────────────┼──────────────────────────────────────┤
│ Color                   │ red                                  │
├─────────────────────────┼──────────────────────────────────────┤
│ Center                  │ (-13.52, -4.94, 15.46)               │
├─────────────────────────┼──────────────────────────────────────┤
│ Box size                │ 14.00 × 14.00 × 19.00 Å              │
├─────────────────────────┼──────────────────────────────────────┤
│ Volume                  │ 300 ų                               │
├─────────────────────────┼──────────────────────────────────────┤
│ Total SASA              │ 1225.8883 Ų                         │
├─────────────────────────┼──────────────────────────────────────┤
│ Polar SASA              │ 309.8629 Ų                          │
├─────────────────────────┼──────────────────────────────────────┤
│ Polar/Apolar SASA ratio │ 0.3382689                            │
├─────────────────────────┼──────────────────────────────────────┤
│ Hydrophobicity          │ 29.92                                │
├─────────────────────────┼──────────────────────────────────────┤
│ Polarity                │ 10                                   │
├─────────────────────────┼──────────────────────────────────────┤
│ Drugability score       │ 0.94304204                           │
╰─────────────────────────┴──────────────────────────────────────╯

Estimate cost¶

In [10]:
docking = Docking(protein=protein, pocket=pockets[0], ligand=ligand)
In [11]:
docking.quote()
docking.estimate
Out[11]:
0.2
In [12]:
docking.effort = 1

Dock ligand¶

In [13]:
poses = docking.run()
Downloading files:   0%|          | 0/16 [00:00<?, ?file/s]
Downloading files:  19%|█▉        | 3/16 [00:00<00:00, 29.53file/s]
Downloading files: 100%|██████████| 16/16 [00:00<00:00, 103.18file/s]

Show pocket¶

In [14]:
protein.show(poses=poses)
In [15]:
poses[0].properties
Out[15]:
{'SMILES': 'CN(C)C(=O)c1cccc(-c2cn(C)c(=O)c3[nH]ccc23)c1',
 'Binding Energy': '-8.961081',
 'POSE SCORE': '0.89840794',
 'initial_smiles': 'CN(C)C(=O)c1cccc(-c2cn(C)c(=O)c3[nH]ccc23)c1',
 '_Name': 'DO_2099252_2',
 '_SMILES': 'CN(C)C(=O)c1cccc(-c2cn(C)c(=O)c3[nH]ccc23)c1'}
In [16]:
client.results.get_poses(compute_job_id=docking.id, best_pose=True)
Out[16]:
{'data': [], 'meta': {'count': 0}}
In [ ]: