Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try except of max_atoms/bond error #61

Closed
hima111997 opened this issue Dec 10, 2020 · 10 comments
Closed

try except of max_atoms/bond error #61

hima111997 opened this issue Dec 10, 2020 · 10 comments

Comments

@hima111997
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Collaborator

futianfan commented Dec 10, 2020 via email

@pykao
Copy link
Contributor

pykao commented Dec 14, 2020

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
Copy link
Collaborator

futianfan commented Dec 14, 2020 via email

@pykao
Copy link
Contributor

pykao commented Dec 14, 2020

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

@futianfan
Copy link
Collaborator

futianfan commented Dec 14, 2020 via email

@kexinhuang12345 kexinhuang12345 changed the title error while doing VS try except of max_atoms/bond error Dec 16, 2020
@xuzhang5788
Copy link

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
Copy link
Collaborator

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

MAX_ATOM = 200

Can you increase them, and try again?

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

@xuzhang5788
Copy link

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
Copy link
Owner

I think this is resolved in #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants