Commit 9f93a85b by peastman Committed by GitHub

Merge pull request #180 from JoaoRodrigues/apply_compiled_fix

Fixed error when calling _matchResidue(). OpenMM now uses compiled functions
parents 4cea9a7f 200534fe
......@@ -39,6 +39,15 @@ from simtk.openmm.app.internal.pdbstructure import PdbStructure
from simtk.openmm.app.internal.pdbx.reader.PdbxReader import PdbxReader
from simtk.openmm.app.element import hydrogen, oxygen
from simtk.openmm.app.forcefield import NonbondedGenerator
# Support Cythonized functions in OpenMM 7.3
# and also implementations in older versions.
try:
from simtk.openmm.app.internal import compiled
matchResidue = compiled.matchResidueToTemplate
except ImportError:
matchResidue = app.forcefield._matchResidue
import numpy as np
import numpy.linalg as lin
import sys
......@@ -1131,7 +1140,7 @@ class PDBFixer(object):
signature = app.forcefield._createResidueSignature([atom.element for atom in residue.atoms()])
if signature in forcefield._templateSignatures:
if any(app.forcefield._matchResidue(residue, t, bondedToAtom) is not None for t in forcefield._templateSignatures[signature]):
if any(matchResidue(residue, t, bondedToAtom) is not None for t in forcefield._templateSignatures[signature]):
continue
# Create a new template.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment