{ "cells": [ { "cell_type": "markdown", "id": "6951e168-585b-426c-8bd9-bbbef8a1e14e", "metadata": {}, "source": [ "# Molecular docking\n", "\n", "This is the main protocol of Jupyter Dock.\n", "\n", "## Content of this notebook\n", "\n", "1. Feching system and cleanup\n", "2. Protein and ligand sanitization\n", "3. System Visualization \n", "4. Docking with AutoDock Vina\n", " - Receptor preparation\n", " - Ligand preparation\n", " - Docking box definition\n", " - Docking\n", " - PDBQT results file conversion to SDF\n", " - 3D visualization of docking results\n", " - 2D interaction table and map\n", "5. Docking with Smina\n", " - Receptor preparation\n", " - Ligand preparation\n", " - Docking box definition\n", " - Docking\n", " - 3D visualization of docking results\n", " - 2D interaction table and map\n", "6. Docking with LeDock\n", " - Receptor preparation\n", " - Ligand preparation\n", " - Docking box definition\n", " - Docking\n", " - DOK results file conversion to SDF\n", " - 3D visualization of docking results\n", " - 2D interaction table and map" ] }, { "cell_type": "code", "execution_count": 1, "id": "756603a6-b74c-48e2-a532-0a1a26c56d53", "metadata": {}, "outputs": [], "source": [ "from pymol import cmd\n", "import py3Dmol\n", "\n", "from vina import Vina\n", "\n", "from openbabel import pybel\n", "\n", "from rdkit import Chem\n", "from rdkit.Chem import AllChem, Draw\n", "\n", "from meeko import MoleculePreparation\n", "from meeko import obutils\n", "\n", "import MDAnalysis as mda\n", "from MDAnalysis.coordinates import PDB\n", "\n", "import prolif as plf\n", "from prolif.plotting.network import LigNetwork\n", "\n", "\n", "import sys, os\n", "sys.path.insert(1, 'utilities/')\n", "from utils import fix_protein, getbox, generate_ledock_file, pdbqt_to_sdf, dok_to_sdf\n", "\n", "\n", "import warnings\n", "warnings.filterwarnings(\"ignore\")\n", "%config Completer.use_jedi = False" ] }, { "cell_type": "markdown", "id": "2c9e45cc-2e28-4e83-9d2d-3c922b46db66", "metadata": {}, "source": [ "It's a good idea to run the test protocols before attempting custom projects. Later, the user can specify the location of his/her project and save all of the files separately." ] }, { "cell_type": "code", "execution_count": 2, "id": "f34f98c3-1454-4f67-92b7-ce9cf054c333", "metadata": {}, "outputs": [], "source": [ "os.chdir('test/Molecular_Docking/')" ] }, { "cell_type": "markdown", "id": "72001c44-17ca-4518-ad7f-d0db24f68063", "metadata": {}, "source": [ "## 1. Feching system and cleanup\n", "\n", "Implementing Pymol is a simple way to download PDB structures. The user can launch this or any other Jupyter Dock's protocol by providing his or her own files." ] }, { "cell_type": "code", "execution_count": 3, "id": "050514b3-d554-43ab-ba1e-62c1cb95458b", "metadata": {}, "outputs": [], "source": [ "cmd.fetch(code='1AZ8',type='pdb1')\n", "cmd.select(name='Prot',selection='polymer.protein')\n", "cmd.select(name='Lig',selection='organic')\n", "cmd.save(filename='1AZ8_clean.pdb',format='pdb',selection='Prot')\n", "cmd.save(filename='1AZ8_lig.mol2',format='mol2',selection='Lig')\n", "cmd.delete('all')" ] }, { "cell_type": "markdown", "id": "fe52106e-292c-4ff3-87bc-de5265368853", "metadata": {}, "source": [ "## 2. Protein and ligand sanitization" ] }, { "cell_type": "markdown", "id": "98f22f10-f62b-4526-a523-9cd629d6f353", "metadata": {}, "source": [ "### 2.1. Protein Sanitization" ] }, { "cell_type": "markdown", "id": "5dec3aa7-6554-41ba-8a66-1f3e82214235", "metadata": {}, "source": [ "#### Method 1: LePro\n", "\n", "The Lephar molecular docking suite includes a very powerful tool for automatically preparing proteins for molecular docking. As a result, for these protocols, it will be the preferred tool for protein preparation. The protein prepared by LePro can be used in AutoDock VIna and LeDock." ] }, { "cell_type": "code", "execution_count": 4, "id": "64e129bc-3d92-4172-ab66-f0f515f55916", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "************************************************************\n", "* LePro *\n", "* Add hydrogen atoms to a protein & *\n", "* write the input file for LeDock *\n", "* Copyright (C) 2013-14 Hongtao Zhao, PhD *\n", "* Email: htzhaovv@gmail.com *\n", "************************************************************\n", "----------Usage: \n", " lepro [PDB file] [-rot || -metal || -p] \n", " -rot [[chain] resid] align principal axes of the binding site with Cartesian\n", " -metal keep ZN/MN/CA/MG \n", " -metal -p redistribute metal charge to protein \n", "\n" ] } ], "source": [ "!../../bin/lepro_linux_x86 # Launch this cell to see parameters" ] }, { "cell_type": "code", "execution_count": 5, "id": "836973a5-248f-43ba-a1f9-345c2cded6b0", "metadata": {}, "outputs": [], "source": [ "!../../bin/lepro_linux_x86 {'1AZ8_clean.pdb'}\n", "\n", "os.rename('pro.pdb','1AZ8_clean_H.pdb') # Output from lepro is pro.pdb, this line will change the name to '1AZ8_clean_H.pdb'" ] }, { "cell_type": "markdown", "id": "e89ca421-ab3a-4af4-8160-bcc9f2334beb", "metadata": {}, "source": [ "#### Method 2: fix_protein (PDBFixer)\n", "\n", "For proteins with missing amino acids or residues, or to ensure a more thorough sanitization of protein Jupyter Dock includes the _fix_protein()_ function, which employs PDBFixer to correct a wide range of common errors in protein pdb files. Furthermore, PDBFixer enables the assignment of pH-dependent protonation states to proteins.\n", "\n", "\n", ">**Warning 1:** It is possible to encounter problems with protein fixing when using **_fix_protein()_** and AutoDock Tools' **_prepare_receptor_** or when running LeDock. To resolve the issue, it is best to set the parameter _-A hydrogens_ in _prepare receptor_.\n", "\n", "\n", ">**Hint:** PDBFixer is a great solution for many systems because it can solve serious problems in PDB files. As a result, PDBFixer renumbers the residues beginning with 1 regardless of the numbering on the original PDB file. To address this issue, the **_fix_protein()_** function includes a protocol for atomically renumbering the residues in accordance with the original PDB file.\n", "\n", "\n", "**_fix_protein ( params )_**\n", "\n", "Params:\n", " \n", " - **filename**: _str or path-like_ ; input file containing protein struture to be modified, file extrension must be pdb\n", "\n", " - **addHs_pH**: _float_ ; Add hydrogens at user defined pH\n", "\n", " - **try_renumberResidues**: _bool_ ; By default PDBFixer renumarets residues starting in 1, this option tries to recover originar residues numbering\n", " \n", " - **output**: _str or path-like_ ; output filename, extension must be pdb" ] }, { "cell_type": "markdown", "id": "e1e6f4b6-d96a-458b-9b33-3f4846ff3e68", "metadata": {}, "source": [ "```\n", "fix_protein(filename='1AZ8_clean.pdb',addHs_pH=7.4,try_renumberResidues=True,output='1AZ8_clean_H.pdb')\n", "```" ] }, { "cell_type": "markdown", "id": "2a4fc4a8-a5bc-4cb1-a329-dc1c52db032b", "metadata": {}, "source": [ "### 2.2. Ligand sanitization\n", "\n", "Due to the variability of ligands and formats, ligand sanitization and preparation can be one of the most difficult tasks to complete. Setting protonation states for a ligand, for example, can be difficult. It is highly recommended that the user knows and understands the proper states for his/her ligand(s) when using Jupyter Dock or any other molecular docking approach.\n", "\n", "In this example, after splitting the ligand and protein after fetching with pymol, the ligand has sanitization problems **(sanitize=False in Chem.MolFromMol2File)**" ] }, { "cell_type": "code", "execution_count": 6, "id": "c461429c-3036-43a0-8ec9-ba3e854c045f", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "RDKit WARNING: [16:39:50] 1AZ8: Warning - no explicit hydrogens in mol2 file but needed for formal charge estimation.\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAfZklEQVR4nO3deVxU5f4H8O8MDJsIDAy7oCBo4G6pmKmpGOYW0KUUS0vTX9o1f9RVEvmBXq9G7mXeFpfS1BJNyy0TktsNFZcMEERSUBaRfWRngJnn98dBJNkGnOHR4fP+w9eZM2fO8x1ffOZ5zjPnnBExxggA+BHzLgCgq0MIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4QwgBOEMIAThDCAE4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+mppzq4cx6XMimVNG4cSSS0cSP16EG//UZvv02hobR4scabqqmpyc7Obtxhpqen3759W6VSNd5MIpHU1tZOnjz5yJEjBgYGGi/jEeXm5jo7O4tEoqysLBsbG97ltE9VVdVDMwiNH2ZlZdU2mUYcPnz4xYsXvb29N2/e3L9/fy5lNxYbGxsRoTxxYqyBAf3f/9EHH1BdHa1cSf/+N82bR5s312+2axetWUN//kntPY7hdD1hWRmtXElHj5JcTm5utHgxzZrVaY1XVlY2dJXCv3p6erNmzQoMDHz0qR0t8fX1/fHHH9etW7d06VLetfxFcXFxTk5OQz929+7dvLy8goKCnJwcoYurq6trfQ9WVla2trbW1tYODg42NjY2Nja3bt369ttvKyoqJBLJ/Pnzw8LCbG1tO+ftPKS6unrlypUbNmywtrZzdb36739LBw2iS5dozhxKSSF9fdq7l1599ZGb0fQXmKAVx48fJ6LevXur+J3A8JC0tDQ/Pz8fH5/W/8CMjIxcXV1HjRo1derUBQsWhIeHb9myJTIy8rfffktLS1MoFM3uPD8//9133xWOC7p16xYcHFxSUtLJb/DChQseHh5EpK+vHxwcrFAoampYRASTSBgR8/RkFy9qpiGE8MmgVCqdnZ2JKCYmhnctTKFQrF692tjYmIg8PDw8PT2ff/75wMDAJUuWrF279quvvjp+/Pjvv/+enZ39iNdDXr9+PSAgQPiqViaTRUREtBRazaqtrV2xYoXwEeDp6Xnp0iXG2B9//PH552f09JieHlu6lFVVaaw5hPCJERYWRkSBgYF8y/jPf/7j6ekp9HIBAQF5eXnabvH8+fOjR48WWuzTp09kZKS2hwNKpXLs2LFisXj48OFeXl4JCQkREREGBgb29vZr1xadPavh5nCPmSdGVlaWi4uLvr5+dna2TCbr/ALy8vKWLl0q3NrD3d1927ZtmpqtLS0tLSsrc3R0bGWb6OjooKCgpKQkIho+fPi6devGjh3b4Rbv3btXWlpaUlJSel9JScm9e/ca1ty9e9fb23v79u03b94UiUSMMZFINH/+/I0bN5qamna43WYhhE+SyZMn//TTT1u2bFmyZElntssY++abb957772ioiJ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GUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMAZQgjAGUIIwBlCCMDZ/wPcL4Y/OHZtSgAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m=Chem.MolFromMol2File('1AZ8_lig.mol2',sanitize=False)\n", "Draw.MolToImage(m)" ] }, { "cell_type": "markdown", "id": "91191a7d-809f-4d0e-a128-9f9d43ffb695", "metadata": {}, "source": [ ">**Hint:** One solution for simple sanitization problems is to use OpenBAbel to convert the molecule and add the necessary hydrogens for molecular docking (Pybel). The definitions for carrying out molecules in OpenBabel differ from those in RDKIt. As a result, OpenBabel is capable of handling the conversion." ] }, { "cell_type": "code", "execution_count": 7, "id": "3076da38-9420-4e3c-8bb9-4c99eae74f27", "metadata": {}, "outputs": [], "source": [ "mol= [m for m in pybel.readfile(filename='1AZ8_lig.mol2',format='mol2')][0]\n", "mol.addh()\n", "out=pybel.Outputfile(filename='1AZ8_lig_H.mol2',format='mol2',overwrite=True)\n", "out.write(mol)\n", "out.close()" ] }, { "cell_type": "markdown", "id": "216f2eaf-511c-4fa0-9be8-339b5714e615", "metadata": {}, "source": [ "The end result of ligand sanitization is a new molecule that RDKit can display without having to use the sanitization parameter. Furthermore, the output structure for this example corresponds exactly to the one reported in the PDB database (PDB 1AZ8)" ] }, { "cell_type": "code", "execution_count": 8, "id": "8473f062-aade-45ca-a18b-463545341c41", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc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vcs1WgcvsMCBRTFZelGpc8Or2iMXO2bvanauVnjYTZdhCkWF3FPyYi9CpKKbRZayug1nMLpJkXoDXljKsoUSf7uwKrH4xpFJeYjPAqvTUa6Jic7EWuXjqgJieNY1uUELR2xwxzuQCWEOJ3eQja/Q+jaDVGgX5RJGdF/fqNA5bW0UzL1E3rfWuxrZdlVZf23vMSqWjtbm1sRyk7cTx3E5Yth2LYbk7ck3II3jEetnOHS0smvuGI/P7ZkZL7Bs5/MPB0zk6MG80tN0BNp2waGzHG21uEU2bWxwT3Z132XS7ibPDoeszvkE3uUlofjrXZ03P/9DKwf7pa2svb8/HX4XrYYq+iM+5AAABRnpUWHRTTUlMRVMgcmRraXQgMjAyMS4wMy41AAB4nEWRS2rEQAxEr5KlDUa0pNaPJhDwJquZA4SsfI05fCQ5Ict+Lqmq5PN5bu/P/fw6Pz6/t/O88LquLdljf+zXhXuDf4Jvr40ExjxwgGscGGCkixSmSEGbDZXmIgP0ZqEHeiqohMotLGbAOetggwqJWemEbVGAeOoQprdQpy9GGOWJwNIwGAsqHZH7ZiEbspgBSWvjYC7o2NBTprdHhC4WwJjJfjMPk2JRMwOIvC3S1v7KMUoNj3T1tMCc9eoRlauZ4l04+2jOUi2kvpYOKeZIHUW68bQoaKjVmDSzEcRoZyPs23gqGUT6hm5cUEa+JgRxw3krMaHkNbqzSvTOia00LSPhNpoepbSqmPkMCyJjh7b+RsSL84CI9ULn2oJx/5kKyGnUjUR1f/0ADQl4IaZ2VpwAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m=Chem.MolFromMol2File('1AZ8_lig_H.mol2')\n", "m" ] }, { "cell_type": "markdown", "id": "f1db2b5f-d083-4640-8b29-8b6ee4ba2d37", "metadata": {}, "source": [ "## 3. System Visualization\n", "\n", "A cool feature of Jupyter Dock is the posibility of visualize ligand-protein complexes and docking results into the notebbok. All this thanks to the powerful py3Dmol. \n", "\n", "Now the protein and ligand have been sanitized it would be recomended to vissualize the ligand-protein reference system." ] }, { "cell_type": "code", "execution_count": 9, "id": "77c37840-7880-4a12-84a3-feaeb794e726", "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "view = py3Dmol.view()\n", "view.removeAllModels()\n", "view.setViewStyle({'style':'outline','color':'black','width':0.1})\n", "\n", "view.addModel(open('1AZ8_clean_H.pdb','r').read(),format='pdb')\n", "Prot=view.getModel()\n", "Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})\n", "view.addSurface(py3Dmol.VDW,{'opacity':0.6,'color':'white'})\n", "\n", "\n", "view.addModel(open('1AZ8_lig_H.mol2','r').read(),format='mol2')\n", "ref_m = view.getModel()\n", "ref_m.setStyle({},{'stick':{'colorscheme':'greenCarbon','radius':0.2}})\n", "\n", "view.zoomTo()\n", "view.show()" ] }, { "cell_type": "markdown", "id": "e4114eb4-1614-44df-b837-f695bd3ead01", "metadata": {}, "source": [ "## 4. Docking with AutoDock Vina\n", "\n", "AutoDock Vina (Vina) is one of the docking engines in the AutoDock Suite, together with AutoDock4 (AD4), AutoDockGPU, AutoDockFR, and AutoDock-CrankPep, and arguably among the most widely used and successful docking engines. The reasons for this success are mostly due to its ease of use and its speed (up to 100x faster than AD4), when compared to the other docking engines in the suite and elsewhere, as well as being open source." ] }, { "cell_type": "markdown", "id": "f79f6541-a4ee-44e8-b837-f939ce818ef2", "metadata": {}, "source": [ "### 4.1. Protein preparation\n", "\n", "After sanitization, the protein docking preparation includes converting it to the PDBQT file format, which stores the atomic coordinates, partial charges, and AutoDock atom types for both the receptor and the ligand. \n", "\n", ">**Hint:** Despite the fact that the PDBQT format includes changes (Q) and atom types (T) for molecular docking. The charges are not required for Autodock Vina, which computes electrostatic interactions using its own force field. Although, when using AutoDock instead of AutoDock Vina, the Q term is required. More information can be found here:https://autodock-vina.readthedocs.io/en/latest/introduction.html\n", "\n", "#### Method 1: AutoDock Tools prepare_receptor\n", "\n", "The AutoDock Tools are the best way to prepare the receptor for AutoDock Vina. Nonetheless, AutoDock Tools is a comprehensive suite of programs and scripts that are difficult to manage. Jupyter Dock execute the **_prepare receptor_** and **_prepare_ligand_** functions on their own. As a result, obtaining proper PDBQT files for AutoDock Vina has never been easier.\n", "\n", ">**Warning:** There is currently only one method for preparing a PDBQT file for a receptor. It is expected that new methods apart from AutoDock Tools executables will be included in the near future into Jupyter Dock." ] }, { "cell_type": "code", "execution_count": 10, "id": "05df2f33-3b02-4545-870d-aa467323cf8b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "prepare_receptor4: receptor filename must be specified.\n", "Usage: prepare_receptor4.py -r filename\n", "\n", " Description of command...\n", " -r receptor_filename \n", " supported file types include pdb,mol2,pdbq,pdbqs,pdbqt, possibly pqr,cif\n", " Optional parameters:\n", " [-v] verbose output (default is minimal output)\n", " [-o pdbqt_filename] (default is 'molecule_name.pdbqt')\n", " [-A] type(s) of repairs to make: \n", " 'bonds_hydrogens': build bonds and add hydrogens \n", " 'bonds': build a single bond from each atom with no bonds to its closest neighbor\n", " 'hydrogens': add hydrogens\n", " 'checkhydrogens': add hydrogens only if there are none already\n", " 'None': do not make any repairs \n", " (default is 'None')\n", " [-C] preserve all input charges ie do not add new charges \n", " (default is addition of gasteiger charges)\n", " [-p] preserve input charges on specific atom types, eg -p Zn -p Fe\n", " [-U] cleanup type:\n", " 'nphs': merge charges and remove non-polar hydrogens\n", " 'lps': merge charges and remove lone pairs\n", " 'waters': remove water residues\n", " 'nonstdres': remove chains composed entirely of residues of\n", " types other than the standard 20 amino acids\n", " 'deleteAltB': remove XX@B atoms and rename XX@A atoms->XX\n", " (default is 'nphs_lps_waters_nonstdres') \n", " [-e] delete every nonstd residue from any chain\n", " 'True': any residue whose name is not in this list:\n", " ['CYS','ILE','SER','VAL','GLN','LYS','ASN', \n", " 'PRO','THR','PHE','ALA','HIS','GLY','ASP', \n", " 'LEU', 'ARG', 'TRP', 'GLU', 'TYR','MET', \n", " 'HID', 'HSP', 'HIE', 'HIP', 'CYX', 'CSS']\n", " will be deleted from any chain. \n", " NB: there are no nucleic acid residue names at all \n", " in the list and no metals. \n", " (default is False which means not to do this)\n", " [-M] interactive \n", " (default is 'automatic': outputfile is written with no further user input)\n", " [-d dictionary_filename] file to contain receptor summary information\n", " [-w] assign each receptor atom a unique name: newname is original name plus its index(1-based)\n" ] } ], "source": [ "!../../bin/prepare_receptor #Lauch this cell to see parameters" ] }, { "cell_type": "code", "execution_count": 11, "id": "d182cce2-1805-42ff-bbdd-53e3b5a9fe75", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "set verbose to True\n", "set receptor_filename to 1AZ8_clean_H.pdb\n", "set outputfilename to 1AZ8_clean_H.pdbqt\n", "read 1AZ8_clean_H.pdb\n", "setting up RPO with mode= automatic and outputfilename= 1AZ8_clean_H.pdbqt\n", "charges_to_add= gasteiger\n", "delete_single_nonstd_residues= None\n", "adding gasteiger charges to peptide\n" ] } ], "source": [ "!../../bin/prepare_receptor -v -r {'1AZ8_clean_H.pdb'} -o {'1AZ8_clean_H.pdbqt'}" ] }, { "cell_type": "markdown", "id": "8203e23c-a4be-4b29-b609-b543d86e1b56", "metadata": {}, "source": [ "### 4.2. Ligand preparation\n", "\n", "As previously discussed, one of the major challenges for proper docking experimentation is ligand preparation.\n", "\n", ">**Hint:** The hydroges in this example were set during the ligand sanitization step (section 2.2). As a result, the ligand will be prepared as is. Furthermore, before running the docking, it is highly recommended to inspect the ligand(s) after preparation to ensure proper structure and molecule features.\n", "\n", "#### Method 1: AutoDock Tools prepare_ligand" ] }, { "cell_type": "code", "execution_count": 12, "id": "036f6af0-08c3-4b1f-9317-8379a22bb84e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "prepare_ligand4: ligand filename must be specified.\n", "Usage: prepare_ligand4.py -l filename\n", "\n", " Description of command...\n", " -l ligand_filename (.pdb or .mol2 or .pdbq format)\n", " Optional parameters:\n", " [-v] verbose output\n", " [-o pdbqt_filename] (default output filename is ligand_filename_stem + .pdbqt)\n", " [-d] dictionary to write types list and number of active torsions \n", " [-A] type(s) of repairs to make:\n", "\t\t bonds_hydrogens, bonds, hydrogens (default is to do no repairs)\n", " [-C] do not add charges (default is to add gasteiger charges)\n", " [-p] preserve input charges on an atom type, eg -p Zn\n", " (default is not to preserve charges on any specific atom type)\n", " [-U] cleanup type:\n", "\t\t nphs_lps, nphs, lps, '' (default is 'nphs_lps') \n", " [-B] type(s) of bonds to allow to rotate \n", " (default sets 'backbone' rotatable and 'amide' + 'guanidinium' non-rotatable)\n", " [-R] index for root\n", " [-F] check for and use largest non-bonded fragment (default is not to do this)\n", " [-M] interactive (default is automatic output)\n", " [-I] string of bonds to inactivate composed of \n", " of zero-based atom indices eg 5_13_2_10 \n", " will inactivate atoms[5]-atoms[13] bond \n", " and atoms[2]-atoms[10] bond \n", " (default is not to inactivate any specific bonds)\n", " [-Z] inactivate all active torsions \n", " (default is leave all rotatable active except amide and guanidinium)\n", " [-g] attach all nonbonded fragments \n", " [-s] attach all nonbonded singletons: \n", " NB: sets attach all nonbonded fragments too\n", " (default is not to do this)\n", " [-w] assign each ligand atom a unique name: newname is original name plus its index(1-based)\n" ] } ], "source": [ "!../../bin/prepare_ligand #Launch this cell to see parameters" ] }, { "cell_type": "code", "execution_count": 13, "id": "35c34131-bda2-43ac-8a44-932d61016e7c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "set verbose to True\n", "set ligand_filename to 1AZ8_lig_H.mol2\n", "set outputfilename to 1AZ8_lig_H.pdbqt\n", "read 1AZ8_lig_H.mol2\n", "setting up LPO with mode= automatic and outputfilename= 1AZ8_lig_H.pdbqt\n", "and check_for_fragments= False\n", "and bonds_to_inactivate= \n", "returning 0\n", "No change in atomic coordinates\n" ] } ], "source": [ "!../../bin/prepare_ligand -v -l {'1AZ8_lig_H.mol2'} -o {'1AZ8_lig_H.pdbqt'}" ] }, { "cell_type": "markdown", "id": "0c3d96a3-2f37-4710-b132-b4b160fd76a3", "metadata": {}, "source": [ "#### Method 2: Meeko\n", "\n", "This is the preferred method out of AutoDock Tools. Apart from ligand preparation, Meeko provides tools for other docking aspects that the AutoDock Tools software suite does not cover. Hydrated docking and macrocycles are two examples. More about Meeko https://pypi.org/project/meeko/\n", "\n", ">**Info** To run Meeko change the next cell type from \"Markdown\" to \"Code\"." ] }, { "cell_type": "markdown", "id": "4bcf45df-7781-4243-bc89-881693c03875", "metadata": {}, "source": [ "```\n", "mol = obutils.load_molecule_from_file('1AZ8_lig_H.mol2')\n", "\n", "preparator = MoleculePreparation(merge_hydrogens=True,hydrate=False)\n", "preparator.prepare(mol)\n", "\n", "preparator.write_pdbqt_file('1AZ8_lig_H.pdbqt')\n", "```" ] }, { "cell_type": "markdown", "id": "c2e2b7a0-8e6d-4214-9997-d5cb363937ea", "metadata": {}, "source": [ "#### Method 3: Pybel\n", "\n", "OpenBabel (pybel) can handle a variety of file formats and conversions between them. As a result, any chemical format file can be converted directly to PDBQT. Nonetheless, pybel may encounter issues if the source file format contains errors. \n", "\n", ">**Info** To run Pybel change the next cell type from \"Markdown\" to \"Code\"." ] }, { "cell_type": "markdown", "id": "f0141f8b-86cf-4450-95d9-93dc58a34a1b", "metadata": {}, "source": [ "```\n", "ligand = [m for m in pybel.readfile(filename='1AZ8_lig_H.mol2',format='mol2')][0]\n", "out=pybel.Outputfile(filename='1AZ8_lig_H.pdbqt',format='pdbqt',overwrite=True)\n", "out.write(ligand)\n", "out.close()\n", "```" ] }, { "cell_type": "markdown", "id": "86513681-d4c6-438c-aa98-b3aa7513f830", "metadata": {}, "source": [ "### 4.3. Box definition\n", "\n", "This is possibly the most important feature of Jupyter Dock. Making a docking box without the use of a visualizer or any other additional tools. As a result, AutoDock Vina (and LeDock) can now be run entirely in a Jupyter notebook.\n", "\n", "Mengwu Xiao and his clever Pymol plug-in [\"GetBox\"](https://github.com/MengwuXiao/GetBox-PyMOL-Plugin) inspired the box definition in Jupyter Dock. \n", "\n", "Jupyter Dock makes use of Mengwu Xiao Pymol implementation, but this time through the Pymol API.\n", "\n", ">**Warning:** The function **_get_box()_** is built into the Pymol API. As a result, in order to compute the docking box, the docking system files must be initialized using Pymol.\n", "\n", ">**Hint:** The integration of **_get_box()_** as Pymol integration allows the definition of amazing boxes based on Pymol's powerful selection tools. A ligand, a residue, a set of residues, atom(s), pseudoatom(s), and any custom selection valid within the [Pymol selection algebra](https://pymolwiki.org/index.php/Selection_Algebra) can be used to set the box. " ] }, { "cell_type": "markdown", "id": "5c5d6834-ff67-48fa-85c7-e7e264a2438f", "metadata": {}, "source": [ "**_get_box( params )_**\n", "\n", "params:\n", "\n", " - **selection**: _str , pymol_selection_; The selection for docking box, can be atom, resn, resid, or any other pymol selection\n", " \n", " - **extending**: _float_; value to extend the boundaries of the selection\n", " \n", " - **software**: _str , 'vina','ledock', 'both'_ ; Depending on selected software the funtion will provide the box coordinates in vina, ledock, or both formats" ] }, { "cell_type": "code", "execution_count": 14, "id": "2c1b8f34-3443-4656-8c2e-0de373df7aef", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'center_x': 31.859049797058105, 'center_y': 13.347449779510498, 'center_z': 17.06589984893799} \n", " {'size_x': 24.56949806213379, 'size_y': 18.123299598693848, 'size_z': 17.374399185180664}\n" ] } ], "source": [ "cmd.load(filename='1AZ8_clean_H.pdb',format='pdb',object='prot')\n", "cmd.load(filename='1AZ8_lig_H.mol2',format='mol2',object='lig')\n", "\n", "center, size= getbox(selection='lig',extending=5.0,software='vina')\n", "\n", "cmd.delete('all')\n", "\n", "print(center,'\\n',size)" ] }, { "cell_type": "markdown", "id": "d9e3cd32-f577-4f76-b7e1-328a2f65c818", "metadata": {}, "source": [ "### 4.4. Docking \n", "\n", "AutoDock Vina 1.2.0, which was recently released, now allows AutoDock Vina to be executed using Python Bindings. Jupyter Dock takes advantage of this feature to make the docking protocol run entirely within a Jupyter notebook." ] }, { "cell_type": "code", "execution_count": 15, "id": "732c4d41-a58a-479f-95c5-024a48b4eae1", "metadata": {}, "outputs": [], "source": [ "v = Vina(sf_name='vina')\n", "\n", "v.set_receptor('1AZ8_clean_H.pdbqt')\n", "\n", "v.set_ligand_from_file('1AZ8_lig_H.pdbqt')\n", "\n", "v.compute_vina_maps(center=[center['center_x'], center['center_y'], center['center_z']], \n", " box_size=[size['size_x'], size['size_y'], size['size_z']])\n", "\n", "'''\n", "# Score the current pose\n", "energy = v.score()\n", "print('Score before minimization: %.3f (kcal/mol)' % energy[0])\n", "\n", "# Minimized locally the current pose\n", "energy_minimized = v.optimize()\n", "print('Score after minimization : %.3f (kcal/mol)' % energy_minimized[0])\n", "v.write_pose('1iep_ligand_minimized.pdbqt', overwrite=True)\n", "'''\n", "\n", "# Dock the ligand\n", "v.dock(exhaustiveness=10, n_poses=10)\n", "v.write_poses('1AZ8_lig_vina_out.pdbqt', n_poses=10, overwrite=True)" ] }, { "cell_type": "markdown", "id": "ce41cf4f-a916-46ea-9f7c-073292abaa4e", "metadata": {}, "source": [ "### 4.5. PDBQT results file conversion to SDF\n", "\n", "Because of the unique characteristics of the PDBQT format, it may be difficult to visualize the results or perform other analyses after docking. As a result, Jupyter Dock automatically converts the PDFBQT format to the more common SDF format. The file conversion preserves the chemical properties of the compounds after they have been sanitized and prepared. Furthermore, the \"Pose\" and \"Score\" information is saved as a molecule attribute. Such data can be accessed directly in the file or via Pybel or RDKit.\n", "\n", "**_pdbqt_to_sdf ( params )_**\n", "\n", "params:\n", "\n", "- **pdbqt_file**: _str or path-like string_ ; pdbqt file to be converted, extension must be pdbqt\n", "- **output**: _str or path-like string_ ; output sdf file, extension must be sdf" ] }, { "cell_type": "code", "execution_count": 16, "id": "1b8121d0-2485-4865-8cd3-10c945aad530", "metadata": {}, "outputs": [], "source": [ "pdbqt_to_sdf(pdbqt_file='1AZ8_lig_vina_out.pdbqt',output='1AZ8_lig_vina_out.sdf')" ] }, { "cell_type": "markdown", "id": "01b78957-5274-4a2e-bb91-4d83c551a7b4", "metadata": {}, "source": [ "### 4.6. 3D visualization of docking results (AutoDock Vina)\n", "\n", "As with the system visualization (section 3), the docking results can be inspected and compared to the reference structure (if exist). The ligand's \"Pose\" and \"Score\" information will also be displayed to show how acces to this molecule's attributes." ] }, { "cell_type": "code", "execution_count": 17, "id": "f95c31b9-ed5b-4dd3-be0f-380c462dd01f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reference: Magenta | Vina Pose: Cyan\n", "Pose: 1 | Score: -7.746\n" ] }, { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "view = py3Dmol.view()\n", "view.removeAllModels()\n", "view.setViewStyle({'style':'outline','color':'black','width':0.1})\n", "\n", "view.addModel(open('1AZ8_clean_H.pdb','r').read(),format='pdb')\n", "Prot=view.getModel()\n", "Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})\n", "view.addSurface(py3Dmol.VDW,{'opacity':0.6,'color':'white'})\n", "\n", "\n", "view.addModel(open('1AZ8_lig_H.mol2','r').read(),format='mol2')\n", "ref_m = view.getModel()\n", "ref_m.setStyle({},{'stick':{'colorscheme':'magentaCarbon','radius':0.2}})\n", "\n", "\n", "results=Chem.SDMolSupplier('1AZ8_lig_vina_out.sdf')\n", "\n", "p=Chem.MolToMolBlock(results[0],False)\n", "\n", "print('Reference: Magenta | Vina Pose: Cyan')\n", "print ('Pose: {} | Score: {}'.format(results[0].GetProp('Pose'),results[0].GetProp('Score')))\n", "\n", "view.addModel(p,'mol')\n", "x = view.getModel()\n", "x.setStyle({},{'stick':{'colorscheme':'cyanCarbon','radius':0.2}})\n", "\n", "view.zoomTo()\n", "view.show()" ] }, { "cell_type": "markdown", "id": "75f1749a-85cd-4340-9a6d-d8ff6258ce34", "metadata": {}, "source": [ "### 4.7. 2D interaction table and map\n", "\n", "Inspecting the molecular interactions is one of the most common analyses performed by a computational scientist following a docking experiment. As a result, Jupyter Dock uses ProLif to create a table of ligand-protein molecular interactions as well as the corresponding 2D map.\n", "\n", ">**Info:** ProLif uses RDKit and MDAnalysis to map the molecular interaction between a ligand and a protein. As a result, some protein preparations, including the use of LePro, can result in errors that impede analysis. Jupyter Dock's _**fix protein()_** function can be used to avoid such errors and provide a suitable protein structure for the analysis." ] }, { "cell_type": "code", "execution_count": 18, "id": "3ba16cc8-9285-409e-99ff-7df3e849f96d", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.\n" ] } ], "source": [ "fix_protein(filename='1AZ8_clean.pdb',addHs_pH=7.4,try_renumberResidues=True,output='1AZ8_clean_H_fix.pdb')" ] }, { "cell_type": "code", "execution_count": 19, "id": "089b321d-63d1-46f2-96f1-abdd2dfb00f9", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9339d43af84b4c5d8d44c24fb18342b9", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ligandUNL1
proteinASP189.ACYS191.ACYS42.AGLY219.A
interactionHBDonorHydrophobicHydrophobicHBDonor
Frame
0(None, None)(None, None)(None, None)(9, 0)
1(11, 0)(15, 0)(None, None)(12, 0)
2(None, None)(None, None)(None, None)(None, None)
3(None, None)(None, None)(None, None)(9, 0)
4(None, None)(None, None)(None, None)(None, None)
5(None, None)(None, None)(None, None)(9, 0)
6(None, None)(None, None)(None, None)(23, 0)
7(None, None)(None, None)(7, 0)(None, None)
8(25, 0)(None, None)(None, None)(26, 0)
9(None, None)(None, None)(None, None)(23, 0)
\n", "" ], "text/plain": [ "ligand UNL1 \n", "protein ASP189.A CYS191.A CYS42.A GLY219.A\n", "interaction HBDonor Hydrophobic Hydrophobic HBDonor\n", "Frame \n", "0 (None, None) (None, None) (None, None) (9, 0)\n", "1 (11, 0) (15, 0) (None, None) (12, 0)\n", "2 (None, None) (None, None) (None, None) (None, None)\n", "3 (None, None) (None, None) (None, None) (9, 0)\n", "4 (None, None) (None, None) (None, None) (None, None)\n", "5 (None, None) (None, None) (None, None) (9, 0)\n", "6 (None, None) (None, None) (None, None) (23, 0)\n", "7 (None, None) (None, None) (7, 0) (None, None)\n", "8 (25, 0) (None, None) (None, None) (26, 0)\n", "9 (None, None) (None, None) (None, None) (23, 0)" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# load protein\n", "prot = mda.Universe(\"1AZ8_clean_H_fix.pdb\")\n", "prot = plf.Molecule.from_mda(prot)\n", "prot.n_residues\n", "\n", "# load ligands\n", "lig_suppl = list(plf.sdf_supplier('1AZ8_lig_vina_out.sdf'))\n", "# generate fingerprint\n", "fp = plf.Fingerprint()\n", "fp.run_from_iterable(lig_suppl, prot)\n", "results_df = fp.to_dataframe(return_atoms=True)\n", "results_df" ] }, { "cell_type": "code", "execution_count": 20, "id": "60090cbb-2fca-42f8-a325-173bebc22030", "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "net = LigNetwork.from_ifp(results_df,lig_suppl[0],kind=\"frame\", frame=0,rotation=270)\n", "net.display()" ] }, { "cell_type": "markdown", "id": "3981eb6c-a9e6-48b2-b63e-022e043452e1", "metadata": { "tags": [] }, "source": [ "## 5. Docking with Smina\n", "\n", "Despite the presence of Python bindings in AutoDock Vina 1.2.0, other tools that incorporate AutoDock Vina allow for cool features such as custom score functions (smina), fast execution (qvina), and the use of wider boxes (qvina-w). Jupyter Dock can run such binaries in a notebook, giving users more options.\n", "\n", "Smina is a fork of AutoDock Vina that is customized to better support scoring function development and high-performance energy minimization. Smina is maintained by David Koes at the University of Pittsburgh and is not directly affiliated with the AutoDock project.\n", "\n", ">**Info:** The following cell contains an example of using Smina to run the current docking example. However, the executable files for qvina and qvina-w are available in the Jupyter Dock repo's bin directory. As a result, the user can use such a tool by adding the necessary cells or replacing the current docking engine.\n", "\n", "### 5.1. Receptor preparation\n", "\n", "Despite the fact that Smina is a modified version of AutoDock Vina, the input file for a receptor in Smina can be either a PDBQT file or a PDB file with explicit hydrogens in all residues. At this point, we can make use of the file sanitization steps as well as a protein structure from Jupyter Dock's _**fix_protein()**_ function.\n", "\n", "### 5.2. Ligand preparation\n", "\n", "In Smina, we can use any OpenBabel format for ligand input and docking results, just like we can for receptor preparation. As a result, after sanitization, we can use the ligand MOL2 file here. \n", "\n", "### 5.3. Docking box definition\n", "\n", "This step can be completed in the same manner as the AutoDock Vina box definition.\n", "\n", "### 5.4. Docking\n", "\n", "Jupyter Dock comes with the smina executable for Linux and Mac OS. By running the binary file, the parameters can be accessed." ] }, { "cell_type": "code", "execution_count": 21, "id": "f437b312-f894-4fe4-9ea5-7d7ddb8726a5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Missing receptor.\n", "\n", "Correct usage:\n", "\n", "Input:\n", " -r [ --receptor ] arg rigid part of the receptor (PDBQT)\n", " --flex arg flexible side chains, if any (PDBQT)\n", " -l [ --ligand ] arg ligand(s)\n", " --flexres arg flexible side chains specified by comma \n", " separated list of chain:resid or \n", " chain:resid:icode\n", " --flexdist_ligand arg Ligand to use for flexdist\n", " --flexdist arg set all side chains within specified distance \n", " to flexdist_ligand to flexible\n", "\n", "Search space (required):\n", " --center_x arg X coordinate of the center\n", " --center_y arg Y coordinate of the center\n", " --center_z arg Z coordinate of the center\n", " --size_x arg size in the X dimension (Angstroms)\n", " --size_y arg size in the Y dimension (Angstroms)\n", " --size_z arg size in the Z dimension (Angstroms)\n", " --autobox_ligand arg Ligand to use for autobox\n", " --autobox_add arg Amount of buffer space to add to auto-generated\n", " box (default +4 on all six sides)\n", " --no_lig no ligand; for sampling/minimizing flexible \n", " residues\n", "\n", "Scoring and minimization options:\n", " --scoring arg specify alternative builtin scoring function\n", " --custom_scoring arg custom scoring function file\n", " --custom_atoms arg custom atom type parameters file\n", " --score_only score provided ligand pose\n", " --local_only local search only using autobox (you probably \n", " want to use --minimize)\n", " --minimize energy minimization\n", " --randomize_only generate random poses, attempting to avoid \n", " clashes\n", " --minimize_iters arg (=0) number iterations of steepest descent; default \n", " scales with rotors and usually isn't sufficient\n", " for convergence\n", " --accurate_line use accurate line search\n", " --minimize_early_term Stop minimization before convergence conditions\n", " are fully met.\n", " --approximation arg approximation (linear, spline, or exact) to use\n", " --factor arg approximation factor: higher results in a \n", " finer-grained approximation\n", " --force_cap arg max allowed force; lower values more gently \n", " minimize clashing structures\n", " --user_grid arg Autodock map file for user grid data based \n", " calculations\n", " --user_grid_lambda arg (=-1) Scales user_grid and functional scoring\n", " --print_terms Print all available terms with default \n", " parameterizations\n", " --print_atom_types Print all available atom types\n", "\n", "Output (optional):\n", " -o [ --out ] arg output file name, format taken from file \n", " extension\n", " --out_flex arg output file for flexible receptor residues\n", " --log arg optionally, write log file\n", " --atom_terms arg optionally write per-atom interaction term \n", " values\n", " --atom_term_data embedded per-atom interaction terms in output \n", " sd data\n", "\n", "Misc (optional):\n", " --cpu arg the number of CPUs to use (the default is to \n", " try to detect the number of CPUs or, failing \n", " that, use 1)\n", " --seed arg explicit random seed\n", " --exhaustiveness arg (=8) exhaustiveness of the global search (roughly \n", " proportional to time)\n", " --num_modes arg (=9) maximum number of binding modes to generate\n", " --energy_range arg (=3) maximum energy difference between the best \n", " binding mode and the worst one displayed \n", " (kcal/mol)\n", " --min_rmsd_filter arg (=1) rmsd value used to filter final poses to remove\n", " redundancy\n", " -q [ --quiet ] Suppress output messages\n", " --addH arg automatically add hydrogens in ligands (on by \n", " default)\n", "\n", "Configuration file (optional):\n", " --config arg the above options can be put here\n", "\n", "Information (optional):\n", " --help display usage summary\n", " --help_hidden display usage summary with hidden options\n", " --version display program version\n", "\n" ] } ], "source": [ "!../../bin/smina #Lauch this cell to see parameters" ] }, { "cell_type": "code", "execution_count": 22, "id": "eee3d5df-3743-4607-a939-f512cf83def3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " _______ _______ _________ _ _______ \n", " ( ____ \\( )\\__ __/( ( /|( ___ )\n", " | ( \\/| () () | ) ( | \\ ( || ( ) |\n", " | (_____ | || || | | | | \\ | || (___) |\n", " (_____ )| |(_)| | | | | (\\ \\) || ___ |\n", " ) || | | | | | | | \\ || ( ) |\n", " /\\____) || ) ( |___) (___| ) \\ || ) ( |\n", " \\_______)|/ \\|\\_______/|/ )_)|/ \\|\n", "\n", "\n", "smina is based off AutoDock Vina. Please cite appropriately.\n", "\n", "Weights Terms\n", "-0.035579 gauss(o=0,_w=0.5,_c=8)\n", "-0.005156 gauss(o=3,_w=2,_c=8)\n", "0.840245 repulsion(o=0,_c=8)\n", "-0.035069 hydrophobic(g=0.5,_b=1.5,_c=8)\n", "-0.587439 non_dir_h_bond(g=-0.7,_b=0,_c=8)\n", "1.923 num_tors_div\n", "\n", "Using random seed: 1899689032\n", "\n", "0% 10 20 30 40 50 60 70 80 90 100%\n", "|----|----|----|----|----|----|----|----|----|----|\n", "***************************************************\n", "\n", "mode | affinity | dist from best mode\n", " | (kcal/mol) | rmsd l.b.| rmsd u.b.\n", "-----+------------+----------+----------\n", "1 -8.1 0.000 0.000 \n", "2 -7.7 4.282 7.834 \n", "3 -7.6 1.560 2.181 \n", "4 -7.4 3.914 7.467 \n", "5 -7.3 4.727 7.570 \n", "6 -7.3 3.979 7.582 \n", "7 -7.1 4.102 6.950 \n", "8 -7.1 3.272 4.506 \n", "9 -7.0 7.062 10.688 \n", "10 -7.0 5.740 9.337 \n", "Refine time 29.933\n", "Loop time 30.808\n" ] } ], "source": [ "!../../bin/smina -r {'1AZ8_clean_H.pdb'} -l {'1AZ8_lig_H.mol2'} -o {'1AZ8_lig_smina_out.sdf'} --center_x 31.859 --center_y 13.34 --center_z 17.065 --size_x 24.569 --size_y 18.12 --size_z 17.37 --exhaustiveness 8 --num_modes 10" ] }, { "cell_type": "markdown", "id": "84de255c-e765-492f-914c-3a8a5dbc6458", "metadata": {}, "source": [ "### 5.6. 3D visualization of docking results\n", "\n", "As with the system visualization (section 3), the docking results can be inspected and compared to the reference structure (if one exists). Smina saves the \"minimizedAffinity\" information corresponding to the docking score as the molecule's attribute." ] }, { "cell_type": "code", "execution_count": 23, "id": "65c3ef28-da98-4360-b583-f23de87fbf14", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reference: Magenta | Smina Pose: Cyan\n", "Score: -8.10622\n" ] }, { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "view = py3Dmol.view()\n", "view.removeAllModels()\n", "view.setViewStyle({'style':'outline','color':'black','width':0.1})\n", "\n", "view.addModel(open('1AZ8_clean_H.pdb','r').read(),format='pdb')\n", "Prot=view.getModel()\n", "Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})\n", "view.addSurface(py3Dmol.VDW,{'opacity':0.6,'color':'white'})\n", "\n", "\n", "view.addModel(open('1AZ8_lig_H.mol2','r').read(),format='mol2')\n", "ref_m = view.getModel()\n", "ref_m.setStyle({},{'stick':{'colorscheme':'magentaCarbon','radius':0.2}})\n", "\n", "\n", "results=Chem.SDMolSupplier('1AZ8_lig_smina_out.sdf')\n", "\n", "p=Chem.MolToMolBlock(results[0],False)\n", "\n", "print('Reference: Magenta | Smina Pose: Cyan')\n", "print ('Score: {}'.format(results[0].GetProp('minimizedAffinity')))\n", "\n", "view.addModel(p,'mol')\n", "x = view.getModel()\n", "x.setStyle({},{'stick':{'colorscheme':'cyanCarbon','radius':0.2}})\n", "\n", "view.zoomTo()\n", "view.show()" ] }, { "cell_type": "markdown", "id": "f9d8f3a6-d19a-4fd0-bc43-382315f47d46", "metadata": {}, "source": [ "### 5.7. 2D interaction table and map\n", "\n", "Inspecting the molecular interactions is one of the most common analyses performed by a computational scientist following a docking experiment. As a result, Jupyter Dock uses ProLif to create a table of ligand-protein molecular interactions as well as the corresponding 2D map.\n", "\n", ">**Info:** ProLif uses RDKit and MDAnalysis to map the molecular interaction between a ligand and a protein. As a result, some protein preparations, including the use of LePro, can result in errors that impede analysis. Jupyter Dock's _**fix protein()_** function can be used to avoid such errors and provide a suitable protein structure for the analysis." ] }, { "cell_type": "code", "execution_count": 24, "id": "fd5694a5-9b65-4d55-b436-c7447c8b3d68", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3fda96aa37e74724964095cbb64a7d22", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ligandUNL1
proteinASP189.ACYS191.AGLY148.AGLY219.A
interactionHBDonorHydrophobicHBDonorHBDonor
Frame
0(None, None)(19, 0)(None, None)(12, 0)
1(11, 0)(None, None)(None, None)(10, 0)
2(None, None)(15, 0)(None, None)(12, 0)
3(25, 0)(None, None)(None, None)(24, 0)
4(25, 0)(None, None)(None, None)(24, 0)
5(None, None)(None, None)(None, None)(None, None)
6(25, 0)(None, None)(None, None)(24, 0)
7(None, None)(15, 0)(25, 0)(None, None)
8(None, None)(None, None)(None, None)(None, None)
9(None, None)(None, None)(None, None)(None, None)
\n", "" ], "text/plain": [ "ligand UNL1 \n", "protein ASP189.A CYS191.A GLY148.A GLY219.A\n", "interaction HBDonor Hydrophobic HBDonor HBDonor\n", "Frame \n", "0 (None, None) (19, 0) (None, None) (12, 0)\n", "1 (11, 0) (None, None) (None, None) (10, 0)\n", "2 (None, None) (15, 0) (None, None) (12, 0)\n", "3 (25, 0) (None, None) (None, None) (24, 0)\n", "4 (25, 0) (None, None) (None, None) (24, 0)\n", "5 (None, None) (None, None) (None, None) (None, None)\n", "6 (25, 0) (None, None) (None, None) (24, 0)\n", "7 (None, None) (15, 0) (25, 0) (None, None)\n", "8 (None, None) (None, None) (None, None) (None, None)\n", "9 (None, None) (None, None) (None, None) (None, None)" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# load protein\n", "prot = mda.Universe(\"1AZ8_clean_H_fix.pdb\")\n", "prot = plf.Molecule.from_mda(prot)\n", "prot.n_residues\n", "\n", "# load ligands\n", "lig_suppl = list(plf.sdf_supplier('1AZ8_lig_smina_out.sdf'))\n", "# generate fingerprint\n", "fp = plf.Fingerprint()\n", "fp.run_from_iterable(lig_suppl, prot)\n", "results_df = fp.to_dataframe(return_atoms=True)\n", "results_df" ] }, { "cell_type": "code", "execution_count": 25, "id": "e724e911-c126-4f64-b9a0-cc7ae667308c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "net = LigNetwork.from_ifp(results_df,lig_suppl[0],kind=\"frame\", frame=0,rotation=270)\n", "net.display()" ] }, { "cell_type": "markdown", "id": "e92d1738-3440-4d0e-8ae4-24f6fd50ffcf", "metadata": {}, "source": [ "## 6. Docking with LeDock\n", "\n", "LeDock is designed for fast and accurate flexible docking of small molecules into a protein. It achieves a pose-prediction accuracy of greater than 90% on the Astex diversity set and takes about 3 seconds per run for a drug-like molecule. It has led to the discovery of novel kinase inhibitors and bromodomain antagonists from high-throughput virtual screening campaigns. It directly uses SYBYL Mol2 format as input for small molecules.\n", "\n", "### 6.1. Receptor preparation\n", "\n", "In LeDock, the input file for a receptor is a PDB file with explicit hydrogens in all residues. LePro was created as a tool for preparing protein structures for docking with LeDock. Thus, at this stage, we can use the file ater sanitization steps as well as a protein structure from Jupyter Dock's _**fix_protein()**_ function.\n", "\n", "### 6.2. Ligand preparation\n", "\n", "As previously stated, the input format for ligand in LeDock is MOL2. Similarly to the receptor preparation, we can use the ligand directly after sanitization. \n", "\n", "### 6.3. Docking box definition\n", "\n", "This step can be completed in the same manner as the AutoDock Vina box definition. To obtain the identical box from AutoDock Vina docking but in LeDock format, the user only needs to change the parameter \"software\" from \"vina\" to \"ledock.\" \n", "\n", ">**Info:** The implementation of the _**get_box()**_ function allows for the easy replication of binding sites between AutoDock Vina and LeDock, with the goal of replicating and comparing results between both programs." ] }, { "cell_type": "code", "execution_count": 26, "id": "13e73174-9e26-424d-8abd-b8df3f37fc16", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'minX': 19.57430076599121, 'maxX': 44.143798828125} \n", " {'minY': 4.285799980163574, 'maxY': 22.409099578857422} \n", " {'minZ': 8.378700256347656, 'maxZ': 25.75309944152832}\n" ] } ], "source": [ "cmd.load(filename='1AZ8_clean_H.pdb',format='pdb',object='prot')\n", "cmd.load(filename='1AZ8_lig_H.mol2',format='mol2',object='lig')\n", "\n", "X,Y,Z= getbox(selection='lig',extending=5.0,software='ledock')\n", "cmd.delete('all')\n", "\n", "print(X,'\\n',Y,'\\n',Z)" ] }, { "cell_type": "markdown", "id": "f03fb247-097b-4914-96cd-14f03d46b5ca", "metadata": {}, "source": [ "### 6.4. Docking\n", "\n", "To run LeDock, a configuration (commonly known as dock.in) file containing all docking parameters as well as information about the receptor and ligand(s) to dock is required. Jupyter Dock uses the function _**generate ledock file()**_ to generate the configuration file automatically. After configuring the parameters, the user will receive a configuration file as well as a file containing a list of ligand(s) to dock (commonly named ligand.list). After this, docking would be as simple as launching the LeDock executable and the configuration file as parameter.\n", "\n", "**_generate_ledock_file( params )_**\n", "\n", "params:\n", "\n", "- **receptor**: _str or path-like string_ ; protein file for docking including hydrogens, format must be pdb \n", "- **x**: _2 element list of floats [ float , float ]_; Xmin and Xmax coordinates of docking box\n", "- **y**: _2 element list of floats [ float , float ]_; Ymin and Ymax coordinates of docking box\n", "- **z**: _2 element list of floats [ float , float ]_; Zmin and Zmax coordinates of docking box\n", "- **n_poses**: _float_ ; n_of poses to retrieve from docking \n", "- **rmsd**: _float_ ; minimum RMSD diference between docking poses \n", "- **l_list**: _list of n strings or path-like strings [ lig1, lig2, lig3 ... ] ; list of ligands or ligands paths to dock \n", "- **l_list_outfile**: _str or path-like string_ ; filename to save the ligand list, needed for ledock to locate ligands\n", "- **out**: _str or path-like string_ ; outfile to save docking paramemeters, needed to launch the docking" ] }, { "cell_type": "code", "execution_count": 27, "id": "21078e78-8772-4b50-83c1-3dcd7381b819", "metadata": {}, "outputs": [], "source": [ "generate_ledock_file(receptor='1AZ8_clean_H.pdb',x=[X['minX'],X['maxX']],\n", " y=[Y['minY'],Y['maxY']],\n", " z=[Z['minZ'],Z['maxZ']],\n", " n_poses=10,\n", " rmsd=1.0,\n", " l_list='1AZ8_lig_H.mol2', \n", " l_list_outfile='ledock_ligand.list',\n", " out='dock.in')" ] }, { "cell_type": "code", "execution_count": 28, "id": "e17732ce-e213-4503-bf18-902a94089c3b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "************************************************************\n", "* LeDock v1.0 *\n", "* Molecular Docking Software *\n", "* Copyright 2013-14 (C) H. Zhao PhD *\n", "* For academic use only *\n", "* www.lephar.com *\n", "************************************************************\n", "--------Usage:\n", "--------ledock config.file !docking\n", "--------ledock -spli dok.file !split into separate coordinates\n", "\n" ] } ], "source": [ "!../../bin/ledock_linux_x86 #Launch this cell to see parameters" ] }, { "cell_type": "code", "execution_count": 29, "id": "bc334f42-0d13-4e98-a24f-698adc1d5da9", "metadata": {}, "outputs": [], "source": [ "!../../bin/ledock_linux_x86 {'dock.in'}" ] }, { "cell_type": "markdown", "id": "9895b690-5593-45b4-9a6c-1d1ef6a54987", "metadata": {}, "source": [ "### 6.5. DOK results file conversion to SDF\n", "\n", "The end result of LeDock is a file with the dok extension that contains the docking properties in the same way that a pdb file does. Nonetheless, the dok file is not a widely used format for representing chemical structures. As a result, Jupyter Dock can convert dok files to the widely used sdf format. Jupyter Dock, like in the pdbqt to sdf conversion, will preserve the chemical features and save the \"Pose\" and \"Score\" results as molecule attributes.\n", "\n", "**_dok_to_sdf ( params )_**\n", "\n", "params:\n", "\n", " - **dok_file**: _str or path-like_ ; dok file from ledock docking\n", "\n", " - **output**: _str or path-like_ ; out file from ledock docking, extension must be sdf" ] }, { "cell_type": "code", "execution_count": 30, "id": "73878c34-8346-49ef-a6c7-44733115510f", "metadata": {}, "outputs": [], "source": [ "dok_to_sdf(dok_file='1AZ8_lig_H.dok',output='1AZ8_lig_ledock_out.sdf')" ] }, { "cell_type": "markdown", "id": "48e6dad1-078a-4579-b72e-22c1cf1e48ed", "metadata": {}, "source": [ "### 6.6. 3D visualization of docking results\n", "\n", "As with the system visualization (section 3), the docking results can be inspected and compared to the reference structure (if exist). The ligand's \"Pose\" and \"Score\" information will also be displayed to show how acces to this molecule's attributes." ] }, { "cell_type": "code", "execution_count": 31, "id": "97fc294d-1d1c-440d-ad35-da4de5d098d1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reference: Magenta | LeDock Pose: Cyan\n", "Pose: 1 | Score: -9.06\n" ] }, { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "view = py3Dmol.view()\n", "view.removeAllModels()\n", "view.setViewStyle({'style':'outline','color':'black','width':0.1})\n", "\n", "view.addModel(open('1AZ8_clean_H.pdb','r').read(),format='pdb')\n", "Prot=view.getModel()\n", "Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})\n", "view.addSurface(py3Dmol.VDW,{'opacity':0.6,'color':'white'})\n", "\n", "\n", "view.addModel(open('1AZ8_lig_H.mol2','r').read(),format='mol2')\n", "ref_m = view.getModel()\n", "ref_m.setStyle({},{'stick':{'colorscheme':'magentaCarbon','radius':0.2}})\n", "\n", "results=Chem.SDMolSupplier('1AZ8_lig_ledock_out.sdf')\n", "\n", "\n", "p=Chem.MolToMolBlock(results[0])\n", "\n", "print('Reference: Magenta | LeDock Pose: Cyan')\n", "print ('Pose: {} | Score: {}'.format(results[0].GetProp('Pose'),results[0].GetProp('Score')))\n", "\n", "view.addModel(p,'mol')\n", "x = view.getModel()\n", "x.setStyle({},{'stick':{'colorscheme':'cyanCarbon','radius':0.2}})\n", "\n", "view.zoomTo()\n", "view.show()" ] }, { "cell_type": "markdown", "id": "b1548780-48ac-4843-be7e-29ab8de33726", "metadata": {}, "source": [ "### 6.7. 2D interaction table and map\n", "\n", "Inspecting the molecular interactions is one of the most common analyses performed by a computational scientist following a docking experiment. As a result, Jupyter Dock uses ProLif to create a table of ligand-protein molecular interactions as well as the corresponding 2D map.\n", "\n", "> **Info:** ProLif uses RDKit and MDAnalysis to map the molecular interaction between a ligand and a protein. As a result, some protein preparations, including the use of LePro, can result in errors that impede analysis. Jupyter Dock's _fix protein()_ function can be used to avoid such errors and provide a suitable protein structure for the analysis." ] }, { "cell_type": "code", "execution_count": 32, "id": "c8c42b93-ab73-4fda-817f-373289df549f", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0784cc85372e472d865d239b2c2a34fd", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ligandUNL1
proteinASN143.AASN97.AASP189.ACYS191.ACYS220.AGLN192.AGLY148.A...SER146.ASER147.ASER190.ASER214.ATHR149.ATRP215.AVAL213.A
interactionHBAcceptorHBDonorHydrophobicHBDonorHBDonorHydrophobicHydrophobicHydrophobicHydrophobicHBDonor...HydrophobicHBDonorHydrophobicHBDonorHydrophobicHydrophobicHydrophobicHydrophobicPiStackingHydrophobic
Frame
0(None, None)(None, None)(None, None)(None, None)(None, None)(24, 9)(0, 2)(7, 9)(2, 2)(None, None)...(21, 4)(27, 5)(21, 2)(None, None)(0, 4)(13, 4)(None, None)(0, 2)(None, None)(0, 8)
1(3, 11)(None, None)(21, 9)(None, None)(32, 11)(24, 9)(0, 2)(7, 9)(2, 2)(28, 6)...(21, 4)(None, None)(21, 4)(34, 9)(0, 4)(None, None)(None, None)(0, 2)(None, None)(0, 8)
2(None, None)(None, None)(None, None)(None, None)(32, 10)(24, 9)(0, 2)(7, 9)(2, 2)(None, None)...(21, 4)(28, 5)(21, 2)(None, None)(0, 4)(None, None)(None, None)(0, 4)(None, None)(0, 8)
3(None, None)(27, 10)(None, None)(None, None)(None, None)(24, 9)(0, 2)(7, 9)(4, 2)(None, None)...(21, 4)(28, 0)(21, 4)(33, 9)(0, 4)(None, None)(None, None)(0, 2)(None, None)(0, 8)
4(None, None)(None, None)(None, None)(None, None)(32, 11)(24, 9)(0, 2)(7, 9)(4, 2)(27, 6)...(21, 4)(None, None)(21, 4)(None, None)(0, 4)(2, 4)(None, None)(0, 2)(None, None)(0, 8)
5(3, 11)(None, None)(None, None)(None, None)(33, 11)(24, 9)(0, 2)(7, 9)(2, 2)(27, 6)...(18, 4)(None, None)(21, 4)(None, None)(0, 4)(2, 4)(None, None)(0, 2)(None, None)(0, 8)
6(1, 11)(None, None)(None, None)(None, None)(32, 11)(24, 9)(0, 2)(7, 9)(2, 2)(27, 6)...(21, 4)(None, None)(21, 4)(None, None)(0, 4)(None, None)(None, None)(0, 2)(None, None)(0, 8)
7(1, 11)(None, None)(None, None)(None, None)(None, None)(24, 9)(0, 2)(7, 9)(2, 2)(27, 6)...(21, 4)(None, None)(21, 4)(32, 9)(0, 4)(13, 4)(None, None)(0, 2)(None, None)(0, 8)
8(1, 11)(None, None)(None, None)(None, None)(None, None)(24, 9)(0, 2)(7, 9)(2, 2)(None, None)...(None, None)(27, 5)(None, None)(None, None)(0, 4)(None, None)(21, 6)(0, 2)(None, None)(0, 8)
9(None, None)(None, None)(None, None)(28, 5)(32, 11)(24, 9)(0, 2)(10, 9)(None, None)(None, None)...(None, None)(None, None)(None, None)(34, 9)(0, 4)(2, 4)(None, None)(0, 2)(12, 12)(0, 8)
\n", "

10 rows × 30 columns

\n", "" ], "text/plain": [ "ligand UNL1 \\\n", "protein ASN143.A ASN97.A \n", "interaction HBAcceptor HBDonor Hydrophobic HBDonor \n", "Frame \n", "0 (None, None) (None, None) (None, None) (None, None) \n", "1 (3, 11) (None, None) (21, 9) (None, None) \n", "2 (None, None) (None, None) (None, None) (None, None) \n", "3 (None, None) (27, 10) (None, None) (None, None) \n", "4 (None, None) (None, None) (None, None) (None, None) \n", "5 (3, 11) (None, None) (None, None) (None, None) \n", "6 (1, 11) (None, None) (None, None) (None, None) \n", "7 (1, 11) (None, None) (None, None) (None, None) \n", "8 (1, 11) (None, None) (None, None) (None, None) \n", "9 (None, None) (None, None) (None, None) (28, 5) \n", "\n", "ligand \\\n", "protein ASP189.A CYS191.A CYS220.A GLN192.A \n", "interaction HBDonor Hydrophobic Hydrophobic Hydrophobic Hydrophobic \n", "Frame \n", "0 (None, None) (24, 9) (0, 2) (7, 9) (2, 2) \n", "1 (32, 11) (24, 9) (0, 2) (7, 9) (2, 2) \n", "2 (32, 10) (24, 9) (0, 2) (7, 9) (2, 2) \n", "3 (None, None) (24, 9) (0, 2) (7, 9) (4, 2) \n", "4 (32, 11) (24, 9) (0, 2) (7, 9) (4, 2) \n", "5 (33, 11) (24, 9) (0, 2) (7, 9) (2, 2) \n", "6 (32, 11) (24, 9) (0, 2) (7, 9) (2, 2) \n", "7 (None, None) (24, 9) (0, 2) (7, 9) (2, 2) \n", "8 (None, None) (24, 9) (0, 2) (7, 9) (2, 2) \n", "9 (32, 11) (24, 9) (0, 2) (10, 9) (None, None) \n", "\n", "ligand ... \\\n", "protein GLY148.A ... SER146.A SER147.A \n", "interaction HBDonor ... Hydrophobic HBDonor Hydrophobic \n", "Frame ... \n", "0 (None, None) ... (21, 4) (27, 5) (21, 2) \n", "1 (28, 6) ... (21, 4) (None, None) (21, 4) \n", "2 (None, None) ... (21, 4) (28, 5) (21, 2) \n", "3 (None, None) ... (21, 4) (28, 0) (21, 4) \n", "4 (27, 6) ... (21, 4) (None, None) (21, 4) \n", "5 (27, 6) ... (18, 4) (None, None) (21, 4) \n", "6 (27, 6) ... (21, 4) (None, None) (21, 4) \n", "7 (27, 6) ... (21, 4) (None, None) (21, 4) \n", "8 (None, None) ... (None, None) (27, 5) (None, None) \n", "9 (None, None) ... (None, None) (None, None) (None, None) \n", "\n", "ligand \\\n", "protein SER190.A SER214.A THR149.A TRP215.A \n", "interaction HBDonor Hydrophobic Hydrophobic Hydrophobic Hydrophobic \n", "Frame \n", "0 (None, None) (0, 4) (13, 4) (None, None) (0, 2) \n", "1 (34, 9) (0, 4) (None, None) (None, None) (0, 2) \n", "2 (None, None) (0, 4) (None, None) (None, None) (0, 4) \n", "3 (33, 9) (0, 4) (None, None) (None, None) (0, 2) \n", "4 (None, None) (0, 4) (2, 4) (None, None) (0, 2) \n", "5 (None, None) (0, 4) (2, 4) (None, None) (0, 2) \n", "6 (None, None) (0, 4) (None, None) (None, None) (0, 2) \n", "7 (32, 9) (0, 4) (13, 4) (None, None) (0, 2) \n", "8 (None, None) (0, 4) (None, None) (21, 6) (0, 2) \n", "9 (34, 9) (0, 4) (2, 4) (None, None) (0, 2) \n", "\n", "ligand \n", "protein VAL213.A \n", "interaction PiStacking Hydrophobic \n", "Frame \n", "0 (None, None) (0, 8) \n", "1 (None, None) (0, 8) \n", "2 (None, None) (0, 8) \n", "3 (None, None) (0, 8) \n", "4 (None, None) (0, 8) \n", "5 (None, None) (0, 8) \n", "6 (None, None) (0, 8) \n", "7 (None, None) (0, 8) \n", "8 (None, None) (0, 8) \n", "9 (12, 12) (0, 8) \n", "\n", "[10 rows x 30 columns]" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# load protein\n", "prot = mda.Universe(\"1AZ8_clean_H_fix.pdb\",guess_bonds=True)\n", "prot = plf.Molecule.from_mda(prot)\n", "prot.n_residues\n", "\n", "# load ligands\n", "path = str('1AZ8_lig_ledock_out.sdf')\n", "lig_suppl = list(plf.sdf_supplier(path))\n", "# generate fingerprint\n", "fp = plf.Fingerprint()\n", "fp.run_from_iterable(lig_suppl, prot)\n", "results_df = fp.to_dataframe(return_atoms=True)\n", "results_df" ] }, { "cell_type": "code", "execution_count": 33, "id": "36fd7b17-6821-4b47-a6c0-7c1c5568dc11", "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "net = LigNetwork.from_ifp(results_df,lig_suppl[0],kind=\"frame\", frame=0,rotation=270)\n", "net.display()" ] }, { "cell_type": "markdown", "id": "76b7c846-6b0f-4033-b4d9-f699fc959f86", "metadata": {}, "source": [ ".. disqus::" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" } }, "nbformat": 4, "nbformat_minor": 5 }