From: Morgan, Brittany (
Date: Mon Jul 06 2015 - 07:43:15 CDT

Hi Monika,

The bigdcd script only runs if your procedure has the single argument "frame". One way to get around this is to use the "global" keyword for whatever extra variables you need. So if your procedure is something like:

proc example {vara varb} {

.. script ...


Rewriting it in this form should work with bigdcd:

proc bigdcdexample { frame } {

global vara varb

.. script ..


and then you call:
bigdcd bigdcdexample dcd $dcdpath
(the second line to makes sure all frames are processed before the script exits)

There may be a better way to do it, but this works for me. Basically, bigdcd replaces the loop over the number of frames (which is why the only argument is the frame), and your procedure is whatever you want to do each frame (such as write a separate pdb file).


From: [] on behalf of Monika Madhavi []
Sent: Friday, July 03, 2015 6:39 AM
Subject: vmd-l: Using bigdcd for an already written script

Dear all,

I have a big dcd file which does not fit into my memory. I want to select few molecules from all the frames of my trajectory and save their coordinates to a separate pdb file. I wrote a tcl script and it works fine when I can load the whole trajectory at once (small dcd files) but, I don't understand how can I use bigdcd with my script.

The guide on web says "The analysis script must accept one argument" which I don't understand. My script takes two input arguments. Does this mean I can't use bigdcd with this script?

proc trace {nt seltext } {
set n [molinfo top get numframes]
set selection {}
for {set i 0} {$i <$nt} {incr i} {
set ind [expr rand()*10000]
lappend selection $ind
set atomlist [atomselect top "index $selection"]

animate write pdb traced.pdb beg 0 end [expr $n-1] waitfor all sel $atomlist
$atomlist delete

I would be grateful if someone can suggest me how to use bigdcd with this script.


W.A.Monika Madhavi
Lecturer (Probation),
Department of Physics,
University of Colombo.