Unverified Commit 53b1b97d authored by James Gardner's avatar James Gardner Committed by GitHub
Browse files

Fix residueTemplates argument in addMembrane (#4755)

This is similar to https://github.com/openmm/openmm/pull/4528 but was
missed out. When the membrane and protein are combined a new topology
is created. This invalidates the residueTemplates dict so it must be
recreated before calling addSolvent.
parent 12191c31
......@@ -1575,7 +1575,11 @@ class Modeller(object):
needExtraWater = (boxSizeZ > patchSize[2])
if needExtraWater:
modeller.addSolvent(forcefield, neutralize=False, residueTemplates=residueTemplates)
newResidueTemplates = {}
for r1, r2 in zip(self.topology.residues(), modeller.topology.residues()):
if r1 in residueTemplates:
newResidueTemplates[r2] = residueTemplates[r1]
modeller.addSolvent(forcefield, neutralize=False, residueTemplates=newResidueTemplates)
# Record the positions of all waters that have been added.
......
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