From: McGuire, Kelly (
Date: Fri Apr 27 2018 - 09:08:41 CDT

Well, that did it, thank you Norman!

Kelly L. McGuire

PhD Scholar

Department of Physiology and Developmental Biology

Brigham Young University

LSB 3050

Provo, UT 84602

From: Norman Geist <>
Sent: Friday, April 27, 2018 1:07:09 AM
To: McGuire, Kelly
Subject: AW: vmd-l: Measure Distance Script Question

Well, I donít know the notation you used for closing the output files. Therefore if they are not properly closed, it would explain why the end of the file is truncated.


close $output

close $output2

close $output3

instead of:

$output close

$output2 close

$output3 close

Best wishes

Norman Geist

Von: [] Im Auftrag von McGuire, Kelly
Gesendet: Freitag, 27. April 2018 06:28
An: VMD Mailing LIst <>
Betreff: vmd-l: Measure Distance Script Question

My script for measuring the distance between two residues at three different points

on the protein for every frame in the trajectory works great, except for one thing. I have

1,667 frames in the trajectory, but the three files with those distances stop at 1,545,

1,535, and 1,530 frames. Any idea why all 1,667 aren't being written to my files? Here

is the code:

set A [atomselect top "resname HSP and segname XP3"]

set B [atomselect top "resname HSE and segname XP4"]

set C [atomselect top "resname ASP and segname XP3"]

set D [atomselect top "resname ASP and segname XP4"]

set E [atomselect top "resname VAL and segname XP3"]

set F [atomselect top "resname VAL and segname XP4"]

set numframes [molinfo top get numframes]

set output [open "HSPtoHSE.dat" w]

set output2 [open "ASPtoASP.dat" w]

set output3 [open "VALtoVAL.dat" w]

puts $output "Frame\tDistance"

puts $output2 "Frame\tDistance"

puts $output3 "Frame\tDistance"

for {set i 0} {$i < $numframes} {incr i} {

     set distance [veclength [vecsub [lindex [$A get {x y z}] 0] [lindex [$B get {x y z}] 0] ] ]

set distance2 [veclength [vecsub [lindex [$C get {x y z}] 0] [lindex [$D get {x y z}] 0] ] ]

set distance3 [veclength [vecsub [lindex [$E get {x y z}] 0] [lindex [$F get {x y z}] 0] ] ]

     puts $output "$i\t$distance"

puts $output2 "$i\t$distance2"

puts $output3 "$i\t$distance3"

     animate goto $i


$output close

$output2 close

$output3 close

$A delete

$B delete

$C delete

$D delete

$E delete

$F delete

unset numframes

unset output

Kelly L. McGuire