From: Sascha Tayefeh (sascha_at_pc.chemie.tu-darmstadt.de)
Date: Thu Mar 03 2005 - 04:20:38 CST

Dear vmd-community,

  I have some difficulties adapting the analysis-script bigdcd.tcl
provided at vmd's script_library:

  http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/bigdcd

  Consider example 1 given in the script:
--------------------
proc mycenter { frame } {
global all
puts "$frame: [measure center $all weight mass]"
}
mol load psf alanin.psf
set all [atomselect top all]
$all global
bigdcd mycenter alanin.dcd
---------------------

I would like to write output to a file, so I tried this:

--------------------
# I want file to be opened *once*
# rather than each time mycenter is called
# so I open file from outside mycenter

proc mycenter { frame } {
global all
global handle
puts $handle "$frame: [measure center $all weight mass]"
}

mol load psf alanin.psf
set handle [open test.dat w];
set all [atomselect top all]
$all global
bigdcd mycenter alanin.dcd
close $handle
---------------------

which, under any circumstance, ends up with an exeption caught by
bigdcd::bigdcd_callback that says:

---------------------
bigdcd aborting at frame 1
can not find channel named "file16"
---------------------

  I am not that familiar with tcl, hence, I am trying to find a solution
for 2 days, reading tcl-tutorials, references, google, newsgroups and on
and on -now, I give up.

  Any suggestions are *very* welcome!

  Sincerly

-- 
Sascha Tayefeh <sascha_at_pc.chemie.tu-darmstadt.de>
Dipl.-Biol, PhD-Student
http://www.pc.chemie.tu-darmstadt.de/staff/sascha/
---
Technische Universitaet Darmstadt
Physikalische Chemie I
64287 Darmstadt
Germany
---