From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Sun Jun 10 2007 - 15:00:58 CDT

On Sat, 9 Jun 2007, Cesar Millan wrote:

hi cesar,

CM> Hi everyone! I would like to use the animatepdbs.tcl to load multiple pdb
CM> files with their corresponding dx potential map at the same time. Does any
CM> one knows how to do this?

yes. i would expect that is quite a few people out here,
that know how to do this. however, with the information you
provide, it is very difficult to help you, since you didn't
tell us what you want to achieve.

CM>
CM> I was trying at the following manner but I got some errors:

please tell us, what _were_ the error messages.

there are a number of subtleties involved here:

- the use of 'mol load' is now deprecated, you should
  use 'mol new', 'mol addfile' instead

- from the perspective of VMD, coordinate frames and
  volumetric data sets are not correlated (yet).

so if you want to do an animation of your system with the
potential maps included (my guess), you have essentially
two options. load everything into one (VMD) molecule and
use a script like the one at:
http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part5.html#chap7_sect6

or load every frame and density pair into a different molecule
and try out the (new) MultiMolAnim plugin
http://www.ks.uiuc.edu/Research/vmd/plugins/multimolanim/

synchronize the visualization of all the molecules, you
could use the CloneReps plugin:
http://www.ks.uiuc.edu/Research/vmd/plugins/clonerep/

to load all files you can try something like this (untested):

set pdblist [lsort [glob -type f "my*.pdb"]]
set dxlist [lsort [glob -type f "my*.dx"]]

mol new [lindex $pdblist 0] type pdb waitfor all
mol addfile [lindex $dxlist 0] type dx waitfor all

for {set i 1} {$i <= [llength $pdblist]} {incr i} {

  mol new [lindex $pdblist $i] type pdb waitfor all
  mol addfile [lindex $dxlist $i] type dx waitfor all

}

in case you want to load everything into one (VMD) molecule,
you can replace the second 'mol new' with 'mol addfile'.
for more details, please check out the scripting section
of the VMD user's guide and/or a good text book or (online)
reference on TCL.

please let us know, if this works and/or if you need more help.

cheers,
   axel.

CM> proc animatepdbs {start end fileformat fileformat2} {
CM> set filename [format $fileformat [expr $start]]
CM> set filedx [format $fileformat2 [expr $start]]
CM> incr start
CM> puts "Reading initial frame in PDB sequence $filename"
CM> mol load pdb $filename -dx $filedx
CM>
CM> puts "Reading PDB files as an animation..."
CM> for {set i $start} {$i <= $end} {incr i 1} {
CM> set filename [format $fileformat [expr $i]]
CM> set filedx [format $fileformat2 [expr $start]]
CM> animate read pdb $filename -dx $filedx
CM> }
CM> }
CM>
CM> thank you for any help.
CM>
CM>

-- 
=======================================================================
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.