********> bugfix.28 Author: Jason Swails Date: Feb. 7, 2012 Program: MMPBSA.py Description: Fix standard deviation calculation for normal mode calculations. ----------------------------------------------------------------------------- diff --git AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py index 23b5d82..f1f963d 100644 --- AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py +++ AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py @@ -2311,7 +2311,7 @@ class NMODEout: def _tot_stdevs(self): """ Returns the standard deviations of the total based on whether or not we were able to calculate all frames or not. Use a sample stdev if we were, sum-of-squares if we weren't """ - if len(self.com_data) != len(self.rec_data) or len(self.com_data) != len(self.lig_data): + if len(self.com_data[0]) != len(self.rec_data[0]) or len(self.com_data[0]) != len(self.lig_data[0]): return math.sqrt(abs(_stdev(self.com_data[0]) ** 2 + _stdev(self.rec_data[0]) ** 2 + _stdev(self.lig_data[0]) ** 2)) sum = sum2 = 0 @@ -2319,8 +2319,8 @@ class NMODEout: sum += self.com_data[0][i] - self.rec_data[0][i] - self.lig_data[0][i] sum2 += (self.com_data[0][i] - self.rec_data[0][i] - self.lig_data[0][i]) ** 2 - avg = sum / len(self.com_data) - return math.sqrt(abs(sum2 / len(self.com_data) - avg * avg)) + avg = sum / len(self.com_data[0]) + return math.sqrt(abs(sum2 / len(self.com_data[0]) - avg * avg)) #==============================