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

OverflowError: can't convert negative value to unsigned int #38

Open
Kartinaa opened this issue Oct 3, 2024 · 2 comments
Open

OverflowError: can't convert negative value to unsigned int #38

Kartinaa opened this issue Oct 3, 2024 · 2 comments

Comments

@Kartinaa
Copy link

Kartinaa commented Oct 3, 2024

Dear author,

Thanks for sharing your wonderful code! Recently when I try to reproduce the ligand generation mentioned in paper for SARS-CoV-2 main protease, I encountered error OverflowError: can't convert negative value to unsigned int when I try to generate 1000 molecules with 20 atoms using following command:

python -u sample_for_pdb.py --ckpt 500.pt --pdb_path ./data/7l11cut20/7l11cut20_pocket.pdb --num_atom 20 --num_samples 1000 --sampling_type generalized --batch_size 10

I'm not sure how to aviod this error, I tried other protein before and it works well. Really appreciate it if you could give me some suggestions on this.

Best,
Bo

@Layne-Huang
Copy link
Owner

Hi,

I just ran your code and did not meet any issues that you proposed here. Could you please try to change the num_atom and try it again?
image

@Kartinaa
Copy link
Author

Kartinaa commented Oct 10, 2024

Hi Layne,

Thanks for the reply! I may not explain it clearly, I could generate several molecules successfully, but I couldn't generate 1000 molecules at a time. I tried several atom numbers (19, 20, 21, 31, 30, etc) but in the best situation, I could generate 18 molecules in sdf format. I suspect I could just pass the problem-rising atom to continue the generation by adding error handling code to atom.SetNumRadicalElectrons(num_radical) in utils/reconstruct.py, but I'm not sure if it will influence the performance of the generative model.

Previously: atom.SetNumRadicalElectrons(num_radical)
Now: if num_radical < 0:; print(f"Negative radical electron count: {num_radical}. Setting to 0."); num_radical = 0; atom.SetNumRadicalElectrons(num_radical)

How do you think about it?

Best,
Bo

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

2 participants