From: Jerry Ebalunode (jebalunode_at_uh.edu)
Date: Tue Sep 21 2004 - 11:27:15 CDT

Hi John,
sorry to bug you on this as I am still getiting the same error " non-numeric
in first arguement " when I run with the lindex in trying to get the
distances between tow atoms using vecdist. How should this be properly
combined with vecdist to work.

here is the tcl code I am currently using.

set outfile [open dist.dat w]

set sel3 [atomselect top "index 540" frame $i]
set sel4 [atomselect top "index 11056" frame $i]

set A [lindex [$sel1 get { x y z } ]]
set B [lindex [$sel2 get { x y z} ]]
set C [lindex [$sel3 get { x y z } ]]
set D [lindex [$sel4 get { x y z } ]]

set distA [ vecdist $A $B]
set distB [ vecdist $C $D]
puts outfile "$distA $distB "
close $outfile

 On Tuesday 21 September 2004 05:43 pm, Justin Gullingsrud wrote:
> VMD always wraps the result of a [$sel get { x y}] in another list,
> even if the list contains only one item. If you parse the result
> with:
>
> foreach elem [$sel get { x y }] {
> # do stuff with $elem
> }
>
> it will work no matter how many atoms are in $sel. Another way to go
> is to use lindex to get the first element of $A1 and $B1, which
> contain the vectors you expect.
>
> Justin
>
> On Tue, 21 Sep 2004 09:38:01 +0000, Jerry Ebalunode <jebalunode_at_uh.edu>
wrote:
> > Hi John,
> >
> > How do you correctly use the vecdist command to evaluate previously
> > declared variables? When I use it get distances between atoms, I get a
> > non-numeric in first arguement " error
> > see my vmd log below
> >
> > vmd > set i 0
> > 0
> > vmd > set sel1 [atomselect top "index 9469" frame $i]
> > atomselect40222
> > vmd > set sel2 [atomselect top "index 11057"]
> > atomselect40223
> > vmd > set A1 [$sel1 get { x y } ]
> > {-19.0349998474 6.21299982071}
> > vmd > set B1 [$sel2 get { x y } ]
> > {-16.7100009918 6.54000043869}
> > vmd > set distA [ vecdist $A1 $B1]
> > vecsub: non-numeric in first argument
> > vmd > vecdist $A1 $B1
> > vecsub: non-numeric in first argument
> >
> > --
> > Jerry Ebalunode
> > Ph.D. Candidate
> > RM 402F Houston Science Center
> > Phone: 713-743-8367
> > Dept. of Biology and Biochemistry
> > University of Houston
> > 4800 Calhoun Road
> > Houston, TX 77204

-- 
Jerry Ebalunode
Ph.D. Candidate
RM 402F Houston Science Center
Phone: 713-743-8367
Dept. of Biology and Biochemistry
University of Houston
4800 Calhoun Road
Houston, TX 77204