Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

moveby (vecadd) command

516 views
Skip to first unread message

Hanif

unread,
Jul 31, 2011, 12:09:57 PM7/31/11
to
Dear TCL users

"moveby" is a command based on "vecadd", which is used to shift
molecular coordinates in VMD.
In the following part of the tcl code, moveby generates this error:

atomselect moveby: non-numeric in vector

I wonder how this issue can be handled. I need to use the values of
some variables in "mobeby" command.

Regards,

Hanif


for {set countx 1} {$countx <= $segnum} {incr countx} {
for {set county 1} {$county <= $segnum} {incr county} {
for {set countz 1} {$countz <= $segnum} {incr countz} {
set segid P$countx$county$countz
segment $segid {

set offx [expr $countx*$driftx]
set offy [expr $county*$drifty]
set offz [expr $countz*$driftz]

$fsfg moveby {$offx $offy $offz}
$fsfg writepdb fsfg_shift_temp.pdb
pdb fsfg_shift_temp.pdb
}

coordpdb fsfg_shift_temp.pdb $segid
}
}
}

Gerald W. Lester

unread,
Jul 31, 2011, 8:33:31 PM7/31/11
to Hanif
On 7/31/11 11:09 AM, Hanif wrote:
> Dear TCL users
>
> "moveby" is a command based on "vecadd", which is used to shift
> molecular coordinates in VMD....

Neither "moveby" not "vecadd" are Tcl built in commands. I'm guessing that
they are furnished by your VMD program/package.

Most of us on this newsgroup do not use VMD (whatever that is) but use Tcl
for a variety of other tasks.

I suggest that you post the question to a VMD user's group or to whomever
offers VMD support.

That being said, does the following changes to your code make it work:

for {set countx 1} {$countx <= $segnum} {incr countx} {
for {set county 1} {$county <= $segnum} {incr county} {
for {set countz 1} {$countz <= $segnum} {incr countz} {
set segid P$countx$county$countz
segment $segid {

set offx [expr {$countx*$driftx}]
set offy [expr {$county*$drifty}]
set offz [expr {$countz*$driftz}]

$fsfg moveby [list $offx $offy $offz]


$fsfg writepdb fsfg_shift_temp.pdb
pdb fsfg_shift_temp.pdb
}

coordpdb fsfg_shift_temp.pdb $segid
}
}
}

--
+------------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+------------------------------------------------------------------------+

Simon

unread,
Aug 1, 2011, 9:47:18 AM8/1/11
to
On 31/07/2011 17:09, Hanif wrote:
> Dear TCL users
>
> "moveby" is a command based on "vecadd", which is used to shift
> molecular coordinates in VMD.
> In the following part of the tcl code, moveby generates this error:
>
> atomselect moveby: non-numeric in vector
>
This doesn't look like a tcl error message. Having found this with
Google: http://www.ks.uiuc.edu/Research/vmd/vmd-1.3/ug/node206.html I
see that "vecadd" was an extension written to improve arithemetic
performance so you probably need to look at the extension code. Of
course it might simply be that you've called a function with an alpha
character rather than a digit.

Simon

0 new messages