-
Notifications
You must be signed in to change notification settings - Fork 78
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
assert_dihedral_params incorrect behavior for layered dihedrals (e.g., GAFF) #295
Comments
If dihedrals have multiple parameters layered on them, they parameters applying to the same dihedral get grouped together into a single DihedralType. I think this might help address the issue where the number of parametrized dihedrals exceeds the number of system dihedrals. |
Is this necessarily a case we want to avoid, though? The three |
I might need to test this out further, but let's say you had a system with 3 chemically-identical dihedrals, but each dihedraltype has 4 PeriodicTorsions to it. When this gets initially converted into parmed, |
@ahy3nz nice catch. A quick test suggests this is indeed the behavior. This would affect the writers as they would need to loop through the Does it make sense to apply |
Anyways, point is, I think it's okay to call |
An update on this issue: It appears that if the force constant for a dihedral is Unfortunately, this means that the number of parameterized dihedrals will sometimes be less than the number of physical dihedrals. |
I recall Andrew or somebody pointing this out some time ago, but I don't recall our workaround. I don't think there was a clear workaround while using OpenMM, except that we intend to be forgiving with that assert (compared to the case of missing bonds or angles, which default to be an error). Unfortunately, this doesn't really help you do your bookkeepping with GAFF or any other force field with zero-force dihedrals. |
Describe the behavior you would like added to Foyer
Currently, the
_check_dihedrals
function offorcefield.py
verifies that the total number of dihedrals identified matches the number of parameterized dihedrals. This is incorrect behavior if multiple dihedrals potentials are placed on the same physical dihedral (i.e., the samei-j-k-l
atoms). Foyer exits with aParameters have not been assigned to all proper dihedrals. Total system dihedrals: XX, parameterized dihedrals: YY.
message, even ifYY > XX
.Describe the solution you'd like
Foyer should check that for each physical dihedral
i-j-k-l
atoms, that there is at least one parameterized dihedral.Describe alternatives you've considered
We could just ensure that the number of parameterized dihedrals is greater than or equal to the number of system dihedrals. However, this solution may fail to catch unparameterized dihedrals in the case where some physical dihedrals had multiple potentials while other physical dihedrals had zero potentials.
The text was updated successfully, but these errors were encountered: