From: Axel Kohlmeyer (
Date: Thu Oct 16 2008 - 09:11:17 CDT

On Thu, 16 Oct 2008, Jim Pfaendtner wrote:

JP> Dear VMD-L,
JP> I would like to be able to save an entire trajectory to a dcd file from the
JP> command line in VMD. I know this is possible from the main VMD window by
JP> using "Save Coordinates". However, I would like to use VMD in text mode to
JP> align and unwrap a trajectory, and then write the trajectory to a new file.

if a command works through the GUI, there is (almost) always an
equivalent script command. you can figure it out conveniently via
the "log" command. type "log somefile.log" into the text console
and then do whatever you want to do in the GUI and then type "log off"
and somefile.log will contain the script commands.

what you'll find out in this case is that you have to use the
command "animate".

BTW: i'd like to use the occasion to lobby again for introducing
a "mol write" that does a similar thing but would be more consistent
with "mol new"/"mol addfile" and would allow to phase out "animate
write", which is in a really unexpected location.

JP> The commands writepdb and writedcd seem to use an atomselection as their
JP> inputs which, I believe, can only be applied to a specific frame.

that is not correct. you can use selections to write trajectories as well.

JP> One option, of course, is to write each individual frame and then use
JP> catdcd, but this is a bit cumbersome.

yes, but as you see above, it is not needed.


JP> Thanks!
JP> Jim

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.