From: Irene Newhouse (einew_at_hotmail.com)
Date: Mon Mar 24 2008 - 20:07:20 CDT

I bring up VMD, I open a Tk console, I type:
source brwat.tcl [which is what I've called this script]
 
and it spits back, almost instantly:
 
ERROR) No molecules loaded.mol new operates on one molecule only
 
Which it doesn't do with "mol load"; that writes out 349 files of nearly the same size - which I expected.
 
This is what the script looks like now:
 
 
#initialize
set numfr 350
set pref h5a100
set mymol [mol new parm7 $pref.prmtop]
 
set brdg [atomselect $mymol "(same residue as water and within 5 of resid 1447 to 1449) \
or (resid 1447 to 1449) or (resid 220 to 228) or (resid 130 to 135) or (resid 180 to 190)"]
 
#loop over all frames
for {set frame 0} {$frame < $numfr} {incr frame} {
# read the current frame & update the selection
 
# delete any frames from before
animate delete beg 0 $mymol
 
mol addfile $pref.dcd type dcd first $frame last $frame waitfor all molid $mymol
 
$brdg frame 0
 
#recompute selection
$brdg update
 
# write the current frame into a pdb file
 
$brdg writepdb [format $pref-%04d.pdb $frame]
 
#end loop over all frames
}
 
Thanks!
Irene> Date: Mon, 24 Mar 2008 20:22:30 -0400> From: akohlmey_at_cmm.chem.upenn.edu> To: einew_at_hotmail.com> CC: vmd-l_at_ks.uiuc.edu> Subject: RE: vmd-l: script to read dcd frame-at-a-time & write a selection> > On Mon, 24 Mar 2008, Irene Newhouse wrote:> > IN> Thank you very much! This does work, except that VMD doesn't like > IN> "mol new" because, the error message says, there's no mol loaded. So > IN> I changed that to "mol load", obsolescent though it may be.> > if you get this kind of error message, then you have> made a mistake elsewhere. mol new works well. i use it > exclusively. > > the fact that it works for you with mol load may just hide> some other bug.> > when writing scripts that are supposed to be running in> batch one cannot be paranoid enough...> > cheers,> axel.> > IN> > > -- > =======================================================================> 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.
_________________________________________________________________
In a rush? Get real-time answers with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_realtime_042008