{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "ecce356e-321b-441e-8a5d-a20bf72f8691", "metadata": {}, "outputs": [], "source": [ "import dask.dataframe as dd" ] }, { "cell_type": "code", "execution_count": 3, "id": "89cbcd82-4ca2-4aba-95b7-e58c0ceed770", "metadata": {}, "outputs": [], "source": [ "cols = ['Ligand SMILES', 'IC50 (nM)','KEGG ID of Ligand','Ki (nM)', 'Kd (nM)','EC50 (nM)']" ] }, { "cell_type": "code", "execution_count": 3, "id": "a870d8d7-374b-4474-b9ee-305bbf9f17a9", "metadata": {}, "outputs": [], "source": [ "import tqdm.notebook" ] }, { "cell_type": "code", "execution_count": 5, "id": "e9f76b32-e8f0-47ee-b592-a91a88f4f93e", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c988bc89781242ec8c8b7f8fd0b1c233", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/13 [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", "
Ligand SMILESIC50 (nM)KEGG ID of LigandKi (nM)Kd (nM)EC50 (nM)seq
0COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1NoneNone0.24NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
1O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn...NoneNone0.25NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
2O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=...NoneNone0.41NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
3OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@...NoneNone0.8NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
4OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H...NoneNone0.99NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
\n", "" ], "text/plain": [ " Ligand SMILES IC50 (nM) \\\n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 None \n", "1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... None \n", "2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... None \n", "3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... None \n", "4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... None \n", "\n", " KEGG ID of Ligand Ki (nM) Kd (nM) EC50 (nM) \\\n", "0 None 0.24 None None \n", "1 None 0.25 None None \n", "2 None 0.41 None None \n", "3 None 0.8 None None \n", "4 None 0.99 None None \n", "\n", " seq \n", "0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddf.head()" ] }, { "cell_type": "code", "execution_count": 9, "id": "f504d7aa-dfc1-4346-a136-8814c4b5d979", "metadata": {}, "outputs": [], "source": [ "ddf.repartition(partition_size='25MB').to_parquet('bindingdb/parquet_data/all_targets',schema='infer')" ] }, { "cell_type": "code", "execution_count": 4, "id": "d7eafa69-4606-4b34-ae8f-8c6462dcb004", "metadata": {}, "outputs": [], "source": [ "ddf = dd.read_parquet('../binding_affinity/bindingdb/parquet_data/all_targets')" ] }, { "cell_type": "code", "execution_count": 5, "id": "b151868a-0cd6-405e-8401-f79918fb0b07", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Dask DataFrame Structure:
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ligand SMILESIC50 (nM)KEGG ID of LigandKi (nM)Kd (nM)EC50 (nM)seq
npartitions=483
objectobjectobjectobjectobjectobjectobject
.....................
........................
.....................
.....................
\n", "
\n", "
Dask Name: read-parquet, 483 tasks
" ], "text/plain": [ "Dask DataFrame Structure:\n", " Ligand SMILES IC50 (nM) KEGG ID of Ligand Ki (nM) Kd (nM) EC50 (nM) seq\n", "npartitions=483 \n", " object object object object object object object\n", " ... ... ... ... ... ... ...\n", "... ... ... ... ... ... ... ...\n", " ... ... ... ... ... ... ...\n", " ... ... ... ... ... ... ...\n", "Dask Name: read-parquet, 483 tasks" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddf" ] }, { "cell_type": "code", "execution_count": 6, "id": "c00102b8-f4be-4ebd-8d30-7a2c7fc2d05e", "metadata": {}, "outputs": [], "source": [ "ddf_nonnull = ddf[~ddf.seq.isnull()].copy()" ] }, { "cell_type": "code", "execution_count": 8, "id": "c5337e06-1e45-4180-90ed-49ac9ecdd24a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ligand SMILESIC50 (nM)KEGG ID of LigandKi (nM)Kd (nM)EC50 (nM)seq
0COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1NoneNone0.24NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
1O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn...NoneNone0.25NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
2O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=...NoneNone0.41NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
3OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@...NoneNone0.8NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
4OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H...NoneNone0.99NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...
\n", "
" ], "text/plain": [ " Ligand SMILES IC50 (nM) \\\n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 None \n", "1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... None \n", "2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... None \n", "3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... None \n", "4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... None \n", "\n", " KEGG ID of Ligand Ki (nM) Kd (nM) EC50 (nM) \\\n", "0 None 0.24 None None \n", "1 None 0.25 None None \n", "2 None 0.41 None None \n", "3 None 0.8 None None \n", "4 None 0.99 None None \n", "\n", " seq \n", "0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddf_nonnull.head()" ] }, { "cell_type": "code", "execution_count": 17, "id": "7b423365-4989-4325-a5a5-845d852d52e9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2512985" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(ddf_nonnull)" ] }, { "cell_type": "code", "execution_count": 11, "id": "872edb84-3459-43d9-8e0e-e2a6b5d281eb", "metadata": {}, "outputs": [], "source": [ "from pint import UnitRegistry\n", "import numpy as np\n", "import re\n", "ureg = UnitRegistry()\n", "\n", "def to_uM(affinities):\n", " ic50, Ki, Kd, ec50 = affinities\n", "\n", " vals = []\n", " \n", " try:\n", " ic50 = ureg(str(ic50)+'nM').m_as(ureg.uM)\n", " vals.append(ic50)\n", " except:\n", " pass\n", "\n", " try:\n", " Ki = ureg(str(Ki)+'nM').m_as(ureg.uM)\n", " vals.append(Ki)\n", " except:\n", " pass\n", "\n", " try:\n", " Kd = ureg(str(Kd)+'nM').m_as(ureg.uM)\n", " vals.append(Kd)\n", " except:\n", " pass\n", "\n", " try:\n", " ec50 = ureg(str(ec50)+'nM').m_as(ureg.uM)\n", " vals.append(ec50)\n", " except:\n", " pass\n", "\n", " if len(vals) > 0:\n", " vals = np.array(vals)\n", " return np.mean(vals[~np.isnan(vals)])\n", " \n", " return None" ] }, { "cell_type": "code", "execution_count": 12, "id": "b3cff13c-19b2-4413-a84b-d99062f516a7", "metadata": {}, "outputs": [], "source": [ "df_nonnull = ddf_nonnull.compute()" ] }, { "cell_type": "code", "execution_count": 13, "id": "ca9795de-e821-4dc3-a7bf-70ade9e4c7f0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Pandarallel will run on 32 workers.\n", "INFO: Pandarallel will use Memory file system to transfer data between the main process and workers.\n" ] } ], "source": [ "from pandarallel import pandarallel\n", "pandarallel.initialize()\n" ] }, { "cell_type": "code", "execution_count": 14, "id": "4356a3e2-fede-48e7-a486-343661fe0a0a", "metadata": {}, "outputs": [], "source": [ "df_affinity = df_nonnull.copy()\n", "df_affinity['affinity_uM'] = df_affinity[['IC50 (nM)', 'Ki (nM)', 'Kd (nM)','EC50 (nM)']].parallel_apply(to_uM,axis=1)" ] }, { "cell_type": "code", "execution_count": 15, "id": "e91c3af8-84a5-42a2-9e25-49cb2f320b0b", "metadata": {}, "outputs": [], "source": [ "df_affinity[~df_affinity['affinity_uM'].isnull()].to_parquet('data/bindingdb.parquet')" ] }, { "cell_type": "code", "execution_count": 1, "id": "f3a9173e-d574-4314-9cea-f8c0a66766c0", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "df_affinity = pd.read_parquet('data/bindingdb.parquet')" ] }, { "cell_type": "code", "execution_count": 2, "id": "f602fdbe-7083-436c-9eac-9d97fbc8be67", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2510716" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_affinity)" ] }, { "cell_type": "code", "execution_count": 3, "id": "27194288-cf3e-4c30-ad55-3b0998fdf939", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ligand SMILESIC50 (nM)KEGG ID of LigandKi (nM)Kd (nM)EC50 (nM)seqaffinity_uM
0COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1NoneNone0.24NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00024
1O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn...NoneNone0.25NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00025
2O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=...NoneNone0.41NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00041
3OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@...NoneNone0.8NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00080
4OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H...NoneNone0.99NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00099
\n", "
" ], "text/plain": [ " Ligand SMILES IC50 (nM) \\\n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 None \n", "1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... None \n", "2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... None \n", "3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... None \n", "4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... None \n", "\n", " KEGG ID of Ligand Ki (nM) Kd (nM) EC50 (nM) \\\n", "0 None 0.24 None None \n", "1 None 0.25 None None \n", "2 None 0.41 None None \n", "3 None 0.8 None None \n", "4 None 0.99 None None \n", "\n", " seq affinity_uM \n", "0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00024 \n", "1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00025 \n", "2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00041 \n", "3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00080 \n", "4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00099 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_affinity.head()" ] }, { "cell_type": "code", "execution_count": 4, "id": "603fd298-0aa6-4097-b298-c55db013548c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2510716" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_affinity)" ] }, { "cell_type": "code", "execution_count": 5, "id": "d95ad9a9-d4ca-4679-8a33-235fe6e7047f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2510716" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_affinity[~df_affinity['affinity_uM'].isnull()])" ] }, { "cell_type": "code", "execution_count": 6, "id": "b21c4683-0fe1-4a0a-a55c-c0dc80193f36", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ligand SMILESIC50 (nM)KEGG ID of LigandKi (nM)Kd (nM)EC50 (nM)seqaffinity_uM
0COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1NoneNone0.24NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00024
1O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn...NoneNone0.25NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00025
2O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=...NoneNone0.41NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00041
3OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@...NoneNone0.8NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00080
4OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H...NoneNone0.99NoneNonePQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...0.00099
...........................
5112COc1ccc(NC(=O)N2CCC(CC2)C(=O)N[C@@H](CC(C)C)C(...17NoneNoneNoneNoneMSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE...0.01700
5113CC(C)C[C@H](NC(=O)C1CCN(CC1)C(=O)Nc1cnccn1)C(=...76NoneNoneNoneNoneMSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE...0.07600
5313C[C@H](NC(=O)[C@H](Cc1ccccc1)NC(=O)OCc1ccccc1)...>100000NoneNoneNoneNoneMSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE...100.00000
5314FCC(=O)CNC(=O)[C@H](Cc1ccccc1)NC(=O)c1cccc2ccc...>100000NoneNoneNoneNoneMSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE...100.00000
5361FCC(=O)CNC(=O)[C@H](Cc1ccccc1)NC(=O)c1ccccc1>100000NoneNoneNoneNoneMSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE...100.00000
\n", "

2510716 rows × 8 columns

\n", "
" ], "text/plain": [ " Ligand SMILES IC50 (nM) \\\n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 None \n", "1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... None \n", "2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... None \n", "3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... None \n", "4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... None \n", "... ... ... \n", "5112 COc1ccc(NC(=O)N2CCC(CC2)C(=O)N[C@@H](CC(C)C)C(... 17 \n", "5113 CC(C)C[C@H](NC(=O)C1CCN(CC1)C(=O)Nc1cnccn1)C(=... 76 \n", "5313 C[C@H](NC(=O)[C@H](Cc1ccccc1)NC(=O)OCc1ccccc1)... >100000 \n", "5314 FCC(=O)CNC(=O)[C@H](Cc1ccccc1)NC(=O)c1cccc2ccc... >100000 \n", "5361 FCC(=O)CNC(=O)[C@H](Cc1ccccc1)NC(=O)c1ccccc1 >100000 \n", "\n", " KEGG ID of Ligand Ki (nM) Kd (nM) EC50 (nM) \\\n", "0 None 0.24 None None \n", "1 None 0.25 None None \n", "2 None 0.41 None None \n", "3 None 0.8 None None \n", "4 None 0.99 None None \n", "... ... ... ... ... \n", "5112 None None None None \n", "5113 None None None None \n", "5313 None None None None \n", "5314 None None None None \n", "5361 None None None None \n", "\n", " seq affinity_uM \n", "0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00024 \n", "1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00025 \n", "2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00041 \n", "3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00080 \n", "4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... 0.00099 \n", "... ... ... \n", "5112 MSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE... 0.01700 \n", "5113 MSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE... 0.07600 \n", "5313 MSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE... 100.00000 \n", "5314 MSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE... 100.00000 \n", "5361 MSYDRAITVFSPDGHLFQVEYAQEAVKKGSTAVGVRGRDIVVLGVE... 100.00000 \n", "\n", "[2510716 rows x 8 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_affinity" ] }, { "cell_type": "code", "execution_count": 25, "id": "20690729", "metadata": {}, "outputs": [], "source": [ "import rdkit.Chem as Chem" ] }, { "cell_type": "code", "execution_count": 27, "id": "48114dcc", "metadata": {}, "outputs": [], "source": [ "df_pdb = df[~df['PDB ID(s) for Ligand-Target Complex'].isnull()][['PDB ID(s) for Ligand-Target Complex','Ligand SMILES']]" ] }, { "cell_type": "code", "execution_count": 28, "id": "caa0497c", "metadata": {}, "outputs": [], "source": [ "def make_canonical(smi):\n", " return Chem.MolToSmiles(Chem.MolFromSmiles(smi))\n", "\n", "df_pdb['can_smiles'] = df_pdb['Ligand SMILES'].apply(make_canonical)" ] }, { "cell_type": "code", "execution_count": 29, "id": "e82d64f3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDB ID(s) for Ligand-Target ComplexLigand SMILEScan_smiles
02IVUCOc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1
291HWRO[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC=C)C(=O)...C=CCN1C(=O)N(CC=C)[C@H](Cc2ccccc2)[C@H](O)[C@@...
346DGY,6DH1,6DH4,6DH7,3O99CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O...CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O...
1291MES,1MEU,1MET,1BVG,1BVE,3JVW,1QBSOCc1ccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C...O=C1N(Cc2ccc(CO)cc2)[C@H](Cc2ccccc2)[C@H](O)[C...
1301MER,1DMP,1RQ9Nc1cccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C...Nc1cccc(CN2C(=O)N(Cc3cccc(N)c3)[C@H](Cc3ccccc3...
............
23333751MUI,2RKG,2RKF,1RV7,2Q5K,2O4S,6DJ1,6DJ2,3OGQ,2...CC(C)[C@H](N1CCCNC1=O)C(=O)N[C@H](C[C@H](O)[C@...Cc1cccc(C)c1OCC(=O)N[C@@H](Cc1ccccc1)[C@@H](O)...
23333764NPT,4DQH,4DQE,5E5J,3JW2,6OPU,6OPX,2HS2,2HS1,2...CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]...CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]...
23333806EKZ,1DY4,5FUK,6PS5CC(C)NCC(O)COc1cccc2ccccc12CC(C)NCC(O)COc1cccc2ccccc12
23333846EKZ,1DY4,5FUK,6PS5CC(C)NCC(O)COc1cccc2ccccc12CC(C)NCC(O)COc1cccc2ccccc12
23333856A60,3DCTCC(C)c1onc(c1COc1ccc(\\C=C\\c2cccc(c2)C(O)=O)c(C...CC(C)c1onc(-c2c(Cl)cccc2Cl)c1COc1ccc(/C=C/c2cc...
\n", "

123385 rows × 3 columns

\n", "
" ], "text/plain": [ " PDB ID(s) for Ligand-Target Complex \\\n", "0 2IVU \n", "29 1HWR \n", "34 6DGY,6DH1,6DH4,6DH7,3O99 \n", "129 1MES,1MEU,1MET,1BVG,1BVE,3JVW,1QBS \n", "130 1MER,1DMP,1RQ9 \n", "... ... \n", "2333375 1MUI,2RKG,2RKF,1RV7,2Q5K,2O4S,6DJ1,6DJ2,3OGQ,2... \n", "2333376 4NPT,4DQH,4DQE,5E5J,3JW2,6OPU,6OPX,2HS2,2HS1,2... \n", "2333380 6EKZ,1DY4,5FUK,6PS5 \n", "2333384 6EKZ,1DY4,5FUK,6PS5 \n", "2333385 6A60,3DCT \n", "\n", " Ligand SMILES \\\n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 \n", "29 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC=C)C(=O)... \n", "34 CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O... \n", "129 OCc1ccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C... \n", "130 Nc1cccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C... \n", "... ... \n", "2333375 CC(C)[C@H](N1CCCNC1=O)C(=O)N[C@H](C[C@H](O)[C@... \n", "2333376 CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]... \n", "2333380 CC(C)NCC(O)COc1cccc2ccccc12 \n", "2333384 CC(C)NCC(O)COc1cccc2ccccc12 \n", "2333385 CC(C)c1onc(c1COc1ccc(\\C=C\\c2cccc(c2)C(O)=O)c(C... \n", "\n", " can_smiles \n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 \n", "29 C=CCN1C(=O)N(CC=C)[C@H](Cc2ccccc2)[C@H](O)[C@@... \n", "34 CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O... \n", "129 O=C1N(Cc2ccc(CO)cc2)[C@H](Cc2ccccc2)[C@H](O)[C... \n", "130 Nc1cccc(CN2C(=O)N(Cc3cccc(N)c3)[C@H](Cc3ccccc3... \n", "... ... \n", "2333375 Cc1cccc(C)c1OCC(=O)N[C@@H](Cc1ccccc1)[C@@H](O)... \n", "2333376 CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]... \n", "2333380 CC(C)NCC(O)COc1cccc2ccccc12 \n", "2333384 CC(C)NCC(O)COc1cccc2ccccc12 \n", "2333385 CC(C)c1onc(-c2c(Cl)cccc2Cl)c1COc1ccc(/C=C/c2cc... \n", "\n", "[123385 rows x 3 columns]" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_pdb" ] }, { "cell_type": "code", "execution_count": null, "id": "593c9aec", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.9.4" } }, "nbformat": 4, "nbformat_minor": 5 }