{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "ecce356e-321b-441e-8a5d-a20bf72f8691",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import dask.dataframe as dd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"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": "1b923f02-e858-4737-ab5e-4c98c2def1b6",
"metadata": {},
"outputs": [],
"source": [
"allseq = ['BindingDB Target Chain Sequence']+['BindingDB Target Chain Sequence.{}'.format(j) for j in range(1,13)]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "54f0721e-1e36-48cc-a635-a1617a04f9e5",
"metadata": {},
"outputs": [],
"source": [
"dtypes = {'BindingDB Target Chain Sequence.{}'.format(i): 'object' for i in range(1,13)}"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "c1843c65-a5ef-4604-adca-40fb18bc2991",
"metadata": {},
"outputs": [],
"source": [
"dtypes.update({'BindingDB Target Chain Sequence': 'object',\n",
" 'IC50 (nM)': 'object',\n",
" 'KEGG ID of Ligand': 'object',\n",
" 'Ki (nM)': 'object',\n",
" 'Kd (nM)': 'object',\n",
" 'EC50 (nM)': 'object',\n",
" 'koff (s-1)': 'object'})"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "aa337ac3-4ca1-4369-a9c7-ab705221a137",
"metadata": {},
"outputs": [],
"source": [
"seq_name = 'BindingDB Target Chain Sequence'"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "a870d8d7-374b-4474-b9ee-305bbf9f17a9",
"metadata": {},
"outputs": [],
"source": [
"import tqdm.notebook"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "e97d29e6-d153-480e-a1ee-c216c22af8d2",
"metadata": {},
"outputs": [],
"source": [
"ddf = dd.read_csv('bindingdb/data/BindingDB_All.tsv',sep='\\t',\n",
" error_bad_lines=False,\n",
" usecols=cols+allseq,\n",
" dtype=dtypes)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "a4b381c0-968b-4248-a24f-9609acb12136",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.04789522637942933"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(ddf[~ddf['BindingDB Target Chain Sequence.1'].isnull()])/len(ddf[~ddf['BindingDB Target Chain Sequence'].isnull()])"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "7a8efd3f-c9c4-4f6a-83e5-9e9610deb17f",
"metadata": {},
"outputs": [],
"source": [
"# remove rows with more than one target\n",
"ddf_prune = ddf[ddf['BindingDB Target Chain Sequence.1'].isnull()]\n",
"ddf_prune = ddf_prune.rename(columns={'BindingDB Target Chain Sequence': 'seq'})"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "c00102b8-f4be-4ebd-8d30-7a2c7fc2d05e",
"metadata": {},
"outputs": [],
"source": [
"ddf_nonnull = ddf_prune[~ddf_prune.seq.isnull()].copy()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "c5337e06-1e45-4180-90ed-49ac9ecdd24a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ligand SMILES | \n",
" Ki (nM) | \n",
" IC50 (nM) | \n",
" Kd (nM) | \n",
" EC50 (nM) | \n",
" KEGG ID of Ligand | \n",
" seq | \n",
" BindingDB Target Chain Sequence.1 | \n",
" BindingDB Target Chain Sequence.2 | \n",
" BindingDB Target Chain Sequence.3 | \n",
" BindingDB Target Chain Sequence.4 | \n",
" BindingDB Target Chain Sequence.5 | \n",
" BindingDB Target Chain Sequence.6 | \n",
" BindingDB Target Chain Sequence.7 | \n",
" BindingDB Target Chain Sequence.8 | \n",
" BindingDB Target Chain Sequence.9 | \n",
" BindingDB Target Chain Sequence.10 | \n",
" BindingDB Target Chain Sequence.11 | \n",
" BindingDB Target Chain Sequence.12 | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 | \n",
" 0.24 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... | \n",
" 0.25 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 2 | \n",
" O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... | \n",
" 0.41 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 3 | \n",
" OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... | \n",
" 0.8 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 4 | \n",
" OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... | \n",
" 0.99 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ligand SMILES Ki (nM) IC50 (nM) \\\n",
"0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 0.24 NaN \n",
"1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... 0.25 NaN \n",
"2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... 0.41 NaN \n",
"3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... 0.8 NaN \n",
"4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... 0.99 NaN \n",
"\n",
" Kd (nM) EC50 (nM) KEGG ID of Ligand \\\n",
"0 NaN NaN NaN \n",
"1 NaN NaN NaN \n",
"2 NaN NaN NaN \n",
"3 NaN NaN NaN \n",
"4 NaN NaN NaN \n",
"\n",
" seq \\\n",
"0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"\n",
" BindingDB Target Chain Sequence.1 BindingDB Target Chain Sequence.2 \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" BindingDB Target Chain Sequence.3 BindingDB Target Chain Sequence.4 \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" BindingDB Target Chain Sequence.5 BindingDB Target Chain Sequence.6 \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" BindingDB Target Chain Sequence.7 BindingDB Target Chain Sequence.8 \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" BindingDB Target Chain Sequence.9 BindingDB Target Chain Sequence.10 \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" BindingDB Target Chain Sequence.11 BindingDB Target Chain Sequence.12 \n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN "
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ddf_nonnull.head()"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "7b423365-4989-4325-a5a5-845d852d52e9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2221761"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(ddf_nonnull)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"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": 23,
"id": "b3cff13c-19b2-4413-a84b-d99062f516a7",
"metadata": {},
"outputs": [],
"source": [
"df_nonnull = ddf_nonnull.compute()"
]
},
{
"cell_type": "code",
"execution_count": 24,
"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": 25,
"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": 26,
"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": 27,
"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": 28,
"id": "f602fdbe-7083-436c-9eac-9d97fbc8be67",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2219812"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df_affinity)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "27194288-cf3e-4c30-ad55-3b0998fdf939",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ligand SMILES | \n",
" Ki (nM) | \n",
" IC50 (nM) | \n",
" Kd (nM) | \n",
" EC50 (nM) | \n",
" KEGG ID of Ligand | \n",
" seq | \n",
" BindingDB Target Chain Sequence.1 | \n",
" BindingDB Target Chain Sequence.2 | \n",
" BindingDB Target Chain Sequence.3 | \n",
" BindingDB Target Chain Sequence.4 | \n",
" BindingDB Target Chain Sequence.5 | \n",
" BindingDB Target Chain Sequence.6 | \n",
" BindingDB Target Chain Sequence.7 | \n",
" BindingDB Target Chain Sequence.8 | \n",
" BindingDB Target Chain Sequence.9 | \n",
" BindingDB Target Chain Sequence.10 | \n",
" BindingDB Target Chain Sequence.11 | \n",
" BindingDB Target Chain Sequence.12 | \n",
" affinity_uM | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 | \n",
" 0.24 | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" 0.00024 | \n",
"
\n",
" \n",
" 1 | \n",
" O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... | \n",
" 0.25 | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" 0.00025 | \n",
"
\n",
" \n",
" 2 | \n",
" O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... | \n",
" 0.41 | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" 0.00041 | \n",
"
\n",
" \n",
" 3 | \n",
" OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... | \n",
" 0.8 | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" 0.00080 | \n",
"
\n",
" \n",
" 4 | \n",
" OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... | \n",
" 0.99 | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" 0.00099 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ligand SMILES Ki (nM) IC50 (nM) \\\n",
"0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 0.24 None \n",
"1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... 0.25 None \n",
"2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... 0.41 None \n",
"3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... 0.8 None \n",
"4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... 0.99 None \n",
"\n",
" Kd (nM) EC50 (nM) KEGG ID of Ligand \\\n",
"0 None None None \n",
"1 None None None \n",
"2 None None None \n",
"3 None None None \n",
"4 None None None \n",
"\n",
" seq \\\n",
"0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n",
"\n",
" BindingDB Target Chain Sequence.1 BindingDB Target Chain Sequence.2 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" BindingDB Target Chain Sequence.3 BindingDB Target Chain Sequence.4 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" BindingDB Target Chain Sequence.5 BindingDB Target Chain Sequence.6 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" BindingDB Target Chain Sequence.7 BindingDB Target Chain Sequence.8 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" BindingDB Target Chain Sequence.9 BindingDB Target Chain Sequence.10 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" BindingDB Target Chain Sequence.11 BindingDB Target Chain Sequence.12 \\\n",
"0 None None \n",
"1 None None \n",
"2 None None \n",
"3 None None \n",
"4 None None \n",
"\n",
" affinity_uM \n",
"0 0.00024 \n",
"1 0.00025 \n",
"2 0.00041 \n",
"3 0.00080 \n",
"4 0.00099 "
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_affinity.head()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "603fd298-0aa6-4097-b298-c55db013548c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2219812"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df_affinity)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "d95ad9a9-d4ca-4679-8a33-235fe6e7047f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2219812"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df_affinity[~df_affinity['affinity_uM'].isnull()])"
]
},
{
"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",
" PDB ID(s) for Ligand-Target Complex | \n",
" Ligand SMILES | \n",
" can_smiles | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2IVU | \n",
" COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 | \n",
" COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 | \n",
"
\n",
" \n",
" 29 | \n",
" 1HWR | \n",
" O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC=C)C(=O)... | \n",
" C=CCN1C(=O)N(CC=C)[C@H](Cc2ccccc2)[C@H](O)[C@@... | \n",
"
\n",
" \n",
" 34 | \n",
" 6DGY,6DH1,6DH4,6DH7,3O99 | \n",
" CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O... | \n",
" CC[C@H](C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O... | \n",
"
\n",
" \n",
" 129 | \n",
" 1MES,1MEU,1MET,1BVG,1BVE,3JVW,1QBS | \n",
" OCc1ccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C... | \n",
" O=C1N(Cc2ccc(CO)cc2)[C@H](Cc2ccccc2)[C@H](O)[C... | \n",
"
\n",
" \n",
" 130 | \n",
" 1MER,1DMP,1RQ9 | \n",
" Nc1cccc(CN2[C@H](Cc3ccccc3)[C@H](O)[C@@H](O)[C... | \n",
" Nc1cccc(CN2C(=O)N(Cc3cccc(N)c3)[C@H](Cc3ccccc3... | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 2333375 | \n",
" 1MUI,2RKG,2RKF,1RV7,2Q5K,2O4S,6DJ1,6DJ2,3OGQ,2... | \n",
" CC(C)[C@H](N1CCCNC1=O)C(=O)N[C@H](C[C@H](O)[C@... | \n",
" Cc1cccc(C)c1OCC(=O)N[C@@H](Cc1ccccc1)[C@@H](O)... | \n",
"
\n",
" \n",
" 2333376 | \n",
" 4NPT,4DQH,4DQE,5E5J,3JW2,6OPU,6OPX,2HS2,2HS1,2... | \n",
" CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]... | \n",
" CC(C)CN(C[C@@H](O)[C@H](Cc1ccccc1)NC(=O)O[C@H]... | \n",
"
\n",
" \n",
" 2333380 | \n",
" 6EKZ,1DY4,5FUK,6PS5 | \n",
" CC(C)NCC(O)COc1cccc2ccccc12 | \n",
" CC(C)NCC(O)COc1cccc2ccccc12 | \n",
"
\n",
" \n",
" 2333384 | \n",
" 6EKZ,1DY4,5FUK,6PS5 | \n",
" CC(C)NCC(O)COc1cccc2ccccc12 | \n",
" CC(C)NCC(O)COc1cccc2ccccc12 | \n",
"
\n",
" \n",
" 2333385 | \n",
" 6A60,3DCT | \n",
" CC(C)c1onc(c1COc1ccc(\\C=C\\c2cccc(c2)C(O)=O)c(C... | \n",
" CC(C)c1onc(-c2c(Cl)cccc2Cl)c1COc1ccc(/C=C/c2cc... | \n",
"
\n",
" \n",
"
\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
}