From: Axel Kohlmeyer (
Date: Fri Feb 08 2013 - 07:53:07 CST

On Fri, Feb 8, 2013 at 1:55 PM, Gavin Melaugh
<> wrote:
> Hi All,
> I have been using VMD for the last 3 years to analyse trajectories from
> molecular simulations.
> Recently I have started a new project looking at the population dynamics of
> bacterial growth. Since I am used to using VMD I was wondering the
> following:
> 1) Can I load xyz configuration files into VMD, in which the number of
> particles
> (bacterial cells) is different in each configuration file.

yes and no. it cannot be done directly, but there are workarounds. the
simplest is to have the code producing the trajectory changed to "pad"
the output with dummies, so that VMD simply sees a constant number of
particles. the second is to do this on the fly with a script like the
one in here:
finally, you can just split the trajectory and load each frame
independently as a VMD molecule and use the multi-molecule animation
GUI to toggle between them instead of the main VMD GUI.

> 2) Also if 1) can be achieved, is there also a way of defining the radius of
> each individual particle. The output from my simulation gives xyz files with
> the following format
> agent x y z radius
> 1
> 2
> 3

again, it is possible, but it would require additional scripting
effort. the xyz reader by itself doesn't support different outside of
those implied by recognized element names. the xyz reader in the
topotools plugin, however, is entirely written in Tcl, so you could
easily write something similar or (better yet) write a version that
supports the PQR format, which is commonly used.
however, there is an additional complication: most atom properties are
not per-frame properties and that includes the radius. per-frame data
is x,y,z and vx,vy,vz as well as user, user2, user3, and user4. so
you'd have to store properties in there and then have a callback
hooked into the animation loop to update the radius info from, say,

> I can generate movies from the simulations but I just find that I can not
> interact with them in the way that I am used to.

well, there is only so much that can be done in this regard. any
additional flexibility may impact the performance for the more common
VMD scenario, where the number and most properties of particles remain


> Many Thanks in Advance
> Gavin
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.

Dr. Axel Kohlmeyer
International Centre for Theoretical Physics, Trieste. Italy.