{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "be4597ce-a9ea-4d81-834d-0489f1a3fe87", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/aloy/home/acomajuncosa/PocketVec_v2/GitLab_repo\n" ] } ], "source": [ "import sys\n", "import os\n", "os.chdir(\"../..\")\n", "print(os.getcwd())\n", "sys.path.insert(1, './code')" ] }, { "cell_type": "code", "execution_count": 2, "id": "fcece12f-b26c-477e-ace0-eed1e0d41919", "metadata": { "tags": [] }, "outputs": [], "source": [ "from utils.pocketvec_utils import environmental_variables\n", "from utils.pocketvec_utils import create_parameter_file\n", "from utils.pocketvec_utils import create_file_scores\n", "from utils.pocketvec_utils import read_rDock_scores\n", "from utils.pocketvec_utils import create_cavity\n", "from utils.pocketvec_utils import run_rDock\n", "from utils.pocketvec_utils import rank_fp\n", "from utils.pocketvec_utils import raw_fp\n", "import pickle\n", "import shutil" ] }, { "cell_type": "markdown", "id": "50e33c07-da5f-42f5-9838-962b4f13ef9b", "metadata": {}, "source": [ "## This notebook exemplifies how create a **PocketVec** descriptor given a prepared protein structure (mol2 format) and the corresponding pocket centroid (3D coordinate, SD format)" ] }, { "cell_type": "code", "execution_count": 3, "id": "8d19e396-d19f-4c39-947d-ad3692ebac23", "metadata": {}, "outputs": [], "source": [ "radius = \"12.0\" # Optimal value. If needed, try increasing it\n", "nruns = 1 # Nº of docking runs per molecule (default: 25)" ] }, { "cell_type": "code", "execution_count": 4, "id": "bdec9b8f-d79b-418a-9af5-203fde234113", "metadata": {}, "outputs": [], "source": [ "# 1. Create output directory and copy receptor and pocket centroid files\n", "\n", "# In this example, we select the ligand-based pocket centroid\n", "receptor = \"1A42_prepared.mol2\"\n", "pocket_centroid = \"CTR_LIG.sd\" \n", "\n", "# Paths\n", "inpath = 'examples/1_preparation/'\n", "outpath = 'examples/2_pocketvec/'\n", "\n", "path_to_st = os.path.join(outpath, receptor)\n", "path_to_ctr = os.path.join(outpath, pocket_centroid)\n", "\n", "if os.path.exists(os.path.join(outpath, 'rDock_results')) == False: os.makedirs(os.path.join(outpath, 'rDock_results'))\n", "o = shutil.copyfile(os.path.join(inpath, receptor), path_to_st)\n", "o = shutil.copyfile(os.path.join(inpath, pocket_centroid), path_to_ctr)" ] }, { "cell_type": "code", "execution_count": 5, "id": "df05e318-7f47-496d-bed5-42962a32c955", "metadata": {}, "outputs": [], "source": [ "# 2. Create st parameters file for rDock docking\n", "outfile = os.path.join(outpath, \"rDock_results\", \"st_parameters.prm\")\n", "create_parameter_file(outfile, path_to_st, path_to_ctr)" ] }, { "cell_type": "code", "execution_count": 6, "id": "740f916d-5eef-4a41-af74-336cab8bbb70", "metadata": {}, "outputs": [], "source": [ "# 3. Set environmental variables\n", "path_to_rDock = \"code/utils/rDock_compiled/\"\n", "environmental_variables(path_to_rDock)" ] }, { "cell_type": "code", "execution_count": 7, "id": "f271e635-de1b-424a-8185-117f68663898", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "***********************************************\n", "The rDock program is licensed under GNU-LGPLv3.0. http://rdock.sourceforge.net/\n", "Executable:\trbcavity ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbcavity.cxx#3 $)\n", "Library:\tlibRbt.so/2021.1/901 2021/07/19\n", "RBT_ROOT:\tcode/utils/rDock_compiled\n", "RBT_HOME:\t/home/acomajuncosa\n", "Current dir:\t/aloy/home/acomajuncosa/PocketVec_v2/GitLab_repo\n", "Date:\t\tTue Mar 14 14:32:54 2023\n", "***********************************************\n", "\n", "Command line arguments:\n", "-r examples/2_pocketvec/rDock_results/st_parameters.prm\n", "-was\n", "-d\n", "\n", "MAPPER\n", "CLASS\tRbtLigandSiteMapper\n", "ENABLED\tTRUE\n", "GRIDSTEP\t0.5\n", "MAX_CAVITIES\t1\n", "MIN_VOLUME\t100\n", "NAME\tMAPPER\n", "RADIUS\t12.0\n", "REF_MOL\texamples/2_pocketvec/CTR_LIG.sd\n", "SMALL_SPHERE\t1.0\n", "TRACE\t0\n", "VOL_INCR\t0\n", "\n", "\n", "DOCKING SITE\n", "Total volume 2431.5 A^3\n", "Cavity #1\tSize=19452 points; Vol=2431.5 A^3; Min=(-12.5,-6.5,3); Max=(7.5,16,25); Center=(-2.20312,6.61909,11.9898); Extent=(20,22.5,22)\n", "\n", "Cav = 19452; total = 19452\n" ] } ], "source": [ "# 4. Run rbcavity to define the pocket // Should take no more than 1-2 min\n", "path_to_parameters = os.path.join(outpath, \"rDock_results\", 'st_parameters.prm')\n", "path_to_log = os.path.join(outpath, \"rDock_results\", 'cavity_log.log')\n", "path_to_cavity = os.path.join(outpath, \"rDock_results\", 'cavity.grd')\n", "path_to_rbcavity = 'rbcavity'\n", "\n", "create_cavity(os.path.join(outpath, \"rDock_results\"), path_to_log, path_to_cavity, path_to_rbcavity)" ] }, { "cell_type": "code", "execution_count": 8, "id": "ee2ac375-3350-4f99-a22e-603124122b76", "metadata": {}, "outputs": [], "source": [ "# 5. Copy parameters file\n", "_ = shutil.copyfile(\"code/utils/rDock_compiled/dock.prm\", os.path.join(outpath, \"rDock_results\", \"dock.prm\"))" ] }, { "cell_type": "code", "execution_count": 9, "id": "3d75d1e5-ccfc-41b0-9010-827fac0edc64", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "***********************************************\n", "The rDock program is licensed under GNU-LGPLv3.0. http://rdock.sourceforge.net/\n", "Executable:\trbdock ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbdock.cxx#4 $)\n", "Library:\tlibRbt.so/2021.1/901 2021/07/19\n", "RBT_ROOT:\tcode/utils/rDock_compiled\n", "RBT_HOME:\t/home/acomajuncosa\n", "Current dir:\t/aloy/home/acomajuncosa/PocketVec_v2/GitLab_repo\n", "Date:\t\tTue Mar 14 14:33:07 2023\n", "***********************************************\n", "\n", "\n", "Command line args:\n", " -i data/libs/TOP_128_rDock_LLM.sdf\n", " -r examples/2_pocketvec/rDock_results/st_parameters.prm\n", " -p examples/2_pocketvec/rDock_results/dock.prm\n", " -o examples/2_pocketvec/rDock_results/results\n", " -n 1\n", " -s 42\n", "Reading polar hydrogens only from ligand SD file\n", "\n", "DOCKING PROTOCOL:\n", "examples/2_pocketvec/rDock_results/dock.prm\n", "Free docking (indexed VDW)\n", "\n", "RECEPTOR:\n", "examples/2_pocketvec/rDock_results/st_parameters.prm\n", "Change this if you want\n", "\n", "DOCKING SITE\n", "Total volume 2431.5 A^3\n", "Cavity #1\tSize=19452 points; Vol=2431.5 A^3; Min=(-12.5,-6.5,3); Max=(7.5,16,25); Center=(-2.20312,6.61909,11.9898); Extent=(20,22.5,22)\n", "\n", "\n", "No solvent\n", "\n", "------------- Terminate filter 0------------\n", "\n", "if (SCORE.NRUNS - 0 ) > 0 then\n", "\t0.0 \n", "else\n", "\t-1.0 \n", "end\n", "\n", "\n", "**************************************************\n", "RECORD #1\n", "NAME: Enamine T0505-3993\n", "RANDOM_NUMBER_SEED: 42\n", "\n", "**************************************************\n", "RECORD #2\n", "NAME: Chem T&I AMSACS-17229\n", "RANDOM_NUMBER_SEED: -60508958\n", "\n", "**************************************************\n", "RECORD #3\n", "NAME: Chemical Block A3692/0156694\n", "RANDOM_NUMBER_SEED: -1871883734\n", "\n", "**************************************************\n", "RECORD #4\n", "NAME: Life Chemicals F0778-0231\n", "RANDOM_NUMBER_SEED: 1534991177\n", "\n", "**************************************************\n", "RECORD #5\n", "NAME: Princeton Biomolecular OSSK_459353\n", "RANDOM_NUMBER_SEED: 1535379498\n", "\n", "**************************************************\n", "RECORD #6\n", "NAME: Toslab 44086\n", "RANDOM_NUMBER_SEED: 1510828958\n", "\n", "**************************************************\n", "RECORD #7\n", "NAME: Specs AM-900/15051004\n", "RANDOM_NUMBER_SEED: -364505018\n", "\n", "**************************************************\n", "RECORD #8\n", "NAME: Life Chemicals F2584-0097\n", "RANDOM_NUMBER_SEED: -1432579076\n", "\n", "**************************************************\n", "RECORD #9\n", "NAME: Asinex ASN 06235439\n", "RANDOM_NUMBER_SEED: -1066688945\n", "\n", "**************************************************\n", "RECORD #10\n", "NAME: Specs AA-504/36954121\n", "RANDOM_NUMBER_SEED: 673777394\n", "\n", "**************************************************\n", "RECORD #11\n", "NAME: Specs AP-866/42442546\n", "RANDOM_NUMBER_SEED: -1454381491\n", "\n", "**************************************************\n", "RECORD #12\n", "NAME: EMC Microcollections 009B3204\n", "RANDOM_NUMBER_SEED: -1787826306\n", "\n", "**************************************************\n", "RECORD #13\n", "NAME: Chembridge 9014479\n", "RANDOM_NUMBER_SEED: -936815266\n", "\n", "**************************************************\n", "RECORD #14\n", "NAME: Chem T&I NSB 0071574\n", "RANDOM_NUMBER_SEED: -2065207547\n", "\n", "**************************************************\n", "RECORD #15\n", "NAME: Chem T&I AMSACS-12929\n", "RANDOM_NUMBER_SEED: 1516633364\n", "\n", "**************************************************\n", "RECORD #16\n", "NAME: Life Chemicals F0396-0052\n", "RANDOM_NUMBER_SEED: 2029428550\n", "\n", "**************************************************\n", "RECORD #17\n", "NAME: Chem T&I AMSACS-08712\n", "RANDOM_NUMBER_SEED: 1516079876\n", "\n", "**************************************************\n", "RECORD #18\n", "NAME: Life Chemicals F0560-0107\n", "RANDOM_NUMBER_SEED: 1620266347\n", "\n", "**************************************************\n", "RECORD #19\n", "NAME: Chemdiv 8005-4355\n", "RANDOM_NUMBER_SEED: 2001933707\n", "\n", "**************************************************\n", "RECORD #20\n", "NAME: InterBioScreen STOCK5S-70232\n", "RANDOM_NUMBER_SEED: 1227970551\n", "\n", "**************************************************\n", "RECORD #21\n", "NAME: Chembridge 5707467\n", "RANDOM_NUMBER_SEED: 2088511607\n", "\n", "**************************************************\n", "RECORD #22\n", "NAME: Asinex ASN 04371767\n", "RANDOM_NUMBER_SEED: -1893642553\n", "\n", "**************************************************\n", "RECORD #23\n", "NAME: A-Synthese-Biotech EX-14747\n", "RANDOM_NUMBER_SEED: -1230563699\n", "\n", "**************************************************\n", "RECORD #24\n", "NAME: InterBioScreen STOCK3S-81928\n", "RANDOM_NUMBER_SEED: 954679382\n", "\n", "**************************************************\n", "RECORD #25\n", "NAME: Nanosyn NS61821\n", "RANDOM_NUMBER_SEED: -139351900\n", "\n", "**************************************************\n", "RECORD #26\n", "NAME: Asinex ASN 05317597\n", "RANDOM_NUMBER_SEED: 89296718\n", "\n", "**************************************************\n", "RECORD #27\n", "NAME: Chem T&I AMSACS-11579\n", "RANDOM_NUMBER_SEED: 1053396742\n", "\n", "**************************************************\n", "RECORD #28\n", "NAME: Bionet 8K-348S\n", "RANDOM_NUMBER_SEED: -1712769436\n", "\n", "**************************************************\n", "RECORD #29\n", "NAME: InterBioScreen STOCK5S-22526\n", "RANDOM_NUMBER_SEED: 1460985292\n", "\n", "**************************************************\n", "RECORD #30\n", "NAME: Asinex ASN 05343028\n", "RANDOM_NUMBER_SEED: -1862510695\n", "\n", "**************************************************\n", "RECORD #31\n", "NAME: Asinex ASN 03365236\n", "RANDOM_NUMBER_SEED: -1738490559\n", "\n", "**************************************************\n", "RECORD #32\n", "NAME: Life Chemicals F0566-0293\n", "RANDOM_NUMBER_SEED: -1858027595\n", "\n", "**************************************************\n", "RECORD #33\n", "NAME: EMC Microcollections 001A3586\n", "RANDOM_NUMBER_SEED: -1176339733\n", "\n", "**************************************************\n", "RECORD #34\n", "NAME: Chem T&I AMSACS-01505\n", "RANDOM_NUMBER_SEED: -1278613421\n", "\n", "**************************************************\n", "RECORD #35\n", "NAME: Chem T&I ARAK0118211\n", "RANDOM_NUMBER_SEED: -853443792\n", "\n", "**************************************************\n", "RECORD #36\n", "NAME: Chembridge 7634772\n", "RANDOM_NUMBER_SEED: 1159848763\n", "\n", "**************************************************\n", "RECORD #37\n", "NAME: Chem T&I IVK/0000805\n", "RANDOM_NUMBER_SEED: 1271738526\n", "\n", "**************************************************\n", "RECORD #38\n", "NAME: InterBioScreen STOCK5S-68320\n", "RANDOM_NUMBER_SEED: 1512947715\n", "\n", "**************************************************\n", "RECORD #39\n", "NAME: InterBioScreen STOCK3S-83770\n", "RANDOM_NUMBER_SEED: -1027559921\n", "\n", "**************************************************\n", "RECORD #40\n", "NAME: Life Chemicals F0529-0304\n", "RANDOM_NUMBER_SEED: -1360569661\n", "\n", "**************************************************\n", "RECORD #41\n", "NAME: Chem T&I AMSACS-12205\n", "RANDOM_NUMBER_SEED: 1963354739\n", "\n", "**************************************************\n", "RECORD #42\n", "NAME: Nanosyn NS40942\n", "RANDOM_NUMBER_SEED: 1708493916\n", "\n", "**************************************************\n", "RECORD #43\n", "NAME: Comgenex CGX-3127127\n", "RANDOM_NUMBER_SEED: 122860512\n", "\n", "**************************************************\n", "RECORD #44\n", "NAME: Pharmeks PHAR059863\n", "RANDOM_NUMBER_SEED: 1907569139\n", "\n", "**************************************************\n", "RECORD #45\n", "NAME: Lithuania 1050567\n", "RANDOM_NUMBER_SEED: -983714487\n", "\n", "**************************************************\n", "RECORD #46\n", "NAME: Chem T&I AMCLME-04601\n", "RANDOM_NUMBER_SEED: -172186695\n", "\n", "**************************************************\n", "RECORD #47\n", "NAME: InterBioScreen STOCK4S-52524\n", "RANDOM_NUMBER_SEED: 1293679942\n", "\n", "**************************************************\n", "RECORD #48\n", "NAME: Cerep CER0136666\n", "RANDOM_NUMBER_SEED: 1724621881\n", "\n", "**************************************************\n", "RECORD #49\n", "NAME: Asinex BAS 02903336\n", "RANDOM_NUMBER_SEED: -197183442\n", "\n", "**************************************************\n", "RECORD #50\n", "NAME: Life Chemicals F0417-0114\n", "RANDOM_NUMBER_SEED: -934185246\n", "\n", "**************************************************\n", "RECORD #51\n", "NAME: Life Chemicals F1359-1195\n", "RANDOM_NUMBER_SEED: -705256868\n", "\n", "**************************************************\n", "RECORD #52\n", "NAME: Pyxis Discovery PYX 00003417\n", "RANDOM_NUMBER_SEED: -579874759\n", "\n", "**************************************************\n", "RECORD #53\n", "NAME: Asinex ASN 09961559\n", "RANDOM_NUMBER_SEED: 252018412\n", "\n", "**************************************************\n", "RECORD #54\n", "NAME: Pyxis Discovery PYX 00004219\n", "RANDOM_NUMBER_SEED: 442400279\n", "\n", "**************************************************\n", "RECORD #55\n", "NAME: Asinex ASN 03271999\n", "RANDOM_NUMBER_SEED: -857063647\n", "\n", "**************************************************\n", "RECORD #56\n", "NAME: InterBioScreen STOCK4S-65808\n", "RANDOM_NUMBER_SEED: 884779981\n", "\n", "**************************************************\n", "RECORD #57\n", "NAME: Life Chemicals F0579-0521\n", "RANDOM_NUMBER_SEED: 757408512\n", "\n", "**************************************************\n", "RECORD #58\n", "NAME: Chem T&I UZI/1102918\n", "RANDOM_NUMBER_SEED: 321298312\n", "\n", "**************************************************\n", "RECORD #59\n", "NAME: Asinex ASN 06916822\n", "RANDOM_NUMBER_SEED: 945030088\n", "\n", "**************************************************\n", "RECORD #60\n", "NAME: Asinex ASN 04361294\n", "RANDOM_NUMBER_SEED: -890195770\n", "\n", "**************************************************\n", "RECORD #61\n", "NAME: Tripos 1557-10610\n", "RANDOM_NUMBER_SEED: -546376213\n", "\n", "**************************************************\n", "RECORD #62\n", "NAME: Maybridge ML 00307\n", "RANDOM_NUMBER_SEED: -760278375\n", "\n", "**************************************************\n", "RECORD #63\n", "NAME: Bionet 10X-0864\n", "RANDOM_NUMBER_SEED: -963423905\n", "\n", "**************************************************\n", "RECORD #64\n", "NAME: Tripos 1526-22023\n", "RANDOM_NUMBER_SEED: 1423020843\n", "\n", "**************************************************\n", "RECORD #65\n", "NAME: InterBioScreen STOCK5S-13559\n", "RANDOM_NUMBER_SEED: -1415652703\n", "\n", "**************************************************\n", "RECORD #66\n", "NAME: Otava 0120630218\n", "RANDOM_NUMBER_SEED: 1968411507\n", "\n", "**************************************************\n", "RECORD #67\n", "NAME: Asinex ASN 02617640\n", "RANDOM_NUMBER_SEED: 987392812\n", "\n", "**************************************************\n", "RECORD #68\n", "NAME: Chem T&I AMSACS-08601\n", "RANDOM_NUMBER_SEED: 1906327463\n", "\n", "**************************************************\n", "RECORD #69\n", "NAME: Tripos 1557-13590\n", "RANDOM_NUMBER_SEED: -296976561\n", "\n", "**************************************************\n", "RECORD #70\n", "NAME: EMC Microcollections 013A0485\n", "RANDOM_NUMBER_SEED: -284922209\n", "\n", "**************************************************\n", "RECORD #71\n", "NAME: Asinex ASN 06601079\n", "RANDOM_NUMBER_SEED: 1018891871\n", "\n", "**************************************************\n", "RECORD #72\n", "NAME: Cerep CER0116166\n", "RANDOM_NUMBER_SEED: -2117337282\n", "\n", "**************************************************\n", "RECORD #73\n", "NAME: Tripos 1554-07659\n", "RANDOM_NUMBER_SEED: 395250929\n", "\n", "**************************************************\n", "RECORD #74\n", "NAME: Princeton Biomolecular OSSK_115610\n", "RANDOM_NUMBER_SEED: 1014989600\n", "\n", "**************************************************\n", "RECORD #75\n", "NAME: Pyxis Discovery PYX 00000172\n", "RANDOM_NUMBER_SEED: -834144177\n", "\n", "**************************************************\n", "RECORD #76\n", "NAME: Chem T&I IVK/0000448\n", "RANDOM_NUMBER_SEED: -219407612\n", "\n", "**************************************************\n", "RECORD #77\n", "NAME: Life Chemicals F0577-0037\n", "RANDOM_NUMBER_SEED: 1326299779\n", "\n", "**************************************************\n", "RECORD #78\n", "NAME: Life Chemicals F0642-0697\n", "RANDOM_NUMBER_SEED: -1889491173\n", "\n", "**************************************************\n", "RECORD #79\n", "NAME: Chem T&I AMSACS-26179\n", "RANDOM_NUMBER_SEED: -908741155\n", "\n", "**************************************************\n", "RECORD #80\n", "NAME: Tripos 1527-02989\n", "RANDOM_NUMBER_SEED: -1111746767\n", "\n", "**************************************************\n", "RECORD #81\n", "NAME: Enamine T0503-9700\n", "RANDOM_NUMBER_SEED: -354822464\n", "\n", "**************************************************\n", "RECORD #82\n", "NAME: Tripos 1513-09513\n", "RANDOM_NUMBER_SEED: 1724375262\n", "\n", "**************************************************\n", "RECORD #83\n", "NAME: Chembridge 7916788\n", "RANDOM_NUMBER_SEED: -1137927022\n", "\n", "**************************************************\n", "RECORD #84\n", "NAME: Asinex ASN 03798095\n", "RANDOM_NUMBER_SEED: 313618031\n", "\n", "**************************************************\n", "RECORD #85\n", "NAME: Life Chemicals F1895-0070\n", "RANDOM_NUMBER_SEED: 796294348\n", "\n", "**************************************************\n", "RECORD #86\n", "NAME: Asinex BAS 05101595\n", "RANDOM_NUMBER_SEED: 1426115998\n", "\n", "**************************************************\n", "RECORD #87\n", "NAME: InterBioScreen STOCK4S-15128\n", "RANDOM_NUMBER_SEED: -489622535\n", "\n", "**************************************************\n", "RECORD #88\n", "NAME: Asinex ASN 05588575\n", "RANDOM_NUMBER_SEED: -1924956477\n", "\n", "**************************************************\n", "RECORD #89\n", "NAME: Biofocus 170_4347_0164\n", "RANDOM_NUMBER_SEED: 662539479\n", "\n", "**************************************************\n", "RECORD #90\n", "NAME: InterBioScreen STOCK5S-06824\n", "RANDOM_NUMBER_SEED: -1391322498\n", "\n", "**************************************************\n", "RECORD #91\n", "NAME: Biofocus 119_0552_0135\n", "RANDOM_NUMBER_SEED: 1552609097\n", "\n", "**************************************************\n", "RECORD #92\n", "NAME: Cerep CER0099275\n", "RANDOM_NUMBER_SEED: 740665687\n", "\n", "**************************************************\n", "RECORD #93\n", "NAME: Chemical Block A3816/0161993\n", "RANDOM_NUMBER_SEED: 899545755\n", "\n", "**************************************************\n", "RECORD #94\n", "NAME: Biofocus 170_0148_0349\n", "RANDOM_NUMBER_SEED: 958028636\n", "\n", "**************************************************\n", "RECORD #95\n", "NAME: Life Chemicals F0631-0161\n", "RANDOM_NUMBER_SEED: -2055591719\n", "\n", "**************************************************\n", "RECORD #96\n", "NAME: Chembridge 9001855\n", "RANDOM_NUMBER_SEED: 286702536\n", "\n", "**************************************************\n", "RECORD #97\n", "NAME: Maybridge HTS 07015\n", "RANDOM_NUMBER_SEED: -301532840\n", "\n", "**************************************************\n", "RECORD #98\n", "NAME: Tripos 1554-03007\n", "RANDOM_NUMBER_SEED: -692770052\n", "\n", "**************************************************\n", "RECORD #99\n", "NAME: Asinex ASN 06116813\n", "RANDOM_NUMBER_SEED: 2034256673\n", "\n", "**************************************************\n", "RECORD #100\n", "NAME: Tripos 1559-05871\n", "RANDOM_NUMBER_SEED: -1517783382\n", "\n", "**************************************************\n", "RECORD #101\n", "NAME: Specs AN-648/40682295\n", "RANDOM_NUMBER_SEED: 823811950\n", "\n", "**************************************************\n", "RECORD #102\n", "NAME: ASDI 150016433\n", "RANDOM_NUMBER_SEED: 947468026\n", "\n", "**************************************************\n", "RECORD #103\n", "NAME: Tripos 1557-01752\n", "RANDOM_NUMBER_SEED: 418049900\n", "\n", "**************************************************\n", "RECORD #104\n", "NAME: Tripos 1518-06794\n", "RANDOM_NUMBER_SEED: -700361560\n", "\n", "**************************************************\n", "RECORD #105\n", "NAME: InterBioScreen STOCK5S-48304\n", "RANDOM_NUMBER_SEED: -1418147199\n", "\n", "**************************************************\n", "RECORD #106\n", "NAME: Chem T&I PMOS-0027433\n", "RANDOM_NUMBER_SEED: 1214666118\n", "\n", "**************************************************\n", "RECORD #107\n", "NAME: Lithuania 1067744\n", "RANDOM_NUMBER_SEED: -1295586934\n", "\n", "**************************************************\n", "RECORD #108\n", "NAME: Maybridge HTS 06299\n", "RANDOM_NUMBER_SEED: 1646247230\n", "\n", "**************************************************\n", "RECORD #109\n", "NAME: InterBioScreen STOCK5S-05837\n", "RANDOM_NUMBER_SEED: 304007821\n", "\n", "**************************************************\n", "RECORD #110\n", "NAME: Life Chemicals F1608-0478\n", "RANDOM_NUMBER_SEED: -210625538\n", "\n", "**************************************************\n", "RECORD #111\n", "NAME: Chemdiv 1416-0529\n", "RANDOM_NUMBER_SEED: -1871940568\n", "\n", "**************************************************\n", "RECORD #112\n", "NAME: Chemical Block A3577/0151844\n", "RANDOM_NUMBER_SEED: 255162763\n", "\n", "**************************************************\n", "RECORD #113\n", "NAME: Comgenex CGX-0740668\n", "RANDOM_NUMBER_SEED: -645974000\n", "\n", "**************************************************\n", "RECORD #114\n", "NAME: Asinex ASN 06745065\n", "RANDOM_NUMBER_SEED: -1785773038\n", "\n", "**************************************************\n", "RECORD #115\n", "NAME: Life Chemicals F0497-0082\n", "RANDOM_NUMBER_SEED: 1432672414\n", "\n", "**************************************************\n", "RECORD #116\n", "NAME: InnovaPharm STT-00192300\n", "RANDOM_NUMBER_SEED: 2033011148\n", "\n", "**************************************************\n", "RECORD #117\n", "NAME: Tripos 1534-05651\n", "RANDOM_NUMBER_SEED: 1679315031\n", "\n", "**************************************************\n", "RECORD #118\n", "NAME: Chembridge 5859646\n", "RANDOM_NUMBER_SEED: 223002307\n", "\n", "**************************************************\n", "RECORD #119\n", "NAME: Specs AK-968/37053096\n", "RANDOM_NUMBER_SEED: -997199673\n", "\n", "**************************************************\n", "RECORD #120\n", "NAME: InterBioScreen STOCK3S-07953\n", "RANDOM_NUMBER_SEED: -613445103\n", "\n", "**************************************************\n", "RECORD #121\n", "NAME: Maybridge RJF 01152\n", "RANDOM_NUMBER_SEED: 852750352\n", "\n", "**************************************************\n", "RECORD #122\n", "NAME: Tripos 1518-03381\n", "RANDOM_NUMBER_SEED: -1391077453\n", "\n", "**************************************************\n", "RECORD #123\n", "NAME: Specs AG-205/07903010\n", "RANDOM_NUMBER_SEED: -2076387613\n", "\n", "**************************************************\n", "RECORD #124\n", "NAME: Asinex ASN 04479736\n", "RANDOM_NUMBER_SEED: -978969846\n", "\n", "**************************************************\n", "RECORD #125\n", "NAME: Asinex ASN 05110337\n", "RANDOM_NUMBER_SEED: -1866057379\n", "\n", "**************************************************\n", "RECORD #126\n", "NAME: Chem T&I AMCLME-05084\n", "RANDOM_NUMBER_SEED: 1067857546\n", "\n", "**************************************************\n", "RECORD #127\n", "NAME: Bionet 10W-0283\n", "RANDOM_NUMBER_SEED: -1092053872\n", "\n", "**************************************************\n", "RECORD #128\n", "NAME: ASDI 100018405\n", "RANDOM_NUMBER_SEED: 356174849\n", "\n", "END OF RUN\n" ] } ], "source": [ "# 6. Run rDock\n", "path_to_lib = 'data/libs/TOP_128_rDock_LLM.sdf'\n", "run_rDock(os.path.join(outpath, \"rDock_results\"), path_to_lib, nruns=nruns)" ] }, { "cell_type": "code", "execution_count": 10, "id": "ac84a02c-4992-448c-a1e6-156449511644", "metadata": {}, "outputs": [], "source": [ "# 7. Create file with docking scores\n", "path_to_scores = \"examples/2_pocketvec/scores.tsv\"\n", "path_to_results = \"examples/2_pocketvec/rDock_results/results.sd\"\n", "\n", "create_file_scores(path_to_scores, path_to_results)" ] }, { "cell_type": "code", "execution_count": 11, "id": "8eccb33d-7557-48a5-a851-ec882363bef1", "metadata": { "tags": [] }, "outputs": [], "source": [ "# # Tar rDock results -- optional\n", "# os.chdir(\"examples/\")\n", "# command = \"tar -czf rDock_results.tar.gz rDock_results\"\n", "# os.system(command)\n", "# os.chdir(\"..\")\n", "\n", "# # Remove folders\n", "# shutil.rmtree(\"examples/rDock_results\")" ] }, { "cell_type": "code", "execution_count": 12, "id": "15c60f63-5d8f-4d1f-86af-8cd3da20da39", "metadata": {}, "outputs": [], "source": [ "# 8. Create PocketVec descriptor\n", "\n", "path_to_scores = \"examples/2_pocketvec/scores.tsv\"\n", "path_to_lib = 'data/libs/TOP_128_rDock_LLM.sdf'\n", "path_to_sorted_lib = 'data/libs/order/' + path_to_lib.split(\"/\")[-1].split(\".sdf\")[0] + \".pkl\"\n", "\n", "# Read scores\n", "scores = read_rDock_scores(path_to_scores)\n", "\n", "# Create fingerprint with raw docking scores\n", "raw = raw_fp(scores, path_to_sorted_lib)\n", "\n", "# Rank scores fp\n", "rank = rank_fp(raw)\n", "\n", "# Dump PocketVec descriptor in pickle format\n", "pickle.dump(rank, open(\"examples/2_pocketvec/PocketVec_fp.pkl\", \"wb\"))" ] }, { "cell_type": "code", "execution_count": 13, "id": "69a8f557-098c-4333-8c1c-c5e8b9cf65a7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "\n", "16 out of 128 molecules have score > 0\n", "\n", "\n" ] } ], "source": [ "# PRINT NUMBER OF OUTLIER MOLECULES \n", "\n", "outlier = str(len([i for i in raw if i > 0]))\n", "\n", "sys.stderr.write(\"\\n\\n\" + outlier + \" out of 128 molecules have score > 0\\n\\n\\n\")\n", "sys.stderr.flush()" ] }, { "cell_type": "code", "execution_count": null, "id": "ab42b40c-6043-4cf2-ba67-edb9df9d8949", "metadata": {}, "outputs": [], "source": [] } ], "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.7.10" } }, "nbformat": 4, "nbformat_minor": 5 }