-
Notifications
You must be signed in to change notification settings - Fork 28
AM1-BCC charge deploy #95
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
Conversation
jchodera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested a few changes!
| elif charge_method == "am1-bcc": | ||
| g.mol.assign_partial_charges() | ||
| sys = ff.create_openmm_system( | ||
| g.mol.to_topology(), charge_from_molecules=[g.mol] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to include charge_from_molecules here, do you? You want ff to assign AM1-BCC charges, which is specified as part of the openff force field you are using as a base force field (here, openff-1.2.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after calling assign_partial_charges() the charges would be stored in that molecule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! Perhaps we need am1-bcc, which calls assign_partial_charges(), and a separate smirnoff options, which just leaves this up to the ff. object to handle charges as specified in the force field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't assign_partial_charges require a partial_charge_method argument to be specified?
https://open-forcefield-toolkit.readthedocs.io/en/0.10.1/api/generated/openff.toolkit.topology.Molecule.html#openff.toolkit.topology.Molecule.assign_partial_charges
|
|
||
| elif charge_method == "keep": | ||
| sys = ff.create_openmm_system( | ||
| g.mol.to_topology(), charge_from_molecules=[g.mol] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you do want charge_from_molecules, which will override the charging scheme and take the charges from g.mol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but this is assuming that the molecule has charges so that we don't need to redo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if this is specified, we are assuming the molecule already has charges.
espaloma/graphs/deploy.py
Outdated
| sys = ff.create_openmm_system( | ||
| g.mol.to_topology(), charge_from_molecules=[g.mol] | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document charge_method in the docstring, and maybe add something to the README.md?
I think we support
charge_method : str, optional, default='nn'
Method to use for assigning partial charges:
'nn' : Assign partial charges from the espaloma graph net model
'am1-bcc' : Allow the OpenFF toolkit to assign AM1-BCC charges using default backend
'gasteiger' : Assign Gasteiger partial charges (not recommended)
'keep' : Use partial charges provided in the original `Molecule` objectPerhaps we could rename
keep->from-moleculenn->espalomato use "espaloma" charges?
| elif charge_method == "keep": | ||
| sys = ff.create_openmm_system( | ||
| g.mol.to_topology(), charge_from_molecules=[g.mol] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the else: behavior bellow do? Shouldn't we raise an exception for the else: case because the charge method is not recognized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for else it would use the default behavior of ff.create_openmm_system which is to use am1-bcc as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to avoid else:, since we don't want to have typos in charge_method silently give weird behavior---typos in charge_method should raise a ValueError.
|
@yuanqing-wang Can we get this cleaned up, merged, and cut a new release when you get a chance? I can then release |
|
@jchodera merged! please ref this in your |
|
Thanks! I'll test this out now, but we'll need a new release on conda-forge at some point soon |
No description provided.