VMD-L Mailing List
From: Kristy L. Mardis (klmardis_at_wisc.edu)
Date: Wed Feb 11 2004 - 15:51:17 CST
- Next message: chris.harwell_at_pharma.novartis.com: "any body else have VMD problems with Linux + ATI FireGL X1-256p + fglrx-glc22-4.3.0-3.7.0"
- Previous message: Samartha G. Anekal: "xyz files and VMD 1.8.2"
- Next in thread: Brian Bennion: "Re: attempting to source a script"
- Reply: Brian Bennion: "Re: attempting to source a script"
- Reply: Tim Isgro: "Re: attempting to source a script"
- Reply: Oliver Beckstein: "Re: attempting to source a script"
- Reply: John Stone: "Re: attempting to source a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hello,
I've written a script to calculation the dot product between two vectors
defined by four atoms in my system. When I type the script in at the
command line, it works. However, when I take the same lines, put them in
a file and type
source dotprodmesi2.txt
dotprod
I get the error: usage: atomselect <command> [args...]
I've tried adding square brackets around the frame $iframe part of the
atomselect line, this results in the error: bad window path name "0"
I've attached the script below. If anyone has any hints/suggestions, I'd
appreciate it.
proc dotprod {} {
set fileId [open c:/testfoo.txt w 0600]
#get number of frames
set numframe [molinfo top get numframes]
#loop through the frames
for {set iframe 0} {$iframe < $numframe} {incr iframe} {
set ecoord1 [atomselect top "residue ESI and type C3" frame $iframe]
set ecoord2 [atomselect top “residue ESI and type C6" frame $iframe]
lassign [$ecoord1 get {x y z}] pos1
lassign [$ecoord2 get {x y z}] pos2
set esivec [vecsub $pos1 $pos2]
set nesivec [vecnorm $esivec]
set pcoord1 [atomselect top “residue PH1 and type C1" frame $iframe"]
set pcoord2 [atomselect top “residue PH1 and type C4" frame $iframe"]
lassign [$pcoord1 get {x y z}] pos3
lassign [$pcoord2 get {x y z}] pos4
set phivec [vecsub $pos3 $pos4]
set nphivec [vecnorm $phivec]
lassign [vecdot $nesivec $nphivec] vdot
puts $fileId “The dot product is $vdot”
}
close $fileId
}
Kristy
- Next message: chris.harwell_at_pharma.novartis.com: "any body else have VMD problems with Linux + ATI FireGL X1-256p + fglrx-glc22-4.3.0-3.7.0"
- Previous message: Samartha G. Anekal: "xyz files and VMD 1.8.2"
- Next in thread: Brian Bennion: "Re: attempting to source a script"
- Reply: Brian Bennion: "Re: attempting to source a script"
- Reply: Tim Isgro: "Re: attempting to source a script"
- Reply: Oliver Beckstein: "Re: attempting to source a script"
- Reply: John Stone: "Re: attempting to source a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]