forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
169 stars 41 forks source link

Gracefully handle `nan` or `inf` charges in `molsetup.py` #91

Closed amorehead closed 3 months ago

amorehead commented 3 months ago
diogomart commented 3 months ago

The problem with this is that it fails silently, problematic molecules will go unnoticed, Currently, the PDBQT writer raises the error if there are NaNs or Infs, and the error can be escaped if bad_charges_ok=True which is useful for docking with Vina because charges are not needed.

amorehead commented 3 months ago

I see. I did not notice bad_charges_ok the first time around, however, it seems like this will solve my initial issue. In which case, I'll close this PR. Thanks for your quick response!

diogomart commented 3 months ago

Thank you for looking into it. Maybe bad_charges_ok should become set_bad_charges_to_zero so we don't see nan or inf in the PDBQT.

amorehead commented 3 months ago

I think that might make more sense, since to me it seems like having nans or infs listed in the PDBQTs might also confuse users. In fact, I've made a PR for this here: https://github.com/forlilab/Meeko/pull/92.