There’s currently no straightforward option to “calculate the MSD of the center of mass of a selection”. You might get a reasonable approximation of the center of mass by selecting a heavy atom closest to your computed center of mass.
Alternatively, you could create your own MSD class where you override the single_frame method: (Note, I didn’t test this but it *might* work):
class MSDCom(MDAnalysis.analysis.msd.MSD):
def __init__(self, *args, **kwargs):
super(MSDCom, self).__init__(*args, **kwargs)
self.n_particles = 1 # just one center of mass
def _single_frame(self):
r""" Constructs array of positions for MSD calculation.
Use the Center of Mass of ALL atoms as the only entry in the array.
"""
# shape of position array set here, use span in last dimension
# from this point on
self._position_array[self._frame_index] = (self.ag.center_of_mass[self._dim])
Oliver