I am performing a molecular dynamics simulation, and I am taking "snapshots" of the system at regular intervals.

The aim is that of finding the preferred geometry of a molecule in solution.

Are you aware of any software capable of automating to some extent the superposition of different geometries, and maybe of building an "average" structure?

  • 2
    $\begingroup$ I think what you are asking is a fairly difficult and likely not automatable procedure as the details will vary a lot depending on what you are interested in and the system you are studying. The simplest (but not necessarily simple) thing to do is just define a set of internal coordinates and transform your cartesians to these and average over your snapshots. $\endgroup$
    – jheindel
    Jun 7, 2019 at 19:46
  • $\begingroup$ I have also been a part of a project where we were interested in averaging over a particular coordinate that is sensitive to low frequency vibrations which themselves are sensitive to thermal fluctuations. So, we first performed a Fourier filtering over these low frequency vibrations and then averaged the ones we were actually interested in. I'm just trying to get across that doing this in a reliable manner can be highly non-trivial and is certainly not unique as the systems get bigger and which coordinates are good ones becomes less obvious. $\endgroup$
    – jheindel
    Jun 7, 2019 at 19:47
  • $\begingroup$ Indeed, averaging the coordinates was my idea as well, but I hoped in a less time-consuming procedure :) $\endgroup$
    – user32223
    Jun 7, 2019 at 19:47
  • 3
    $\begingroup$ Ya, unfortunately defining coordinates is the bane of many computational chemists' existence. It is time-consuming and often has to be done by hand if you want to be able to easily interpret the chemical relevance of the coordinates. The actual transformation from one set to another isn't too bad, but you have to write the code to do it at least once. I don't know of any well-established code to do this, but maybe there's a github repo somewhere... $\endgroup$
    – jheindel
    Jun 7, 2019 at 19:50
  • 1
    $\begingroup$ GROmaps may be an option for you too GROmaps $\endgroup$
    – B. Kelly
    Jun 11, 2019 at 16:53

1 Answer 1


This is possible with the Python package MDTraj. Assuming you have your trajectory saved as trajectory.dcd and topology in topology.pdb:

import mdtraj as md
from mdtraj.geometry.alignment import compute_average_structure

traj = md.load('trajectory.dcd', top='topology.pdb')
average = compute_average_structure(traj.xyz)

I believe it will RMSD align the trajectory first, but you may need to specify that explicitly first.

You might also want to check out MDAnalysis as well, it may have similar functionality. I've used both packages and both are still actively maintained.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.