From: Bishop, Thomas C (bishop_at_tulane.edu)
Date: Thu Feb 12 2009 - 11:18:57 CST

I have a series of scripts for doing such stuff that I use regularly
they are as follows:
"do0cumentatin" on how to use them are at the very end.

ls ~/bin/load-*
~/bin/load-dcds.vmd ~/bin/load-pdbs.vmd
~/bin/load-mpdbs.vmd

cat ~/bin/load-dcds.vmd
foreach i $argv {
 mol addfile $i type {dcd} first 0 last -1 step 10 waitfor 1 0
}

cat ~/bin/load-mpdbs.vmd
foreach i $argv {
 echo " "
 echo "ADDing pdb file $i to initial molec "
 mol addfile "$i" type {pdb} first 0 last -1 step 10 waitfor 1 0
 echo " "
}

cat ~bin/load-pdbs.vmd
foreach i $argv {
  mol new $i
}

HEre's my "documentation"
to load a whole bunch of pdbs do this

vmd -e ~/bin/load-pdbs.vmd -args one.pdb two.pdb three.pdb otherdirctory/*.pdb

to add a bunch of pdbs as frames to an initial pdb do this

vmd -pdb first.pdb -psf some.psf -e ~/bin/load-mpdbs.vmd -args otherdirectory/*.pdb

this also works with other command line arguements like
vmd -parm7 system.parm7 -e ~/bin/load-mpdbs.vmd -args otherdirectory/*.pdb
 
and finally to load a whole series of trajectories automajically

vmd -parm7 sys.parm7 -e ~/bin/load-dcds.vmd -args dyn/dyn[1-5].dcd dyn/dyn1[3-4].dcd

in this last example I loaded an amber parm file then put a bunch of dcd's onto it.
I explicitly list the dcd's to make sure they go in the correct order... here I used
dyn1, dyn2, dyn3, dyn4 dyn5, dyn13, dyn14 (why skip those middles ? no reason just for fun)

-----Original Message-----
From: owner-vmd-l_at_ks.uiuc.edu on behalf of John Stone
Sent: Thu 2/12/2009 8:36 AM
To: bo baker
Cc: vmd-l_at_ks.uiuc.edu
Subject: Re: vmd-l: Load multiple files
 

Hi,
  It's easy to do this with a tiny bit of scripting. You could
do something like this (untested, but you get the idea):
  set filelist [glob *.pdb]
  foreach file $filelist {
    mol new $file waitfor all
  }

Cheers,
  John

On Thu, Feb 12, 2009 at 03:43:35PM +1100, bo baker wrote:
> Hi, VMD:
>
> Is it possible to load multiple pdb files at once? I have a set of
> models built from same template, and would like to compare them. From
> "molecule File Browser", one can load the pdb file one by one. Just
> wonder if I can select all the files and load them once.
>
> Thank you for your suggestion
>
> Bo

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078