From: Axel Kohlmeyer (
Date: Tue Apr 17 2012 - 19:20:56 CDT

On Tue, Apr 17, 2012 at 7:28 PM, Ben Rodriguez <>wrote:

> Hi there,
> I'm trying to use VMD to record the position of an atom for each frame
> that the atom falls within this selection expression:
> "*same residue as water (within 6 of index 451) and same residue as water
> (within 8 of index 1518)*"
> Ideally I would like a pdb for each frame that satisfied, but I noticed
> that the Save coordinates dialogue will record the position of the atom for
> all frames.

since all molecule file i/o routines in the molfile library
assume that you have a constant number of atoms in
your trajectory, there is consequently no option to update
the selection while writing a trajectory.

the only way to get what you are asking for is to
write a script that creates the selection, then loops
over all frames and advances the frame and updates
the selection before writing out just one frame (the
current one). this way you'd get one file per frame.


> Is there an alternate way to do what I want to do?
> Thanks,
> Ben R

Dr. Axel Kohlmeyer
College of Science and Technology
Temple University, Philadelphia PA, USA.