From: Axel Kohlmeyer (
Date: Sun Jul 26 2015 - 23:05:42 CDT

On Sun, Jul 26, 2015 at 11:17 PM, JeJoon Yeon <> wrote:
> Hello
> I have a xyz format file, made up of total 1000 frame and 1761 atoms per a
> frame.
> For the visualization & post processing purpose, I swapped several atom's
> name to the different kind, to distinguish their position and movement under
> specific conditions.
> The position and number of those swapping atoms are different among frames
> to frames. For example, atom #1 can be swapped in first frame, but atom #20
> and #100 can be swapped (while #1 is replaced to original) in the next
> frame.
> After the swapping, when I command vmd -xyz, something weird
> happened. I can't see any of swapped atoms. I changed some Si atoms to Al or
> Mg, but none of Al or Mg were detected during entire frames. I changed some
> O atoms to N and F, but only N is visible, no F were detected.
> More strange thing is, single frame or 10 frame file (which was swapped)
> looked perfectly okay. I can see all swapped atoms there. However, only 1000
> frame or 10000 frame files made those problems - swapped Al, Mg, He, F...
> atoms were not visible.
> How can I escape from this situation? I really want to show those different
> atoms.

what you observe is a very normal behavior of VMD. VMD was initially
conceived for classical MD calculations where the type and
connectivity of atoms does not change, thus the atom
names/types/labels/residues/etc. are only loaded for the very first
frame read.

if you want to visualize properties that change over the course of the
trajectory, you have several options:
- load each frame into a different molecule (i.e. split the
trajectory) and use the multimol animation plugin to view only one of
them at a time
- write a Tcl script that parses the xyz file and stores the special
atom properties into the "user" field, after it has been read. then
use the user field value when creating representations
- same as above, but rather than using a user field, store the type
information into special lists and then write a Tcl procedure that
swap atom types as needed when the vmd frame number is changed.
connect the second proc to the animation loop via the Tcl trace
- write a script that transforms your .xyz trajectory, so that it is
properly "padded" that it contains all required atom types in their
maximal required counts in all frames and then just map the existing
trajectory to it and place all "empty" atoms at a coordinate that is
not visible in your visualization (the topotools plugin has a command
to do something similar on the fly).
- use a different visualization program that has different performance
vs. storage tradeoff than VMD


> Thanks

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