{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true,
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ipfXU7luj9bS"
},
"source": [
"We've configured colab to use a GPU (Runtme->Change runtime type->Hardware Accelerator=GPU)"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "APMfSF1IIMTr",
"outputId": "4f8ceb44-d12e-4dcb-d096-d83edc341aee"
},
"source": [
"!nvidia-smi"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Thu Apr 18 04:16:22 2024 \n",
"+---------------------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 |\n",
"|-----------------------------------------+----------------------+----------------------+\n",
"| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n",
"| | | MIG M. |\n",
"|=========================================+======================+======================|\n",
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 45C P8 9W / 70W | 0MiB / 15360MiB | 0% Default |\n",
"| | | N/A |\n",
"+-----------------------------------------+----------------------+----------------------+\n",
" \n",
"+---------------------------------------------------------------------------------------+\n",
"| Processes: |\n",
"| GPU GI CI PID Type Process name GPU Memory |\n",
"| ID ID Usage |\n",
"|=======================================================================================|\n",
"| No running processes found |\n",
"+---------------------------------------------------------------------------------------+\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!apt install openbabel"
],
"metadata": {
"id": "n83sEKajbGqJ",
"outputId": "255374d4-31f2-4d38-ab10-72f406377088",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 11,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Reading package lists... Done\n",
"Building dependency tree... Done\n",
"Reading state information... Done\n",
"The following additional packages will be installed:\n",
" libinchi1 libmaeparser1 libopenbabel7\n",
"The following NEW packages will be installed:\n",
" libinchi1 libmaeparser1 libopenbabel7 openbabel\n",
"0 upgraded, 4 newly installed, 0 to remove and 45 not upgraded.\n",
"Need to get 3,903 kB of archives.\n",
"After this operation, 16.9 MB of additional disk space will be used.\n",
"Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libinchi1 amd64 1.03+dfsg-4 [455 kB]\n",
"Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libmaeparser1 amd64 1.2.4-1build1 [88.2 kB]\n",
"Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libopenbabel7 amd64 3.1.1+dfsg-6ubuntu5 [3,231 kB]\n",
"Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 openbabel amd64 3.1.1+dfsg-6ubuntu5 [128 kB]\n",
"Fetched 3,903 kB in 1s (5,040 kB/s)\n",
"Selecting previously unselected package libinchi1.\n",
"(Reading database ... 121752 files and directories currently installed.)\n",
"Preparing to unpack .../libinchi1_1.03+dfsg-4_amd64.deb ...\n",
"Unpacking libinchi1 (1.03+dfsg-4) ...\n",
"Selecting previously unselected package libmaeparser1:amd64.\n",
"Preparing to unpack .../libmaeparser1_1.2.4-1build1_amd64.deb ...\n",
"Unpacking libmaeparser1:amd64 (1.2.4-1build1) ...\n",
"Selecting previously unselected package libopenbabel7.\n",
"Preparing to unpack .../libopenbabel7_3.1.1+dfsg-6ubuntu5_amd64.deb ...\n",
"Unpacking libopenbabel7 (3.1.1+dfsg-6ubuntu5) ...\n",
"Selecting previously unselected package openbabel.\n",
"Preparing to unpack .../openbabel_3.1.1+dfsg-6ubuntu5_amd64.deb ...\n",
"Unpacking openbabel (3.1.1+dfsg-6ubuntu5) ...\n",
"Setting up libmaeparser1:amd64 (1.2.4-1build1) ...\n",
"Setting up libinchi1 (1.03+dfsg-4) ...\n",
"Setting up libopenbabel7 (3.1.1+dfsg-6ubuntu5) ...\n",
"Setting up openbabel (3.1.1+dfsg-6ubuntu5) ...\n",
"Processing triggers for libc-bin (2.35-0ubuntu3.4) ...\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n",
"\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n",
"\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n",
"\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n",
"\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n",
"\n",
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n",
"\n",
"Processing triggers for man-db (2.10.2-1) ...\n"
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "-UjnC9f-kMl2"
},
"source": [
"Download the linux binary and make it executable."
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "KLUI3VHLIPRe",
"outputId": "1f0aabac-fae9-4af3-d895-0c4115500f27"
},
"source": [
"!wget https://github.com/gnina/gnina/releases/download/v1.1/gnina"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"--2024-04-18 04:16:26-- https://github.com/gnina/gnina/releases/download/v1.1/gnina\n",
"Resolving github.com (github.com)... 140.82.116.4\n",
"Connecting to github.com (github.com)|140.82.116.4|:443... connected.\n",
"HTTP request sent, awaiting response... 302 Found\n",
"Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/45548146/bc227ff8-7934-457d-95b3-eab58982638a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240418%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240418T041626Z&X-Amz-Expires=300&X-Amz-Signature=3ebf98251a72141959c591933b125a8264130cd2120b92127220578a9109190a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45548146&response-content-disposition=attachment%3B%20filename%3Dgnina&response-content-type=application%2Foctet-stream [following]\n",
"--2024-04-18 04:16:26-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/45548146/bc227ff8-7934-457d-95b3-eab58982638a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240418%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240418T041626Z&X-Amz-Expires=300&X-Amz-Signature=3ebf98251a72141959c591933b125a8264130cd2120b92127220578a9109190a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45548146&response-content-disposition=attachment%3B%20filename%3Dgnina&response-content-type=application%2Foctet-stream\n",
"Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n",
"Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 306470832 (292M) [application/octet-stream]\n",
"Saving to: ‘gnina’\n",
"\n",
"gnina 100%[===================>] 292.27M 137MB/s in 2.1s \n",
"\n",
"2024-04-18 04:16:29 (137 MB/s) - ‘gnina’ saved [306470832/306470832]\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "3nWRPH0BIYFd"
},
"source": [
"!chmod +x gnina"
],
"execution_count": 3,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "wWBjgurSlmkN",
"outputId": "b27e9c1d-0229-4850-ce55-935b05270d47"
},
"source": [
"!./gnina --version"
],
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"gnina v1.1 master:e4cb380+ Built Dec 18 2023.\n"
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Qk-XSJyukWJE"
},
"source": [
"Get a pdb and extract the receptor and ligand."
]
},
{
"cell_type": "code",
"metadata": {
"id": "EWmvr7W8IbPi",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "7a939c7f-b1e4-444d-8d38-5a3540c15b5f"
},
"source": [
"!wget http://files.rcsb.org/download/3ERK.pdb"
],
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"--2024-04-18 04:16:43-- http://files.rcsb.org/download/3ERK.pdb\n",
"Resolving files.rcsb.org (files.rcsb.org)... 132.249.213.193\n",
"Connecting to files.rcsb.org (files.rcsb.org)|132.249.213.193|:80... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: unspecified [application/octet-stream]\n",
"Saving to: ‘3ERK.pdb’\n",
"\n",
"\r3ERK.pdb [<=> ] 0 --.-KB/s \r3ERK.pdb [ <=> ] 270.21K --.-KB/s in 0.1s \n",
"\n",
"2024-04-18 04:16:43 (2.43 MB/s) - ‘3ERK.pdb’ saved [276696]\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "6B5cdMnmIffy"
},
"source": [
"!grep ATOM 3ERK.pdb > rec.pdb"
],
"execution_count": 6,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "z2Ep6undhGq9"
},
"source": [
"!grep SB4 3ERK.pdb > lig.pdb"
],
"execution_count": 7,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# !cat rec.pdb"
],
"metadata": {
"id": "33oP5PILL84Y"
},
"execution_count": 18,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# !cat lig.pdb"
],
"metadata": {
"id": "cckN9OENMGsi"
},
"execution_count": 8,
"outputs": []
},
{
"cell_type": "code",
"source": [
"!wget https://go.drugbank.com/structures/small_molecule_drugs/DB04542.sdf?type=3d -O DB04542.sdf"
],
"metadata": {
"id": "hoaOTfVCMRKW",
"outputId": "bb0e8249-70e9-4c37-e990-74f1d0b696f1",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 9,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"--2024-04-18 04:16:57-- https://go.drugbank.com/structures/small_molecule_drugs/DB04542.sdf?type=3d\n",
"Resolving go.drugbank.com (go.drugbank.com)... 172.66.41.6, 172.66.42.250, 2606:4700:3108::ac42:2afa, ...\n",
"Connecting to go.drugbank.com (go.drugbank.com)|172.66.41.6|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: unspecified [text/plain]\n",
"Saving to: ‘DB04542.sdf’\n",
"\n",
"DB04542.sdf [ <=> ] 5.53K --.-KB/s in 0s \n",
"\n",
"2024-04-18 04:16:57 (72.5 MB/s) - ‘DB04542.sdf’ saved [5662]\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!obabel DB04542.sdf -O DB04542.pdb"
],
"metadata": {
"id": "_Dy_0DYQMlKx",
"outputId": "a5ce46f2-75b6-4b64-d8de-7f99be6e9774",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 13,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1 molecule converted\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!obabel DB04542.pdb -OB04542.pdb"
],
"metadata": {
"id": "PhoqOPvUTVY8",
"outputId": "2d98aa19-f05d-4a24-bdfc-5d5b123e7df4",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1 molecule converted\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!cat DB04542.pdb"
],
"metadata": {
"id": "7a3d1TPLMnVD",
"outputId": "dd41e0a5-585f-400a-8a9a-fcea30091735",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 15,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"COMPND 455742 \n",
"AUTHOR GENERATED BY OPEN BABEL 3.1.1\n",
"HETATM 1 P UNL 1 -2.911 1.345 1.001 1.00 0.00 P \n",
"HETATM 2 P UNL 1 -4.302 -0.558 -0.758 1.00 0.00 P \n",
"HETATM 3 O UNL 1 1.367 0.860 1.085 1.00 0.00 O \n",
"HETATM 4 O UNL 1 -1.322 1.612 1.154 1.00 0.00 O \n",
"HETATM 5 O UNL 1 4.380 -1.771 0.062 1.00 0.00 O \n",
"HETATM 6 O UNL 1 -3.018 0.124 -0.053 1.00 0.00 O \n",
"HETATM 7 O UNL 1 -3.453 2.613 0.156 1.00 0.00 O \n",
"HETATM 8 O UNL 1 1.234 -5.123 -0.051 1.00 0.00 O \n",
"HETATM 9 O UNL 1 -3.636 1.107 2.294 1.00 0.00 O \n",
"HETATM 10 O UNL 1 -4.877 0.618 -1.706 1.00 0.00 O \n",
"HETATM 11 O UNL 1 -3.638 -1.597 -1.804 1.00 0.00 O \n",
"HETATM 12 O UNL 1 -5.295 -1.157 0.194 1.00 0.00 O \n",
"HETATM 13 N UNL 1 2.129 -1.162 0.187 1.00 0.00 N \n",
"HETATM 14 N UNL 1 2.985 3.132 -0.271 1.00 0.00 N \n",
"HETATM 15 N UNL 1 2.800 -3.433 0.006 1.00 0.00 N \n",
"HETATM 16 N UNL 1 2.867 4.358 -0.429 1.00 0.00 N1+\n",
"HETATM 17 N UNL 1 2.769 5.486 -0.569 1.00 0.00 N1-\n",
"HETATM 18 C UNL 1 1.851 2.320 -0.730 1.00 0.00 C \n",
"HETATM 19 C UNL 1 0.914 2.066 0.444 1.00 0.00 C \n",
"HETATM 20 C UNL 1 2.340 0.934 -1.079 1.00 0.00 C \n",
"HETATM 21 C UNL 1 2.378 0.247 0.274 1.00 0.00 C \n",
"HETATM 22 C UNL 1 -0.529 1.849 0.004 1.00 0.00 C \n",
"HETATM 23 C UNL 1 0.811 -1.608 0.205 1.00 0.00 C \n",
"HETATM 24 C UNL 1 3.189 -2.091 0.084 1.00 0.00 C \n",
"HETATM 25 C UNL 1 0.442 -2.893 0.130 1.00 0.00 C \n",
"HETATM 26 C UNL 1 1.505 -3.928 0.020 1.00 0.00 C \n",
"HETATM 27 C UNL 1 -0.982 -3.347 0.151 1.00 0.00 C \n",
"HETATM 28 H UNL 1 1.358 2.801 -1.583 1.00 0.00 H \n",
"HETATM 29 H UNL 1 0.947 2.864 1.194 1.00 0.00 H \n",
"HETATM 30 H UNL 1 3.313 0.912 -1.581 1.00 0.00 H \n",
"HETATM 31 H UNL 1 1.617 0.449 -1.747 1.00 0.00 H \n",
"HETATM 32 H UNL 1 3.344 0.423 0.763 1.00 0.00 H \n",
"HETATM 33 H UNL 1 -0.901 2.745 -0.504 1.00 0.00 H \n",
"HETATM 34 H UNL 1 -0.625 1.002 -0.680 1.00 0.00 H \n",
"HETATM 35 H UNL 1 0.036 -0.858 0.279 1.00 0.00 H \n",
"HETATM 36 H UNL 1 3.547 -4.117 -0.069 1.00 0.00 H \n",
"HETATM 37 H UNL 1 -1.234 -3.859 -0.783 1.00 0.00 H \n",
"HETATM 38 H UNL 1 -1.677 -2.510 0.272 1.00 0.00 H \n",
"HETATM 39 H UNL 1 -1.151 -4.038 0.984 1.00 0.00 H \n",
"HETATM 40 H UNL 1 -3.615 3.460 0.624 1.00 0.00 H \n",
"HETATM 41 H UNL 1 -5.718 0.470 -2.189 1.00 0.00 H \n",
"HETATM 42 H UNL 1 -4.221 -2.207 -2.302 1.00 0.00 H \n",
"CONECT 1 4 6 7 9 \n",
"CONECT 1 9 \n",
"CONECT 2 6 10 11 12 \n",
"CONECT 2 12 \n",
"CONECT 3 19 21 \n",
"CONECT 4 1 22 \n",
"CONECT 5 24 24 \n",
"CONECT 6 1 2 \n",
"CONECT 7 1 40 \n",
"CONECT 8 26 26 \n",
"CONECT 9 1 1 \n",
"CONECT 10 2 41 \n",
"CONECT 11 2 42 \n",
"CONECT 12 2 2 \n",
"CONECT 13 21 23 24 \n",
"CONECT 14 16 16 18 \n",
"CONECT 15 24 26 36 \n",
"CONECT 16 14 14 17 17 \n",
"CONECT 17 16 16 \n",
"CONECT 18 14 19 20 28 \n",
"CONECT 19 3 18 22 29 \n",
"CONECT 20 18 21 30 31 \n",
"CONECT 21 3 13 20 32 \n",
"CONECT 22 4 19 33 34 \n",
"CONECT 23 13 25 25 35 \n",
"CONECT 24 5 5 13 15 \n",
"CONECT 25 23 23 26 27 \n",
"CONECT 26 8 8 15 25 \n",
"CONECT 27 25 37 38 39 \n",
"CONECT 28 18 \n",
"CONECT 29 19 \n",
"CONECT 30 20 \n",
"CONECT 31 20 \n",
"CONECT 32 21 \n",
"CONECT 33 22 \n",
"CONECT 34 22 \n",
"CONECT 35 23 \n",
"CONECT 36 15 \n",
"CONECT 37 27 \n",
"CONECT 38 27 \n",
"CONECT 39 27 \n",
"CONECT 40 7 \n",
"CONECT 41 10 \n",
"CONECT 42 11 \n",
"MASTER 0 0 0 0 0 0 0 0 42 0 42 0\n",
"END\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!grep UNL DB04542.pdb > lig.pdb"
],
"metadata": {
"id": "Jjkqr1vtOFzv"
},
"execution_count": 16,
"outputs": []
},
{
"cell_type": "code",
"source": [
"!cat lig.pdb"
],
"metadata": {
"id": "OCQji-LxOaBA",
"outputId": "d30935d5-b48e-4f61-889c-db71bfee2752",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 17,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"HETATM 1 P UNL 1 -2.911 1.345 1.001 1.00 0.00 P \n",
"HETATM 2 P UNL 1 -4.302 -0.558 -0.758 1.00 0.00 P \n",
"HETATM 3 O UNL 1 1.367 0.860 1.085 1.00 0.00 O \n",
"HETATM 4 O UNL 1 -1.322 1.612 1.154 1.00 0.00 O \n",
"HETATM 5 O UNL 1 4.380 -1.771 0.062 1.00 0.00 O \n",
"HETATM 6 O UNL 1 -3.018 0.124 -0.053 1.00 0.00 O \n",
"HETATM 7 O UNL 1 -3.453 2.613 0.156 1.00 0.00 O \n",
"HETATM 8 O UNL 1 1.234 -5.123 -0.051 1.00 0.00 O \n",
"HETATM 9 O UNL 1 -3.636 1.107 2.294 1.00 0.00 O \n",
"HETATM 10 O UNL 1 -4.877 0.618 -1.706 1.00 0.00 O \n",
"HETATM 11 O UNL 1 -3.638 -1.597 -1.804 1.00 0.00 O \n",
"HETATM 12 O UNL 1 -5.295 -1.157 0.194 1.00 0.00 O \n",
"HETATM 13 N UNL 1 2.129 -1.162 0.187 1.00 0.00 N \n",
"HETATM 14 N UNL 1 2.985 3.132 -0.271 1.00 0.00 N \n",
"HETATM 15 N UNL 1 2.800 -3.433 0.006 1.00 0.00 N \n",
"HETATM 16 N UNL 1 2.867 4.358 -0.429 1.00 0.00 N1+\n",
"HETATM 17 N UNL 1 2.769 5.486 -0.569 1.00 0.00 N1-\n",
"HETATM 18 C UNL 1 1.851 2.320 -0.730 1.00 0.00 C \n",
"HETATM 19 C UNL 1 0.914 2.066 0.444 1.00 0.00 C \n",
"HETATM 20 C UNL 1 2.340 0.934 -1.079 1.00 0.00 C \n",
"HETATM 21 C UNL 1 2.378 0.247 0.274 1.00 0.00 C \n",
"HETATM 22 C UNL 1 -0.529 1.849 0.004 1.00 0.00 C \n",
"HETATM 23 C UNL 1 0.811 -1.608 0.205 1.00 0.00 C \n",
"HETATM 24 C UNL 1 3.189 -2.091 0.084 1.00 0.00 C \n",
"HETATM 25 C UNL 1 0.442 -2.893 0.130 1.00 0.00 C \n",
"HETATM 26 C UNL 1 1.505 -3.928 0.020 1.00 0.00 C \n",
"HETATM 27 C UNL 1 -0.982 -3.347 0.151 1.00 0.00 C \n",
"HETATM 28 H UNL 1 1.358 2.801 -1.583 1.00 0.00 H \n",
"HETATM 29 H UNL 1 0.947 2.864 1.194 1.00 0.00 H \n",
"HETATM 30 H UNL 1 3.313 0.912 -1.581 1.00 0.00 H \n",
"HETATM 31 H UNL 1 1.617 0.449 -1.747 1.00 0.00 H \n",
"HETATM 32 H UNL 1 3.344 0.423 0.763 1.00 0.00 H \n",
"HETATM 33 H UNL 1 -0.901 2.745 -0.504 1.00 0.00 H \n",
"HETATM 34 H UNL 1 -0.625 1.002 -0.680 1.00 0.00 H \n",
"HETATM 35 H UNL 1 0.036 -0.858 0.279 1.00 0.00 H \n",
"HETATM 36 H UNL 1 3.547 -4.117 -0.069 1.00 0.00 H \n",
"HETATM 37 H UNL 1 -1.234 -3.859 -0.783 1.00 0.00 H \n",
"HETATM 38 H UNL 1 -1.677 -2.510 0.272 1.00 0.00 H \n",
"HETATM 39 H UNL 1 -1.151 -4.038 0.984 1.00 0.00 H \n",
"HETATM 40 H UNL 1 -3.615 3.460 0.624 1.00 0.00 H \n",
"HETATM 41 H UNL 1 -5.718 0.470 -2.189 1.00 0.00 H \n",
"HETATM 42 H UNL 1 -4.221 -2.207 -2.302 1.00 0.00 H \n"
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "R_TooV5OkuI3"
},
"source": [
"Redock the cognate ligand. Set random seed for reproducibility.\n",
"\n",
"Affinity is the Vina score of the pose. CNN pose score is a probability calculated by a convolutional neural network that the pose is a low RMSD pose. CNN affinity is the CNN's prediction of the pK (higher is better, e.g. 9 is nanomolar, 6 is micromolar).\n",
"\n",
"This particular ligand has an experimental affinity of 18$\\mu$M so the prediction is pretty close."
]
},
{
"cell_type": "code",
"source": [
"!./gnina -r rec.pdb -l lig.pdb --autobox_ligand rec.pdb -o docked.sdf --seed 0"
],
"metadata": {
"id": "kbrx83XdayoF",
"outputId": "154695e0-4f18-46ea-d1b6-b0249e61160b",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 18,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" _ \n",
" (_) \n",
" __ _ _ __ _ _ __ __ _ \n",
" / _` | '_ \\| | '_ \\ / _` |\n",
" | (_| | | | | | | | | (_| |\n",
" \\__, |_| |_|_|_| |_|\\__,_|\n",
" __/ | \n",
" |___/ \n",
"\n",
"gnina v1.1 master:e4cb380+ Built Dec 18 2023.\n",
"gnina is based on smina and AutoDock Vina.\n",
"Please cite appropriately.\n",
"\n",
"Commandline: ./gnina -r rec.pdb -l lig.pdb --autobox_ligand rec.pdb -o docked.sdf --seed 0\n",
"==============================\n",
"*** Open Babel Warning in PerceiveBondOrders\n",
" Failed to kekulize aromatic bonds in OBMol::PerceiveBondOrders\n",
"\n",
"==============================\n",
"*** Open Babel Warning in PerceiveBondOrders\n",
" Failed to kekulize aromatic bonds in OBMol::PerceiveBondOrders\n",
"\n",
"Using random seed: 0\n",
"\n",
"0% 10 20 30 40 50 60 70 80 90 100%\n",
"|----|----|----|----|----|----|----|----|----|----|\n",
"***************************************************\n",
" | pose 0 | initial pose not within box\n",
"\n",
"mode | affinity | intramol | CNN | CNN\n",
" | (kcal/mol) | (kcal/mol) | pose score | affinity\n",
"-----+------------+------------+------------+----------\n",
" 1 -7.06 -1.08 0.5696 5.752\n",
" 2 -7.77 -0.98 0.3364 5.421\n",
" 3 -7.17 0.21 0.2371 4.887\n",
" 4 -5.93 -0.41 0.2147 4.012\n",
" 5 -6.86 -0.11 0.2078 4.662\n",
" 6 -5.99 -1.46 0.1994 4.565\n",
" 7 -7.78 -0.76 0.1727 5.375\n",
" 8 -7.06 -1.26 0.1689 5.139\n",
" 9 -7.33 -1.45 0.1587 5.155\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "wbfj-hvzkrBi"
},
"source": [
"# !./gnina -r rec.pdb -l lig.pdb --autobox_ligand lig.pdb -o docked.sdf --seed 0"
],
"execution_count": 19,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "sMTknhigk2GT",
"outputId": "d967d57c-30e0-47cd-82a2-981643ab5c3d"
},
"source": [
"!pip install py3Dmol"
],
"execution_count": 20,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting py3Dmol\n",
" Downloading py3Dmol-2.1.0-py2.py3-none-any.whl (12 kB)\n",
"Installing collected packages: py3Dmol\n",
"Successfully installed py3Dmol-2.1.0\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 515
},
"id": "WctyMpdMluFN",
"outputId": "5acdc2ca-7e8d-4885-d78c-5670c5b2852f"
},
"source": [
"import py3Dmol\n",
"v = py3Dmol.view()\n",
"v.addModel(open('rec.pdb').read())\n",
"v.setStyle({'cartoon':{},'stick':{'radius':.1}})\n",
"v.addModel(open('lig.pdb').read())\n",
"v.setStyle({'model':1},{'stick':{'colorscheme':'dimgrayCarbon','radius':.125}})\n",
"v.addModelsAsFrames(open('docked.sdf').read())\n",
"v.setStyle({'model':2},{'stick':{'colorscheme':'greenCarbon'}})\n",
"v.zoomTo({'model':1})\n",
"v.rotate(90)\n",
"v.animate({'interval':2000})\n"
],
"execution_count": 25,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.