From: Axel Kohlmeyer (
Date: Tue Feb 03 2015 - 11:55:55 CST

On Tue, Feb 3, 2015 at 11:46 AM, Jonathan Booth <> wrote:
> I have a trajectory (.dcd) and I want to do the following:
> find the average structure
> find the trajectory frame with the closest structure to the average
> print this structure out to a .pdb file
> How do I do this?

there are two kinds of possible answers to this question:
1) how to actually do what you ask
2) suggestions to do something better

as for 1): VMD has script commands to do these kind of things as part
of the measure command. you can load your trajectory (psf + dcd) and
then compute the average position of all atoms via "measure avpos".
and there is "measure rmsd" to compute the root mean squared deviation
from a reference. with a little bit of reading through the VMD user's
guide and some googling, you should find sufficient script fragments
to build a custom script for your purposes. no need to repeat this

as for 2): please keep in mind, that the directly computed average
structure may not be a very physical one. e.g. if the object you are
looking at is rotating, the average structure will shrink, in the most
extreme case to a single point (the average position of a circular
motion is the center of that circle). this can be alleviated by doing
an alignment to a reference structure first. but even then, you may
first look closely at the properties of your structure through a
cluster analysis along the trajectory and base your averaging on the
most likely group of structures.

in addition, the RMSD trajectory tool plugin might be helpful to
automate some steps and particularly investigate quickly whether some
more complex processing is needed or not.


> Thanks in advance
> Jonathan

Dr. Axel Kohlmeyer
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.