Unverified Commit 3cb6f8d7 authored by FloLangenfeld's avatar FloLangenfeld Committed by GitHub
Browse files

Update residueTemplates dictionary when solvating a system (#4525)


Co-authored-by: default avatarFloLangenfeld <florent.langenfeld@peptinov.fr>
parent 2d4372d7
......@@ -540,10 +540,13 @@ class Modeller(object):
newTopology.setPeriodicBoxVectors(vectors*nanometer)
newAtoms = {}
newPositions = []*nanometer
newResidueTemplates=dict()
for chain in self.topology.chains():
newChain = newTopology.addChain(chain.id)
for residue in chain.residues():
newResidue = newTopology.addResidue(residue.name, newChain, residue.id, residue.insertionCode)
if residue in residueTemplates:
newResidueTemplates[newResidue] = residueTemplates[residue]
for atom in residue.atoms():
newAtom = newTopology.addAtom(atom.name, atom.element, newResidue, atom.id)
newAtoms[atom] = newAtom
......@@ -656,7 +659,7 @@ class Modeller(object):
numTotalWaters = len(waterPos)
# Add ions to neutralize the system.
self._addIons(forcefield, numTotalWaters, waterPos, positiveIon=positiveIon, negativeIon=negativeIon, ionicStrength=ionicStrength, neutralize=neutralize, residueTemplates=residueTemplates)
self._addIons(forcefield, numTotalWaters, waterPos, positiveIon=positiveIon, negativeIon=negativeIon, ionicStrength=ionicStrength, neutralize=neutralize, residueTemplates=newResidueTemplates)
def _computeBoxVectors(self, width, boxShape):
"""Compute the periodic box vectors given a box width and shape."""
......
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