{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "95bd761a-fe51-4a8e-bc70-1365260ba5f8", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "b0859483-5e19-4280-9f53-0d00a6f22d34", "metadata": {}, "outputs": [], "source": [ "df_pdbbind = pd.read_parquet('data/pdbbind.parquet')\n", "df_pdbbind = df_pdbbind[['seq','smiles','affinity_uM']]" ] }, { "cell_type": "code", "execution_count": 3, "id": "f30732b7-7444-47ad-84e7-566e7a6f2f8e", "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", "
seqsmilesaffinity_uM
0MTVPDRSEIAGKWYVVALASNTEFFLREKDKMKMAMARISFLGEDE...CCCCCCCCCCCCCCCCCCC[C-](=O)=O0.026
1AAPFDKSKNVAQSIDQLIGQTPALYLNKLNNTKAKVVLKMECENPM...OC[C@@H](C(=O)N[C@@H]([C@H](CC)C)[C-](=O)=O)NC...6.430
2PFPLTSMDKAFITVLEMTPVLGTEIINYRDGMGRVLAQDVYAKDNL...CC[C@@H]([C@@H](C(=O)N[C@H](C(=O)NCC(=O)N[C@H]...190.000
3SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP...OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(...0.210
4EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI...O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2...0.050
\n", "
" ], "text/plain": [ " seq \\\n", "0 MTVPDRSEIAGKWYVVALASNTEFFLREKDKMKMAMARISFLGEDE... \n", "1 AAPFDKSKNVAQSIDQLIGQTPALYLNKLNNTKAKVVLKMECENPM... \n", "2 PFPLTSMDKAFITVLEMTPVLGTEIINYRDGMGRVLAQDVYAKDNL... \n", "3 SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP... \n", "4 EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI... \n", "\n", " smiles affinity_uM \n", "0 CCCCCCCCCCCCCCCCCCC[C-](=O)=O 0.026 \n", "1 OC[C@@H](C(=O)N[C@@H]([C@H](CC)C)[C-](=O)=O)NC... 6.430 \n", "2 CC[C@@H]([C@@H](C(=O)N[C@H](C(=O)NCC(=O)N[C@H]... 190.000 \n", "3 OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(... 0.210 \n", "4 O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2... 0.050 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_pdbbind.head()" ] }, { "cell_type": "code", "execution_count": 4, "id": "2787b9fd-3d6f-4ae3-a3ad-d3539b72782b", "metadata": {}, "outputs": [], "source": [ "from rdkit import Chem\n", "from rdkit.Chem import MACCSkeys\n", "import numpy as np\n", "\n", "def get_maccs(smi):\n", " try:\n", " mol = Chem.MolFromSmiles(smi)\n", " arr = np.packbits([0 if c=='0' else 1 for c in MACCSkeys.GenMACCSKeys(mol).ToBitString()])\n", " return np.pad(arr,(0,3)).view(np.uint32)\n", " except Exception:\n", " pass" ] }, { "cell_type": "code", "execution_count": 6, "id": "d1abe1c8-ac66-4289-8964-367a5b18528d", "metadata": {}, "outputs": [], "source": [ "df_bindingdb = pd.read_parquet('data/bindingdb.parquet')\n", "df_bindingdb = df_bindingdb[['seq','Ligand SMILES','affinity_uM']].rename(columns={'Ligand SMILES': 'smiles'})" ] }, { "cell_type": "code", "execution_count": 7, "id": "988bab9c-5147-44e2-92ef-902eaf3c5a90", "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", "
seqsmilesaffinity_uM
0PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC10.00024
1PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn...0.00025
2PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=...0.00041
3PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@...0.00080
4PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM...OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H...0.00099
\n", "
" ], "text/plain": [ " seq \\\n", "0 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "1 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "2 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "3 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "4 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMSLPGRWKPKM... \n", "\n", " smiles affinity_uM \n", "0 COc1cc2c(Nc3ccc(Br)cc3F)ncnc2cc1OCC1CCN(C)CC1 0.00024 \n", "1 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(C\\C=C\\c2cn... 0.00025 \n", "2 O[C@@H]1[C@@H](O)[C@@H](Cc2ccccc2)N(CC2CC2)C(=... 0.00041 \n", "3 OCCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@... 0.00080 \n", "4 OCCCCCN1[C@H](Cc2ccccc2)[C@H](O)[C@@H](O)[C@@H... 0.00099 " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_bindingdb.head()" ] }, { "cell_type": "code", "execution_count": 8, "id": "d7bfee2a-c4e6-48c9-b0c6-52f6a69c7453", "metadata": {}, "outputs": [], "source": [ "df_moad = pd.read_parquet('data/moad.parquet')\n", "df_moad = df_moad[['seq','smiles','affinity_uM']]" ] }, { "cell_type": "code", "execution_count": 9, "id": "25553199-1715-40fb-9260-427bdd6c3706", "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", "
seqsmilesaffinity_uM
0NYIVPGEYRVAEGEIEINAGREKTTIRVSNTGDRPIQVGSHIHFVE...NP(=O)(N)O0.000620
1NYIVPGEYRVAEGEIEINAGREKTTIRVSNTGDRPIQVGSHIHFVE...CC(=O)NO2.600000
2MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV...c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3...15.000000
3MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV...c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3...15.000000
4MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV...c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3...15.000000
............
17682MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG...None127.226463
17683MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG...None127.226463
17684MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG...None169.204738
17685MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG...None169.204738
17686MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG...None169.204738
\n", "

17687 rows × 3 columns

\n", "
" ], "text/plain": [ " seq \\\n", "0 NYIVPGEYRVAEGEIEINAGREKTTIRVSNTGDRPIQVGSHIHFVE... \n", "1 NYIVPGEYRVAEGEIEINAGREKTTIRVSNTGDRPIQVGSHIHFVE... \n", "2 MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV... \n", "3 MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV... \n", "4 MTDMSIKFELIDVPIPQGTNVIIGQAHFIKTVEDLYEALVTSVPGV... \n", "... ... \n", "17682 MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG... \n", "17683 MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG... \n", "17684 MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG... \n", "17685 MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG... \n", "17686 MGSSHHHHHHSSGLVPRGSHMASNPSLIRSESWQVYEGNEANLLDG... \n", "\n", " smiles affinity_uM \n", "0 NP(=O)(N)O 0.000620 \n", "1 CC(=O)NO 2.600000 \n", "2 c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3... 15.000000 \n", "3 c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3... 15.000000 \n", "4 c1nc(c2c(n1)n(cn2)[C@H]3[C@@H]([C@@H]([C@H](O3... 15.000000 \n", "... ... ... \n", "17682 None 127.226463 \n", "17683 None 127.226463 \n", "17684 None 169.204738 \n", "17685 None 169.204738 \n", "17686 None 169.204738 \n", "\n", "[17687 rows x 3 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_moad" ] }, { "cell_type": "code", "execution_count": 10, "id": "b2c936bc-cdc8-4bc1-b92d-f8755fd65f0a", "metadata": {}, "outputs": [], "source": [ "df_biolip = pd.read_parquet('data/biolip.parquet')\n", "df_biolip = df_biolip[['seq','smiles','affinity_uM']]" ] }, { "cell_type": "code", "execution_count": 11, "id": "cee93018-601d-458b-af44-bd978da7a2bc", "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", "
seqsmilesaffinity_uM
38PYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKASC...CC[C@H](C(=O)c1ccc(c(c1Cl)Cl)OCC(=O)O)C1.5000
43MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA...OC(=O)c1cc(/N=N/c2ccc(cc2)S(=O)(=O)Nc2ccccn2)c...24.0000
53EKKSINECDLKGKKVLIRVDFNVPVKNGKITNDYRIRSALPTLKKV...O[C@@H]1[C@@H](CO[P@](=O)(O[P@@](=O)(C(CCCC(P(...6.0000
54MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA...CCCCCCSC[C@@H](C(=O)NCC(=O)O)NC(=O)CC[C@@H](C(...10.0000
55MNIFEMLRIDEGLRLKIYKDTEGYYTIGIGHLLTKSPSLNAAKSEL...c1ccccc1175.0000
............
105118PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM...O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=...0.0045
105119PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM...O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=...0.0045
105124SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV...O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O...125.0000
105133ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI...CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]...2.0000
105138KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR...CC[Se]C(=N)N0.0390
\n", "

13645 rows × 3 columns

\n", "
" ], "text/plain": [ " seq \\\n", "38 PYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKASC... \n", "43 MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA... \n", "53 EKKSINECDLKGKKVLIRVDFNVPVKNGKITNDYRIRSALPTLKKV... \n", "54 MPPYTVVYFPVRGRCAALRMLLADQGQSWKEEVVTVETWQEGSLKA... \n", "55 MNIFEMLRIDEGLRLKIYKDTEGYYTIGIGHLLTKSPSLNAAKSEL... \n", "... ... \n", "105118 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM... \n", "105119 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM... \n", "105124 SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV... \n", "105133 ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI... \n", "105138 KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR... \n", "\n", " smiles affinity_uM \n", "38 CC[C@H](C(=O)c1ccc(c(c1Cl)Cl)OCC(=O)O)C 1.5000 \n", "43 OC(=O)c1cc(/N=N/c2ccc(cc2)S(=O)(=O)Nc2ccccn2)c... 24.0000 \n", "53 O[C@@H]1[C@@H](CO[P@](=O)(O[P@@](=O)(C(CCCC(P(... 6.0000 \n", "54 CCCCCCSC[C@@H](C(=O)NCC(=O)O)NC(=O)CC[C@@H](C(... 10.0000 \n", "55 c1ccccc1 175.0000 \n", "... ... ... \n", "105118 O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=... 0.0045 \n", "105119 O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=... 0.0045 \n", "105124 O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O... 125.0000 \n", "105133 CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]... 2.0000 \n", "105138 CC[Se]C(=N)N 0.0390 \n", "\n", "[13645 rows x 3 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_biolip" ] }, { "cell_type": "code", "execution_count": 12, "id": "195f92db-fe06-4d03-8500-8d6c310a3347", "metadata": {}, "outputs": [], "source": [ "df_all = pd.concat([df_pdbbind,df_bindingdb,df_moad,df_biolip]).reset_index()" ] }, { "cell_type": "code", "execution_count": 13, "id": "d25c1e24-6566-4944-a0b4-944b3c8dbc6f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "674728" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_all)" ] }, { "cell_type": "code", "execution_count": 14, "id": "c8287da2-cfdf-4d89-b175-f4c6b38ff8ac", "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()" ] }, { "cell_type": "code", "execution_count": null, "id": "de5ffc4a-afb7-4a26-8d57-509c2278d750", "metadata": {}, "outputs": [], "source": [ "df_all['maccs'] = df_all['smiles'].parallel_apply(get_maccs)" ] }, { "cell_type": "code", "execution_count": 16, "id": "59a6706d-dab9-4ee0-8ef6-33537a3622a4", "metadata": {}, "outputs": [], "source": [ "df_all.to_parquet('data/all_maccs.parquet')" ] }, { "cell_type": "code", "execution_count": 17, "id": "4ccf2ee5-d369-4c0e-bb91-792765d661bf", "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 18, "id": "8a4bbb18-e62f-4774-ac6b-8a1be68204c1", "metadata": {}, "outputs": [], "source": [ "df_all = pd.read_parquet('data/all_maccs.parquet')\n", "df_all = df_all.dropna().reset_index(drop=True)" ] }, { "cell_type": "code", "execution_count": 19, "id": "d210fe56-a7eb-4adc-a77a-14c0c6d0034e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "662484" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_all)" ] }, { "cell_type": "code", "execution_count": 20, "id": "d12b365d-98bd-4b61-b836-1a08d2e55418", "metadata": {}, "outputs": [], "source": [ "maccs = df_all['maccs'].to_numpy()\n", "#df_reindex[df_reindex.duplicated(keep='first')].reset_index()" ] }, { "cell_type": "code", "execution_count": 21, "id": "80c15210-1af3-436e-970b-f81fc596fb41", "metadata": {}, "outputs": [], "source": [ "df_maccs = pd.DataFrame(np.vstack(maccs))" ] }, { "cell_type": "code", "execution_count": 22, "id": "30c314b8-8fe7-48ae-a2b8-149de1471b0c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 int64\n", "1 int64\n", "2 int64\n", "3 int64\n", "4 int64\n", "5 int64\n", "dtype: object" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_maccs.dtypes" ] }, { "cell_type": "code", "execution_count": 23, "id": "70a0a820-4d0c-4472-af96-9c301c0ab204", "metadata": {}, "outputs": [], "source": [ "df_expand = pd.concat([df_all[['seq','smiles','affinity_uM']],df_maccs],axis=1)" ] }, { "cell_type": "code", "execution_count": 24, "id": "13d092fa-5625-40d0-b7ec-e3405ea20279", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
seqsmilesaffinity_uM012345
0SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP...OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(...0.210021474846723617689885066477339784791021599828989252
1EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI...O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2...0.050001858306115422345659640185958224282121085124
2RGSHMEDFVRQCFNPMIVELAEKAMKEYGEDPKIETNKFAAICTHL...CCNC(=O)c1nc([nH]c(=O)c1O)[C@@H]1CCCN1C(=O)C2.0000033947650204187782437820856084290771792252
3QISVRGLAGVENVTELKKNFNRHLHFTLVKDRNVATPRDYYFALAH...OC[C@H]1O[C@H](C[C@H]([C@@H]1O)F)n1ccc(nc1=O)N...6550.000001107566598175568185638464530884293647263124
4YELPEDPRWELPRDRLVLGKPLGEGQVVLAEAIGLDKDKPNRVTKV...C[N@@H+]1CC[N@H+](CC1)Cc1ccc(cc1C(F)(F)F)NC(=O...0.00774194304485785851524947239698400442061460183252
..............................
662479PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM...O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=...0.0045655363932169646983683694036484284858000252
662480PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM...O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=...0.0045655363932169646983683694036484284858000252
662481SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV...O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O...125.0000671088641115688962177186950840184317183744193341124
662482ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI...CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]...2.0000209715213721695814886817463079782067783280204
662483KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR...CC[Se]C(=N)N0.039016614453739673621708801510015504192
\n", "

662484 rows × 9 columns

\n", "
" ], "text/plain": [ " seq \\\n", "0 SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP... \n", "1 EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI... \n", "2 RGSHMEDFVRQCFNPMIVELAEKAMKEYGEDPKIETNKFAAICTHL... \n", "3 QISVRGLAGVENVTELKKNFNRHLHFTLVKDRNVATPRDYYFALAH... \n", "4 YELPEDPRWELPRDRLVLGKPLGEGQVVLAEAIGLDKDKPNRVTKV... \n", "... ... \n", "662479 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM... \n", "662480 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM... \n", "662481 SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV... \n", "662482 ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI... \n", "662483 KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR... \n", "\n", " smiles affinity_uM \\\n", "0 OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(... 0.2100 \n", "1 O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2... 0.0500 \n", "2 CCNC(=O)c1nc([nH]c(=O)c1O)[C@@H]1CCCN1C(=O)C 2.0000 \n", "3 OC[C@H]1O[C@H](C[C@H]([C@@H]1O)F)n1ccc(nc1=O)N... 6550.0000 \n", "4 C[N@@H+]1CC[N@H+](CC1)Cc1ccc(cc1C(F)(F)F)NC(=O... 0.0077 \n", "... ... ... \n", "662479 O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=... 0.0045 \n", "662480 O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=... 0.0045 \n", "662481 O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O... 125.0000 \n", "662482 CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]... 2.0000 \n", "662483 CC[Se]C(=N)N 0.0390 \n", "\n", " 0 1 2 3 4 5 \n", "0 2147484672 36176898 850664773 3978479102 1599828989 252 \n", "1 0 1858306115 4223456596 4018595822 4282121085 124 \n", "2 0 33947650 2041877824 3782085608 4290771792 252 \n", "3 0 1107566598 1755681856 3846453088 4293647263 124 \n", "4 4194304 4857858 515249472 3969840044 2061460183 252 \n", "... ... ... ... ... ... ... \n", "662479 65536 393216 964698368 369403648 4284858000 252 \n", "662480 65536 393216 964698368 369403648 4284858000 252 \n", "662481 67108864 1115688962 1771869508 4018431718 3744193341 124 \n", "662482 2097152 137216 958148868 1746307978 2067783280 204 \n", "662483 16 6144 537396736 2170880 1510015504 192 \n", "\n", "[662484 rows x 9 columns]" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_expand" ] }, { "cell_type": "code", "execution_count": 25, "id": "30f7fff7-3cfe-41c8-97c9-666f3e256222", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['seq', 'smiles', 'affinity_uM', 0, 1, 2, 3, 4, 5], dtype='object')" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_expand.columns" ] }, { "cell_type": "code", "execution_count": 26, "id": "16d2b26e-984f-4c71-af19-a3e711ed9ca2", "metadata": {}, "outputs": [], "source": [ "df_reindex = df_expand.set_index([0,1,2,3,4,5,'seq'])" ] }, { "cell_type": "code", "execution_count": 27, "id": "27fa2150-8152-444b-ba5b-24bea39fc098", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['smiles', 'affinity_uM'], dtype='object')" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_reindex.columns" ] }, { "cell_type": "code", "execution_count": 28, "id": "89edacbc-52f3-4a76-90b0-95273f5e53b3", "metadata": {}, "outputs": [], "source": [ "df_nr = df_reindex[~df_reindex.duplicated(keep='first')].reset_index()\n", "df_nr = df_nr.drop(columns=[0,1,2,3,4,5])" ] }, { "cell_type": "code", "execution_count": 68, "id": "6a704c5e-68a6-418f-bcad-8688a13ca1d6", "metadata": {}, "outputs": [], "source": [ "# final sanity checks" ] }, { "cell_type": "code", "execution_count": 30, "id": "0cad3882-975d-4693-aad1-63ec26646bd0", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/ccs/proj/stf006/glaser/conda-envs/bio/lib/python3.9/site-packages/pandas/core/arraylike.py:358: RuntimeWarning: divide by zero encountered in log\n", " result = getattr(ufunc, method)(*inputs, **kwargs)\n" ] } ], "source": [ "df_nr['neg_log10_affinity_M'] = 6-np.log(df_nr['affinity_uM'])/np.log(10)" ] }, { "cell_type": "code", "execution_count": 31, "id": "c200e29a-3f14-41f4-b620-ccce0eb0d5ce", "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", "
seqsmilesaffinity_uMneg_log10_affinity_M
0SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP...OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(...0.21006.677781
1EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI...O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2...0.05007.301030
2RGSHMEDFVRQCFNPMIVELAEKAMKEYGEDPKIETNKFAAICTHL...CCNC(=O)c1nc([nH]c(=O)c1O)[C@@H]1CCCN1C(=O)C2.00005.698970
3QISVRGLAGVENVTELKKNFNRHLHFTLVKDRNVATPRDYYFALAH...OC[C@H]1O[C@H](C[C@H]([C@@H]1O)F)n1ccc(nc1=O)N...6550.00002.183759
4YELPEDPRWELPRDRLVLGKPLGEGQVVLAEAIGLDKDKPNRVTKV...C[N@@H+]1CC[N@H+](CC1)Cc1ccc(cc1C(F)(F)F)NC(=O...0.00778.113509
...............
488472IVEGSDAEIGMSPWQVMLFRKSPQELLCGASLISDRWVLTAAHCLL...CC(C[C@@H](C(=O)N1C=CC[C@H]1C(=O)N)NC(=O)[C@@H...8.00005.096910
488473PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM...O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=...0.00458.346787
488474SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV...O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O...125.00003.903090
488475ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI...CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]...2.00005.698970
488476KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR...CC[Se]C(=N)N0.03907.408935
\n", "

488477 rows × 4 columns

\n", "
" ], "text/plain": [ " seq \\\n", "0 SMENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVP... \n", "1 EFSEWFHNILEEAEIIDQRYPVKGMHVWMPHGFMIRKNTLKILRRI... \n", "2 RGSHMEDFVRQCFNPMIVELAEKAMKEYGEDPKIETNKFAAICTHL... \n", "3 QISVRGLAGVENVTELKKNFNRHLHFTLVKDRNVATPRDYYFALAH... \n", "4 YELPEDPRWELPRDRLVLGKPLGEGQVVLAEAIGLDKDKPNRVTKV... \n", "... ... \n", "488472 IVEGSDAEIGMSPWQVMLFRKSPQELLCGASLISDRWVLTAAHCLL... \n", "488473 PQITLWQRPLVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKM... \n", "488474 SKVVVPAQGKKITLQNGKLNVPENPIIPYIEGDGIGVDVTPAMLKV... \n", "488475 ANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVNATARI... \n", "488476 KFPRVKNWELGSITYDTLCAQSQQDGPCTPRRCLGSLVLPRKLQTR... \n", "\n", " smiles affinity_uM \\\n", "0 OCC[C@@H]1CCCCN1c1cc(NCC2=CC=CN(C2)O)n2c(n1)c(... 0.2100 \n", "1 O[C@@H]1[C@@H](COS(=O)(=O)NC(=O)[C@@H]2CCC[NH2... 0.0500 \n", "2 CCNC(=O)c1nc([nH]c(=O)c1O)[C@@H]1CCCN1C(=O)C 2.0000 \n", "3 OC[C@H]1O[C@H](C[C@H]([C@@H]1O)F)n1ccc(nc1=O)N... 6550.0000 \n", "4 C[N@@H+]1CC[N@H+](CC1)Cc1ccc(cc1C(F)(F)F)NC(=O... 0.0077 \n", "... ... ... \n", "488472 CC(C[C@@H](C(=O)N1C=CC[C@H]1C(=O)N)NC(=O)[C@@H... 8.0000 \n", "488473 O[C@@H]([C@H](Cc1ccccc1)NC(=O)[C@H](C(C)C)NC(=... 0.0045 \n", "488474 O[C@@H]1[C@@H](COP(=O)(O)O)O[C@H]([C@@H]1OP(=O... 125.0000 \n", "488475 CC(C[C@@H](B(O)O)NC(=O)[C@@H]1CCCN1C(=O)[C@@H]... 2.0000 \n", "488476 CC[Se]C(=N)N 0.0390 \n", "\n", " neg_log10_affinity_M \n", "0 6.677781 \n", "1 7.301030 \n", "2 5.698970 \n", "3 2.183759 \n", "4 8.113509 \n", "... ... \n", "488472 5.096910 \n", "488473 8.346787 \n", "488474 3.903090 \n", "488475 5.698970 \n", "488476 7.408935 \n", "\n", "[488477 rows x 4 columns]" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_nr" ] }, { "cell_type": "code", "execution_count": 32, "id": "7f4027a2-0a5f-47bf-8a34-0c6a73b9b112", "metadata": {}, "outputs": [], "source": [ "df = df_nr[np.isfinite(df_nr['neg_log10_affinity_M'])]" ] }, { "cell_type": "code", "execution_count": 33, "id": "b4b9acd7-7784-492b-9fa3-b7fad9d18a9d", "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": 34, "id": "eb99774f-9bcc-454d-b5e5-a8470223d6ca", "metadata": {}, "outputs": [], "source": [ "from rdkit import Chem\n", "def make_canonical(smi):\n", " try:\n", " return Chem.MolToSmiles(Chem.MolFromSmiles(smi))\n", " except:\n", " return smi" ] }, { "cell_type": "code", "execution_count": 35, "id": "4d44bd8e-f2e1-44b4-aea7-40b4437baf44", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df['smiles_can'] = df['smiles'].parallel_apply(make_canonical)\n" ] } ], "source": [ "df['smiles_can'] = df['smiles'].parallel_apply(make_canonical)" ] }, { "cell_type": "code", "execution_count": 36, "id": "07ffdeb1-f4fa-4776-9fea-a18439e03d2e", "metadata": {}, "outputs": [], "source": [ "df = df[(df['neg_log10_affinity_M']>0) & (df['neg_log10_affinity_M']<15)].reset_index()" ] }, { "cell_type": "code", "execution_count": 37, "id": "8f949038-d07d-4d3a-a47e-b825cc9018ca", "metadata": {}, "outputs": [], "source": [ "from sklearn.preprocessing import StandardScaler" ] }, { "cell_type": "code", "execution_count": 38, "id": "0c027988-0b44-4010-ad61-7d70eead1654", "metadata": {}, "outputs": [], "source": [ "scaler = StandardScaler()" ] }, { "cell_type": "code", "execution_count": 39, "id": "6aeba020-b6ff-4633-902e-4df74463eb2f", "metadata": {}, "outputs": [], "source": [ "df['affinity'] = scaler.fit_transform(df['neg_log10_affinity_M'].values.reshape(-1,1))" ] }, { "cell_type": "code", "execution_count": 40, "id": "91196eee-5fd0-4aa4-927a-5c1a3f436ac8", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(array([6.86202031]), array([2.57502859]))" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "scaler.mean_, scaler.var_" ] }, { "cell_type": "code", "execution_count": 43, "id": "56269dcb-e691-4759-949d-7bfdd02f5fd4", "metadata": {}, "outputs": [], "source": [ "df = df.drop(columns='index')" ] }, { "cell_type": "code", "execution_count": 45, "id": "c6c64066-4032-4247-a8b9-00388176cc7b", "metadata": {}, "outputs": [], "source": [ "df.to_parquet('data/all.parquet')" ] }, { "cell_type": "code", "execution_count": 46, "id": "469cf0dd-7b87-4245-973c-2a445e1fcca9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['seq', 'smiles', 'affinity_uM', 'neg_log10_affinity_M', 'smiles_can',\n", " 'affinity'],\n", " dtype='object')" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns" ] }, { "cell_type": "code", "execution_count": 47, "id": "d91c0d91-474c-4ab2-9a5e-3b7861f7a832", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAAOXRFWH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T4DFlrre1LZPPC7RbGFOeWhtVeRFxBdq5gO/JPsmSfjt+Q98uP7ncV2UnYPyO73PMfya6uupeswIznV8BOkp5TWLcLha6tFv6e7DLfs8iuOnou9frjeT6wnGwO9P8B/l/D9m/kX5dFxBNVBrPe4znCbUqTNIvs0/9ZEXFmw7ZB4NMRcVlh3dXA8oj49/y+j/OAV8QU/kWR9HdkJ79fERFrGrYtAwaAlwORtyYm8l4iu+nvi8CbI2LWRF7PqueWhk0Zkqbnd2K/TdJ+ko4h62d/jOzT9uh+H80Hy3sdcL6kIUmjJ9qPA46RdCfwSeCIqVowJO0uafQGwcsaC0bBLmTnbDpxCe0p+Wsd1YHXsi5wS8OmDElbkXUP7QO8CHiU7H6JkyPilm5mq6O8pfV6ssES31Hs6ivsM5vs3BDAIxFxxwTf8yXAzHzxyYi4eSKvZ9Vz0TAzs2TunjIzs2QuGmZmlsxFw8zMkrlomJlZMhcNMzNL5qJhZmbJXDTMzCzZ/wdoSan8SqesEAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "ax = df['neg_log10_affinity_M'].hist(bins=50,density=True)\n", "ax.set_xlabel('-$\\log_{10}$ affinity[M]',fontsize=16)\n", "ax.set_ylabel('probability',fontsize=16)\n", "ax.figure.savefig('affinity_neglog10_M.pdf')" ] }, { "cell_type": "code", "execution_count": 48, "id": "0e895ef5-1812-46c7-a4c2-dd6619b49157", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "487412" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df)" ] }, { "cell_type": "code", "execution_count": null, "id": "462ddcda-33ae-42d5-9ff4-1f3b057618a4", "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 }