Skip to content

Commit

Permalink
simplify deformAtoms
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Nov 4, 2024
1 parent c6e88c3 commit 2ec6f88
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions prody/dynamics/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


0 comments on commit 2ec6f88

Please sign in to comment.