{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "ee43bf48-5491-4dc4-aa09-cb4a0f460f97", "metadata": {}, "outputs": [], "source": [ "from openbabel import pybel\n", "from Bio.PDB import * \n" ] }, { "cell_type": "code", "execution_count": 2, "id": "26bc18a2-a6eb-49d3-be80-876ddc7dd8e1", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "id": "3b59cfb4-c42a-425d-9653-44f07f9e864e", "metadata": {}, "outputs": [], "source": [ "df = pd.read_table('biolip/data/BioLiP_2013-03-6_nr.txt',sep='\\t',header=None,usecols=[0,4,5,6,13,14,15,16,19])\n", "df = df.rename(columns={0:'pdb',4:'chain',5:'l_id',6:'l_chain',\n", " 13: 'affinity_lit',14: 'affinity_moad',15: 'affinity_pdbbind-cn',16:'affinity_bindingdb',\n", " 19: 'seq'})" ] }, { "cell_type": "code", "execution_count": 4, "id": "01123edd-2b98-4fcc-a2e9-28213b9bed82", "metadata": {}, "outputs": [], "source": [ "base = 'biolip/data/ligand_nr/'\n", "df['ligand_fn'] = base + df['pdb']+'_'+df['chain']+'_'+df['l_id'].astype(str)+'_'+df['l_chain'].astype(str)+'.pdb'" ] }, { "cell_type": "code", "execution_count": 5, "id": "bd8671da-66ad-40ad-b221-e33228be65f4", "metadata": {}, "outputs": [], "source": [ "df_complex = pd.read_parquet('data/biolip_complex.parquet')" ] }, { "cell_type": "code", "execution_count": 97, "id": "08b04d75-c01e-4b26-ae2d-622efae3bd1f", "metadata": {}, "outputs": [], "source": [ "df_affinity = df_complex[~df_complex['affinity_lit'].isnull() | ~df_complex['affinity_moad'].isnull() \n", " | ~df_complex['affinity_pdbbind-cn'].isnull() | ~df_complex['affinity_bindingdb'].isnull()].copy()" ] }, { "cell_type": "code", "execution_count": 98, "id": "97af5533-10fe-4419-a998-ed80b7d26690", "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", " lit, moad, pdbbind, bindingdb = affinities\n", "\n", " vals = []\n", " try:\n", " lit = re.split('[=~<>]',str(lit))[1].split(' ')[0]\n", " lit = ureg(lit).m_as(ureg.uM)\n", " vals.append(lit)\n", " except:\n", " pass\n", "\n", " try:\n", " moad = re.split('[=~<>]',str(moad))[1].split(' ')[0]\n", " moad = ureg(moad).m_as(ureg.uM)\n", " vals.append(moad)\n", " except:\n", " pass\n", "\n", " try:\n", " pdbbind = re.split('[=~<>]',str(pdbbind))[1].split(' ')[0]\n", " pdbbind = ureg(bindingdb).m_as(ureg.uM)\n", " vals.append(pdbbind)\n", " except:\n", " pass\n", "\n", " try:\n", " bindingdb = re.split('[=~<>]',str(bindingdb))[1].split(' ')[0]\n", " bindingdb = ureg(bindingdb).m_as(ureg.uM)\n", " vals.append(bindingdb)\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": 99, "id": "e21154a9-d3a0-4aa3-986f-cfeebc280da6", "metadata": {}, "outputs": [], "source": [ "df_affinity['affinity_uM'] = df_affinity[['affinity_lit','affinity_moad','affinity_pdbbind-cn','affinity_bindingdb']].apply(to_uM,axis=1)" ] }, { "cell_type": "code", "execution_count": 101, "id": "0fc94de0-823d-4f4f-9904-1c4d1e722c2e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | pdb | \n", "chain | \n", "l_id | \n", "l_chain | \n", "affinity_lit | \n", "affinity_moad | \n", "affinity_pdbbind-cn | \n", "affinity_bindingdb | \n", "seq | \n", "ligand_fn | \n", "smiles | \n", "affinity_uM | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
38 | \n", "11gs | \n", "EAA | \n", "A | \n", "1 | \n", "None | \n", "ki=1.5uM (GTT EAA) | \n", "Ki=1.5uM (GTT-EAA) | \n", "None | \n", "PYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKASC... | \n", "biolip/data/ligand_nr/11gs_EAA_A_1.pdb | \n", "CC[C@H](C(=O)c1ccc(c(c1Cl)Cl)OCC(=O)O)C | \n", "1.500 | \n", "
43 | \n", "13gs | \n", "SAS | \n", "A | \n", "1 | \n", "None | \n", "ki=24uM (SAS) | \n", "Ki=24uM (SAS) | \n", "None | \n", "MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA... | \n", "biolip/data/ligand_nr/13gs_SAS_A_1.pdb | \n", "OC(=O)c1cc(/N=N/c2ccc(cc2)S(=O)(=O)Nc2ccccn2)c... | \n", "24.000 | \n", "
54 | \n", "17gs | \n", "GTX | \n", "A | \n", "1 | \n", "None | \n", "None | \n", "None | \n", "Kd=10000nM | \n", "MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA... | \n", "biolip/data/ligand_nr/17gs_GTX_A_1.pdb | \n", "CCCCCCSC[C@@H](C(=O)NCC(=O)O)NC(=O)CC[C@@H](C(... | \n", "10.000 | \n", "
55 | \n", "181l | \n", "BNZ | \n", "A | \n", "1 | \n", "None | \n", "Ka=5700M^-1 (BNZ) | \n", "None | \n", "Kd=175000nM | \n", "MNIFEMLRIDEGLRLKIYKDTEGYYTIGIGHLLTKSPSLNAAKSEL... | \n", "biolip/data/ligand_nr/181l_BNZ_A_1.pdb | \n", "c1ccccc1 | \n", "175.000 | \n", "
56 | \n", "182l | \n", "BZF | \n", "A | \n", "1 | \n", "None | \n", "Ka=8900M^-1 (BZF) | \n", "None | \n", "Kd=112000nM | \n", "MNIFEMLRIDEGLRLKIYKDTEGYYTIGIGHLLTKSPSLNAAKSEL... | \n", "biolip/data/ligand_nr/182l_BZF_A_1.pdb | \n", "c1ccc2c(c1)occ2 | \n", "112.000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
105087 | \n", "8kme | \n", "III | \n", "3 | \n", "1 | \n", "None | \n", "ki=8uM (BNN CUC TRG LEU PRO) | \n", "None | \n", "None | \n", "IVEGSDAEIGMSPWQVMLFRKSPQELLCGASLISDRWVLTAAHCLL... | \n", "biolip/data/ligand_nr/8kme_III_3_1.pdb | \n", "O=C[C@@H](NC(=O)[C@H](Cc1ccc(cc1)OS(O)(O)O)NC(... | \n", "8.000 | \n", "
105088 | \n", "8kme | \n", "III | \n", "4 | \n", "1 | \n", "None | \n", "ki=8uM (BNN CUC TRG LEU PRO) | \n", "None | \n", "None | \n", "IVEGSDAEIGMSPWQVMLFRKSPQELLCGASLISDRWVLTAAHCLL... | \n", "biolip/data/ligand_nr/8kme_III_4_1.pdb | \n", "CC(C[C@@H](C(=O)N1C=CC[C@H]1C(=O)N)NC(=O)[C@@H... | \n", "8.000 | \n", "
105106 | \n", "966c | \n", "RS2 | \n", "A | \n", "1 | \n", "None | \n", "ki=23nM (RS2) | \n", "Ki=23nM (RS2) | \n", "None | \n", "RWEQTHLTYRIENYTPDLPRADVDHAIEKAFQLWSNVTPLTFTKVS... | \n", "biolip/data/ligand_nr/966c_RS2_A_1.pdb | \n", "ONC(=O)CC1(CCOCC1)S(=O)(=O)c1ccc(cc1)Oc1ccccc1 | \n", "0.023 | \n", "
105124 | \n", "9icd | \n", "NAP | \n", "A | \n", "1 | \n", "None | \n", "kd=125uM (NAP) | \n", "Kd=125uM (NAP) | \n", "None | \n", "SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV... | \n", "biolip/data/ligand_nr/9icd_NAP_A_1.pdb | \n", "O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O... | \n", "125.000 | \n", "
105138 | \n", "9nse | \n", "ISU | \n", "B | \n", "2 | \n", "None | \n", "Ki=0.039uM (ISU) | \n", "None | \n", "None | \n", "KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR... | \n", "biolip/data/ligand_nr/9nse_ISU_B_2.pdb | \n", "CC[Se]C(=N)N | \n", "0.039 | \n", "
7588 rows × 12 columns
\n", "