From: Axel Kohlmeyer (
Date: Fri May 06 2005 - 07:00:05 CDT

On Fri, 6 May 2005 wrote:

EN> Hello all,

hello erik,

EN> I would like to generate a series of coordinate frames using VMD
EN> (based upon manipulations of a single reference configuration) and
EN> then analyze the relative potential energies of the various
EN> configurations (using NAMD).

EN> I think the latter part of this will be simple (just do a loop inside NAMD
EN> to read one frame at a time from a DCD file and "run 0" to compute the
EN> energies), but the first part, to my surprise, has proven tricky.

please have a look at the animate command. that contains the
parts, that you are missing.

EN> Here is what I tried:
EN> --------
EN> mol load psf $start_psf pdb $start_pdb
EN> set whole [atomselect top all]

EN> set frame 0
EN> for {set z $start_z} {$z >= $final_z} {set z [expr $z - $delta]} {

here you could insert:

animate dup frame 0
incr frame
animate goto $frame

EN> (modify my coordinates)

the following is not needed:

EN> molinfo top set frame $frame
EN> # $whole frame $frame
EN> $whole writedcd $final_dcd
EN> incr frame
EN> }

and now you could do

animate write dcd $final_dcd beg 0 end $frame waitfor all

and after that you can exit. this is straight from the manual
without testing, but that should at least give you another idea.

best regards,

EN> This script runs, but the resulting DCD file contains only one frame.
EN> If I un-comment the "$whole frame $frame" line, then the script aborts
EN> on its second trip through the loop; I get an error of:
EN> atomsel: frame 1 out of range for molecule 0
EN> So I guess my idea of setting the frame number in order to append it
EN> to my DCD output file doesn't work either.
EN> I re-read the VMD manual for the "writeXXX" command (subset of the
EN> "atomselect" command) but there's no detail about how to append frames
EN> one at a time.
EN> I'm sure there's an easier way to do this... can anyone help?
EN> thanks much,
EN> Erik
EN> C. Erik Nordgren, Ph.D.
EN> Department of Chemistry
EN> University of Pennsylvania

Dr. Axel Kohlmeyer   e-mail:
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum
If you make something idiot-proof, the universe creates a better idiot.