feat: Improve handling of NB 1-4 scaling factors#318
Merged
mikemhenry merged 3 commits intoopenmm:mainfrom Dec 20, 2023
Merged
Conversation
added 2 commits
December 12, 2023 12:19
This change improves the handling of Nonbonded scaling factors. Subclasses of SmallMoleculeTemplateGenerator can now set specific 1-4 scaling factors, which are then used in the openmm system creation.
Collaborator
Is it not currently? |
Contributor
Author
|
It does set those values to a hardcoded 0.5 and 0.8333, respectively. The code even includes a TODO:
I have a very special case where I need to modify the scaling of NB interactions in the system as a whole. I know exceptions exist in OpenMM, but having a general ability to read FF-defined scaling factors can prove useful |
LilDojd
commented
Dec 15, 2023
Comment on lines
-1071
to
+1074
| # TODO: Get coulomb14scale and lj14scale from SMIRNOFF ForceField object, | ||
| # though this must match the original AMBER values | ||
| nonbonded_types = etree.SubElement(root, "NonbondedForce", coulomb14scale="0.833333", lj14scale="0.5") | ||
| # In case subclasses specifically set the 1-4 scaling factors, use those. | ||
| nonbonded_types = etree.SubElement(root, "NonbondedForce", | ||
| coulomb14scale=getattr(self, "_coulomb14scale", "0.833333"), | ||
| lj14scale=getattr(self, "_lj14scale", "0.5")) |
Contributor
Author
There was a problem hiding this comment.
Talking about this part of code
Collaborator
There was a problem hiding this comment.
I see - you're totally correct
mikemhenry
approved these changes
Dec 20, 2023
Collaborator
|
Thanks! @LilDojd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change improves the handling of Nonbonded scaling factors. Subclasses of SmallMoleculeTemplateGenerator can now set specific 1-4 scaling factors, which are then used in the residue template generation. SMIRNOFFTemplateGenerator now sets lj14scaling and coulomb14scaling to the one present in the SMIRNOFF Force field