Skip to content

Conversation

@yuanqing-wang
Copy link
Member

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2021

Codecov Report

Merging #95 (b3d6970) into master (51ea6db) will not change coverage.
The diff coverage is 0.00%.

Copy link
Member

@jchodera jchodera left a 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]
Copy link
Member

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).

Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


elif charge_method == "keep":
sys = ff.create_openmm_system(
g.mol.to_topology(), charge_from_molecules=[g.mol]
Copy link
Member

@jchodera jchodera Oct 29, 2021

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.

Copy link
Member Author

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?

Copy link
Member

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.

sys = ff.create_openmm_system(
g.mol.to_topology(), charge_from_molecules=[g.mol]
)

Copy link
Member

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` object

Perhaps we could rename

  • keep -> from-molecule
  • nn -> espaloma to use "espaloma" charges?

elif charge_method == "keep":
sys = ff.create_openmm_system(
g.mol.to_topology(), charge_from_molecules=[g.mol]
)
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

@jchodera
Copy link
Member

@yuanqing-wang Can we get this cleaned up, merged, and cut a new release when you get a chance? I can then release openmmforcefields with espaloma support!

@yuanqing-wang yuanqing-wang merged commit c525a3d into master Nov 14, 2021
@yuanqing-wang
Copy link
Member Author

@jchodera merged! please ref this in your openmmforcefield release / PR

@jchodera
Copy link
Member

Thanks! I'll test this out now, but we'll need a new release on conda-forge at some point soon

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

Successfully merging this pull request may close these issues.

4 participants