From 2ec6f886b68e927c8454636af686587ad7e71f9a Mon Sep 17 00:00:00 2001 From: James Krieger Date: Mon, 4 Nov 2024 18:24:29 +0000 Subject: [PATCH] simplify deformAtoms --- prody/dynamics/sampling.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/prody/dynamics/sampling.py b/prody/dynamics/sampling.py index 0af1f0404..3c06c6f6d 100644 --- a/prody/dynamics/sampling.py +++ b/prody/dynamics/sampling.py @@ -280,15 +280,12 @@ def deformAtoms(atoms, mode, rmsd=None, replace=False, scale=None): rmsd = float(rmsd) # rmsd = ( ((scalar * array)**2).sum() / n_atoms )**0.5 scalar = (atoms.numAtoms() * rmsd**2 / (array**2).sum())**0.5 + scale *= scalar LOGGER.info('Mode is scaled by {0}.'.format(scalar)) - if replace is False: - atoms.addCoordset(atoms.getCoords() + array * scalar * scale) - else: - atoms.setCoords(atoms.getCoords() + array * scalar * scale) + + if replace is False: + atoms.addCoordset(atoms.getCoords() + array * scale) else: - if replace is False: - atoms.addCoordset(atoms.getCoords() + array * scale) - else: - atoms.setCoords(atoms.getCoords() + array * scale) + atoms.setCoords(atoms.getCoords() + array * scale)