Cross docking study with python #Vina #Pymol #RDKit

I hope reader doing well and having nice weekend. Due to COVID-19 pandemic, our life is dramatically changed. I would like to go camp with my family when the pandemic is over.

Last month, I wrote post about self docking (how to prepare input file and run vina from python) with vina-python API.

Today I would like to show how to run cross docking with vina.

At first, I need to prepare pdbqt file of receptor and ligands which are used for docking study. For convenience, I used sample data from Stefano Forli et al., fortunately SI provides ligand file as pdbqt format. So I used the data for ligand and used receptor file as same as previous post.

OK, let’s write code and run docking study at my home ;)

Most of part is same as self docking but ligand is different.

from rdkit import Chem
from rdkit.Chem.rdMolTransforms import ComputeCentroid
from pathlib import Path
lig = Chem.SDMolSupplier('../1iep_ligandH.sdf', removeHs=False)[0]
centroid = ComputeCentroid(lig.GetConformer())

from vina import Vina

import glob
# I picked up few files for the test.
lig_files = glob.glob('../data/ligands/*.pdbqt')
> ['../data/ligands/ZINC00000179.pdbqt', '../data/ligands/imatinib.pdbqt', '../data/ligands/ZINC00000570.pdbqt', '../data/ligands/ZINC00000171.pdbqt']

# centroid is required for docking box definition.
print(centroid.x, centroid.y, centroid.z)
> 15.6138918918919 53.38013513513513 15.45483783783784

# main part of docking study.
# Used for loop and run dock with each ligand, it'll take few sec per lingad.
for lig in lig_files:
    fname = Path(lig).stem
    v = Vina(sf_name='vina')
    v.compute_vina_maps(center=[centroid.x, centroid.y, centroid.z], box_size=[20, 20, 20])
    energy_minimized = v.optimize()
    print('Score after minimization : %.3f (kcal/mol)' % energy_minimized[0])
    v.write_pose(f'{fname}_minimized.pdbqt', overwrite=True)
    v.dock(exhaustiveness=8, n_poses=5)
    v.write_poses(f'1iep_{fname}_vina_out.pdbqt', n_poses=10, overwrite=True)

After running the code shown above, I got docking pose of each ligand as pdbqt format. I would like to check the pose on PyMol, so I wrote additional code for combine all docked pose and receptor. During the process, I split the state of each ligand and grouped them. By using group command of pymol, you can select each ligand very easily.

The code is shown here.

from pymol import cmd
receptor = '../generatedfile/1iep_receptor.pdbqt'
docked_ligands = glob.glob('1iep_ZINC*_vina_out.pdbqt')

for l in docked_ligands:
    target_obj = l.replace('.pdbqt', '')
    # each ligand will have max 10 states so I split them 
    # Then delete original object and group split object with group command ;)
    cmd.delete(target_obj), target_obj+'*')'vina_docked_complex.pse')

Now I could get a pse file which has receptor and all docked ligand structure. Let’s check it ;)
Following image is screenshot of pse file. I aligned 2hyy(human ABL-imatinib’white’ complex) to my prepared receptor from 1iep(human ABL-imatinib’ping’ comlex). As you can see, both imatinib is well aligned it means that auto dock could predict accurate binding pose.

And also ligands from ZINC are shown in different color. The receptor is inactive form(DFG out form) so ligands from ZINC binds deep in the pocket and doesn’t show any significant interaction with hing region. Kinase is good target for drug discovery and suitable target for SBDD but still difficult to define state of pocket and predict its dynamics I think.

There are lots of tools for doing docking study for drug discovery but Vina is an interesting tool for me because it can call from python, it indicates that by using vina it’s easy to integrate many useful packages such as rdkit, openbabel, openeye, pymol etc. etc. ;)

Thanks for reading my post and hope everyone have a nice weekend and stay safe!

Here is a my code.


Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: