From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Tue Apr 24 2007 - 09:21:45 CDT

On Tue, 24 Apr 2007, Ignacio Fernández Galván wrote:

IFG> Hi all,

hi ignacio,

IFG> I have a trajectory (actually, a set of configurations) in a xyz file,
IFG> where the number of atoms in each structure is different, and I would
IFG> like to display them in some kind of movie. According to this message

check out the new VMD 1.8.6 release. we managed to put in
a small GUI for that at the very last minute.

IFG> (<http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/3185.html>), I
IFG> could load each structure in a separate molecule, but when I tried the
IFG> scripts in this page
IFG> (<http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part7.html#chap9_sect5>),
IFG> with something like:
IFG>
IFG> for {set i 0} {$i < 15} {incr i} {
IFG> mol new "file.xyz" first $i last $i
IFG> }
IFG>
IFG> VMD didn't want to read the structures in frames after the first (it
IFG> created molecules with 0 frames). Can it be made to work? I don't want
IFG> to have each frame in a different file...

no. this is not yet doable. the xyz plugin does not track
the number of atoms when skipping over lines.

but splitting the existing file into parts is not that difficult.
please have a look at the attached perl script (took only a couple
of minutes to write...).

just run: perl split_xyz.pl trajectory.xyz

and then in the VMD console

foreach f [lsort [glob split*.xyz]] {
    mol new $f type xyz waitfor all
}

voila!

cheers,
   axel.

p.s.: please let us know how well it works so that we can add
this to the MultiMolAnim plugin documentation. thanks. a.

IFG>
IFG> Thanks a lot
IFG>
IFG>
IFG> ___________________________________________________________
IFG> Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
IFG> now.
IFG> http://uk.answers.yahoo.com/
IFG>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   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.