kexinhuang12345 / DeepPurpose

A Deep Learning Toolkit for DTI, Drug Property, PPI, DDI, Protein Function Prediction (Bioinformatics)
https://doi.org/10.1093/bioinformatics/btaa1005
BSD 3-Clause "New" or "Revised" License
962 stars 272 forks source link

try except of max_atoms/bond error #61

Closed hima111997 closed 3 years ago

hima111997 commented 3 years ago

Greetings sir, I was doing VS using virtual_screening function when it gave me this error. the same drugs were used but with a different protein without giving me this error ` Traceback (most recent call last): File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/utils.py", line 264, in smiles2mpnnfeature assert atoms_completion_num >= 0 and bonds_completion_num >= 0 AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "play_VS.py", line 20, in play(dest_repur_db, dest_vs_db, dest_save +'/') File "play_VS.py", line 9, in play save_dir= dest_save) File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/oneliner.py", line 261, in virtual_screening y_pred = models.virtual_screening(X_repurpose, target, model, drug_names, target_name, convert_y = convert_y, result_folder = result_folder_path, verbose = False) File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/DTI.py", line 163, in virtual_screening model.drug_encoding, model.target_encoding, 'virtual screening') File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/utils.py", line 578, in data_process_repurpose_virtual_screening split_method='repurposing_VS') File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/utils.py", line 499, in data_process df_data = encode_drug(df_data, drug_encoding) File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/utils.py", line 364, in encode_drug unique = pd.Series(df_data[column_name].unique()).apply(smiles2mpnnfeature) File "/share/apps/conda_envs/DeepPurpose/lib/python3.7/site-packages/pandas/core/series.py", line 3848, in apply mapped = lib.map_infer(values, f, convert=convert_dtype) File "pandas/_libs/lib.pyx", line 2329, in pandas._libs.lib.map_infer File "/lfs01/workdirs/cairo029u1/deeppurpose/DeepPurpose/DeepPurpose/utils.py", line 266, in smiles2mpnnfeature raise Exception("increase MAX_ATOM and MAX_BOND in utils") Exception: increase MAX_ATOM and MAX_BOND in utils `

hima111997 commented 3 years ago

i added two print statements to print fbonds.shape[0] and fatoms.shape[0] and they gave me these numbers: fbonds.shape[0] --> 403 fatoms.shape[0] --> 183

when I checked MAX_ATOM and MAX_BOND variables they were 200 and 400, respectively. So should I increase MAX_BOND value to 500 for example?

futianfan commented 3 years ago

Yeah. You can increase MAX_ATOM and MAX_BOND. The current setting is only for small molecules. Thanks!

On Thu, Dec 10, 2020 at 11:13 AM hima111997 notifications@github.com wrote:

i added two print statements to print fbonds.shape[0] and fatoms.shape[0] and they gave me these numbers: fbonds.shape[0] --> 403 fatoms.shape[0] --> 183

when I checked MAX_ATOM and MAX_BOND variables they were 200 and 400, respectively. So should I increase MAX_BOND value to 500 for example?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kexinhuang12345/DeepPurpose/issues/61#issuecomment-742620167, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZ72XINVQA7SE7TDRETSTSUDXQZANCNFSM4UVGNL3Q .

--

Tianfan Fu PhD candidate futianfan.github.io Sunlab, http://sunlab.org/ College of Computing Georgia Institute of Technology 266 Ferst Dr NW, Atlanta, GA 30332

pykao commented 3 years ago

I got the same issue and I double the size of MAX_ATOM and MAX_BOND. It solved this issue but I think it takes more GPU memories on both training and test phases, right?

futianfan commented 3 years ago

You are right. In the current version, both variables are set as global variables. If you set a large number, the memory would increase. We will fix it soon. Thanks!

On Sun, Dec 13, 2020 at 9:35 PM Po-Yu Kao notifications@github.com wrote:

I got the same issue and I double the size of MAX_ATOM and MAX_BOND. It solved this issue but I think it takes more GPU memories on both training and test phases, right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kexinhuang12345/DeepPurpose/issues/61#issuecomment-744128819, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZ72UNEXBJMVYRDGQ6GY3SUV2W5ANCNFSM4UVGNL3Q .

--

Tianfan Fu PhD candidate futianfan.github.io Sunlab, http://sunlab.org/ College of Computing Georgia Institute of Technology 266 Ferst Dr NW, Atlanta, GA 30332

pykao commented 3 years ago

For KIBA database, I increased MAX_ATOM=270 and MAX_BOND=600 that solved the issue. :)

futianfan commented 3 years ago

Thanks for letting us know!

On Sun, Dec 13, 2020 at 10:03 PM Po-Yu Kao notifications@github.com wrote:

For KIBA database, I increased MAX_ATOM=270 and MAX_BOND=600 that solved the issue. :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kexinhuang12345/DeepPurpose/issues/61#issuecomment-744136001, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZ72UEOPEEAULATRA7FKTSUV573ANCNFSM4UVGNL3Q .

--

Tianfan Fu PhD candidate futianfan.github.io Sunlab, http://sunlab.org/ College of Computing Georgia Institute of Technology 266 Ferst Dr NW, Atlanta, GA 30332

xuzhang5788 commented 3 years ago

Sorry, I can't find "MAX_ATOM" and "MAX_BOND" in utils.py

I don't understand why it was okay in "MPNN_CNN_Kiba.ipynb"? It also used Kiba dataset

futianfan commented 3 years ago

Sorry, I can't find "MAX_ATOM" and "MAX_BOND" in utils.py

I don't understand why it was okay in "MPNN_CNN_Kiba.ipynb"? It also used Kiba dataset

Please see https://github.com/kexinhuang12345/DeepPurpose/blob/53002696640ebdee1bcc5c10ea8213e79e10ea81/DeepPurpose/utils.py#L27

Can you increase them, and try again?

We change the setting for support of multi-GPU. The tutorial may be out-of-date.

xuzhang5788 commented 3 years ago

It doesn't work. Do I need to reinstall deeppurpose? Actually, I installed it again, but it still doesn't work, even I increased the numbers.

Have my own dataset to be under the folder of DeepPurpose? I created a new folder for my own experiments. Is it okay?

kexinhuang12345 commented 3 years ago

I think this is resolved in https://github.com/kexinhuang12345/DeepPurpose/issues/74