From: Asmaa Elsheshiny (pyaaea_at_leeds.ac.uk)
Date: Wed Jul 28 2010 - 04:14:31 CDT

Dear community,

I have some diffculties in running a script in vmd, to display the dipole vector for each frame of my protein. After running the script in dipole.tcl, i got this error message
can not find channel named "-29.5305614471 27.6423969269 8.45355415344"

My script is as follow.

set molid 0
    set frame [molinfo $molid get frame]
    if {[info exists dipdata($frame)]} then {
                                                                    9
       Visualization and Analysis of Quantum Chemical and Molecular Dynamics Data with VMD
        if {[info exists dipgraph]} then {
               foreach g $dipgraph {
                  graphics $molid delete $g
               }
        }
        graphics $molid color yellow
        lassign $dipdata($frame) cnt vec
        # scaling res radius
        set dipgraph [vmd_draw_vector $molid $cnt $vec 100000.0 10 0.08]
    }
}
#estimate the dipole moment
set sel [atomselect 0 "not name X"]
set n [molinfo 0 get numframes]
for {set i 0} {$i < $n} {incr i} {
    # advance selection to the current frame and update.
    $sel frame $n
    $sel update
    set dipdata($i) [list [measure dipole $sel -debye -masscenter] [gets $dip]]
}
close $dip

# connect to vmd_frame
trace variable vmd_frame(0) w do_dipdraw
animate goto 0

I am not familiar with TCL language, so I was trying to modify the script given by axel's tutorial
Visualization and Analysis of Quantum Chemical and Molecular Dynamics Data with VMD