perses: Some Bace transformations failing due to validate endstate energies

File “/home/brucemah/miniconda3/envs/omm_source/lib/python3.6/site-packages/perses-0.5.1-py3.6.egg/perses/tests/utils.py”, line 784, in validate_endstate_energies assert abs(nonalch_one_rp - alch_one_rp + subtracted_energy) < ENERGY_THRESHOLD, f"The one state alchemical and nonalchemical energy absolute difference {abs(nonalch_one_rp - alch_one_rp + subtracted_energy)} is greater than the threshold of {ENERGY_THRESHOLD}." AssertionError: The one state alchemical and nonalchemical energy absolute difference 0.00028245274916116614 is greater than the threshold of 0.0001.

I am seeing the endstate energy fail for gaff-2.1.1, for a bunch of pairs of ligands for Bace. These edges have run fine with the openff-1.0.0

It also seems like it’s passing for the complex and solvent phases (which should be the harder test??) and failing for vacuum. For 21 edges, and seems to be between 0.00017 and 0.00028, when the threshold is 0.0001.

Also — it always seems to be failing at lambda=one state. I can’t see any pattern in the ligands that are lambda=1, or any pattern in the edges that fail.

Errors are in /data/chodera/brucemah/relative_paper/perses050/bace/gaff-2.11

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

I’ve attached the ‘real’ systems for the transformation Bace 10 -> 24 which is failing for GAFF but working for OFF. There are many more torsion parameters defined for the OFF system than the gaff for the same molecule.

I’m looking into this now, but I’m not entirely sure which molecule you’re looking for. I’d need the SDF files in order to check this.

For now, I’m looking at perses/perses/data/bace-example/Bace_ligands_shifted.sdf, and I’m assuming you’re counting from 0 and referring to the old ligand (ligand 10). Let me know if that isn’t correct.

From what I can see using the script below, the high number of torsion terms is correct:

$ grep "Torsion k" ligand10.gaff-1.81.system.xml  | wc -l
     110
$ grep "Torsion k" ligand10.gaff-2.11.system.xml  | wc -l
     111
$ grep "Torsion k" ligand10.smirnoff99Frosst-1.1.0.system.xml  | wc -l
     161
 $grep "Torsion k" ligand10.openff-1.0.0.system.xml  | wc -l
     196

If you turn on DEBUG logging, you can see that both smirnoff99Frosst and openff assign 118 torsions, but some of these torsions have multiple periodicities, so multiple entries are created.

Here’s the script I used:

from openmmforcefields.generators import SystemGenerator
from openforcefield.topology import Molecule

import logging 
logging.basicConfig(level=logging.DEBUG)

molecules = Molecule.from_file('Bace_ligands_shifted.sdf')
molecule_index = 10

from simtk import openmm
def write(system, filename):
    with open(filename, 'w') as outfile:
        outfile.write(openmm.XmlSerializer.serialize(system))

for forcefield in ['gaff-1.81', 'gaff-2.11', 'smirnoff99Frosst-1.1.0', 'openff-1.0.0']:
    system_generator = SystemGenerator(small_molecule_forcefield=forcefield, molecules=molecules)
    system = system_generator.create_system(molecules[molecule_index].to_topology().to_openmm())
    filename = 'ligand10.' + forcefield + '.system.xml'
    print(filename)
    write(system, filename)