From: Francesco Pietra (chiendarret_at_gmail.com)
Date: Wed Jun 03 2015 - 12:08:44 CDT

Hello:
I could successfully run centermass, rmsd and rgyr with bigdcd.tcl and vmd
in text mode. In contrast, with distance.tcl I was unsuccessful.
The distance.tcl script reads

source bigdcd.tcl

proc distance { frame } {
   global all sel1 sel2 coord1 coord2 outfile
   set coord1 [lindex [$sel1 get {x y z}] 0]
   set coord2 [lindex [$sel2 get {x y z}] 0]
   puts $outfile "$frame: [vecdist $coord1 $coord2]" "[measure rgyr $sel]"
 }
set outfile [open distance.dat w];
# set mol [mol new protein.psf waitfor all]
set mol [mol new blg.psf waitfor all]
# mol addfile protein.pdb type pdb waitfor all
mol addfile blg.pdb type pdb waitfor all
# set sel1 [atomselect $mol "protein and resid 1 and alpha"]
# set sel2 [atomselect $mol "protein and resid 2 and alpha"]
set sel1 [atomselect $mol "protein and resid 34 and alpha"]
set sel2 [atomselect $mol "protein and resid 36 and alpha"]
# bigdcd distance eq-0.dcd eq-1.dcd
bigdcd distance blg.dcd
bigdcd_wait
close $outfile

The terminal output reads:

$ vmd -e distance.tcl -dispdev none > distance.txt
bigdcd aborting at frame 1
can't read "sel": no such variable

while distance.txt reads:

Info) VMD for LINUXAMD64, version 1.9.1 (February 1, 2012)
Info) http://www.ks.uiuc.edu/Research/vmd/
Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
Info) Please include this reference in published work using VMD:
Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
Info) -------------------------------------------------------------
Info) Multithreading available, 4 CPUs detected.
Info) Free system memory: 7074MB (89%)
Warning) Detected a mismatch between CUDA runtime and GPU driver
Warning) Check to make sure that GPU drivers are up to date.
Info) No CUDA accelerator devices available.
Info) Dynamically loaded 2 plugins in directory:
Info) /usr/local/lib/vmd/plugins/LINUXAMD64/molfile
loading bigdcd...
bigdcd loaded...
file4
Info) Using plugin psf for structure file blg.psf
psfplugin) no cross-terms defined in PSF file.
Info) Analyzing structure ...
Info) Atoms: 25366
Info) Bonds: 17736
Info) Angles: 12120 Dihedrals: 6544 Impropers: 384 Cross-terms: 0
Info) Bondtypes: 0 Angletypes: 0 Dihedraltypes: 0 Impropertypes: 0
Info) Residues: 7802
Info) Waters: 7644
Info) Segments: 3
Info) Fragments: 7651 Protein: 1 Nucleic: 0
0
Info) Using plugin pdb for coordinates from file blg.pdb
Info) Finished with coordinate file blg.pdb.
0
atomselect0
atomselect1
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
dcdplugin) Warning: DCD header claims 140 frames, file size indicates there
are actually 141 frames
Info) Using plugin dcd for coordinates from file blg.dcd
bigdcd_done
after#0
vmd > Info) Finished with coordinate file blg.dcd.

and distance.dat is empty.

Thanks a lot for pointing out what is wrong in the tcl script

francesco pietra