From: Morgan, Brittany (Brittany.Morgan_at_umassmed.edu)
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
bigdcd_wait
(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).

Brittany

________________________________
From: owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] on behalf of Monika Madhavi [monikamadhavi_at_gmail.com]
Sent: Friday, July 03, 2015 6:39 AM
To: vmd-l_at_ks.uiuc.edu
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.

Regards,
Monika

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