choderalab / espaloma_charge

Standalone charge assignment from Espaloma framework.
MIT License
35 stars 5 forks source link

Espaloma assigns total neutral charge to charged molecules #4

Closed lilyminium closed 1 year ago

lilyminium commented 1 year ago

Thanks for putting this up as a package, @yuanqing-wang -- it makes it very easy to use!

I did notice that Espaloma always assigns charges that sum up to 0 to a molecule, even for charged molecules where a total_charge is passed in. Is that intentional -- do we need to rescale manually?

from espaloma_charge import charge
from openff.toolkit.topology.molecule import Molecule

offmol = Molecule.from_smiles("O=C[O-]")
esp_charges = charge(offmol.to_rdkit(), total_charge=-1)
esp_charges.sum()  # 0.0
yuanqing-wang commented 1 year ago

Thanks @lilyminium !

There was a bug in the deployment script which has been fixed in https://github.com/choderalab/espaloma_charge/releases/tag/v0.0.6.

Cheers,

yuanqing-wang commented 1 year ago

btw with this new release it does not require you to specify the total charge