From: Brian Bennion (brian_at_youkai.llnl.gov)
Date: Wed Feb 11 2004 - 16:49:41 CST

Are the question marks supposed to be next the word residue?

On Wed, 11 Feb 2004, Kristy L. Mardis wrote:

> 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
>

*****************************************************************
**Brian Bennion, Ph.D. **
**Computational and Systems Biology Division **
**Biology and Biotechnology Research Program **
**Lawrence Livermore National Laboratory **
**P.O. Box 808, L-448 bennion1_at_llnl.gov **
**7000 East Avenue phone: (925) 422-5722 **
**Livermore, CA 94550 fax: (925) 424-6605 **
*****************************************************************