Unclear relationships between intermolecular exclusions, 1-4 pairs, proper torsions, and improper torsions in Amber files
A section in the only prmtop documentation I can find reads:
If the third atom is negative, then the 1-4 non-bonded interactions for this torsion is not calculated. This is required to avoid double-counting these non-bonded interactions in some ring systems and in multi-term torsions. If the fourth atom is negative, then the torsion is improper.
I don't know how to implement this and have gotten some inconsistent results when testing on some ring systems.
- Should the third atom be negative if that (proper) torsion's first and fourth atom already appear as the first and fourth atoms in an earlier torsion? What if that atom pair is a 1-2 or 1-3 interaction from a different traversal of the bond graph - shouldn't that be handled by the general atom exclusions?
- If an atom pair is the 1-4 pair of multiple (proper) torsions, does it matter which one has its third atom listed positive, or can it be any?
- What about with impropers? I can find files with the third and fourth atoms negative, which doesn't make much sense to me. Atoms in improper torsions shouldn't have intermolecular interactions at all, scaled or not.
It can be assumed that the function writing the DIHEDRALS_INC_HYDROGEN, DIHEDRALS_WITHOUT_HYDROGEN, etc. sections knows
- the atom indices of each atom in each torsion
- whether a given torsion is proper or improper
- whether this (proper) torsion's first and fourth also comprise an intramolecular pair in another torsion
More context: https://github.com/openforcefield/openff-interchange/issues/682#issuecomment-1526161825
#686 is probably similar; possibly I'm making a single mistake here that is causing both issues
Number 1 The answer is yes, 1:4 non-bonded pairs should appear in one and only one torsion, so the third atom should be negative in any other torsion that would imply the same 1:4 non-bonded pair. There have been Amber prmtop writers that double-counted 1:4 interactions, most often a problem in 6-membered rings. When multiple torsions span the same four atoms, the parameter file (the source of information in the prmtop) will also have negative values of the torsion's periodicity for all but the final term: http://ambermd.org/FileFormats.php
Number 2 I think that any of the torsions can indicate the 1:4 interaction. One weakness that I've always felt the Amber format has is the need to couple 1:4 interactions to some torsion. There is a practical basis, which is that the torsions modify the potential after 1:4 interactions have been applied, and in most Amber models there are torsions spanning every possible 1:4 interaction. But often when people tried to fit torsion parameters with mdgx, they would run into trouble, and the root of the problem was that there are no torsions of the sort they expected incorporated into the model. Even if the torsion parameters are present in something like gaff.dat and the right sequence of atom types appears in the model, it doesn't mean that the antechamber program is going to choose those parameters and apply them. I think it's quite possible to create models that have no torsions spanning a particular bond, and thus have no 1:4 interactions, although this is not the case with the common protein force fields. 1:4 interactions should be detected by bonding patterns, assigned a generic scaling factor, and then have this scaling factor modified by specific torsion interactions if specified.
Number 3 I think that impropers will never have 1:4 interactions, so marking the fourth atom index with a negative sign will eliminate the interactions regardless of whether the third is also negative.