From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Feb 19 2013 - 10:07:23 CST

On Tue, Feb 19, 2013 at 3:45 PM, Rebeca García Fandiño
<regafan_at_hotmail.com> wrote:
> Hello,
> I am trying to rotate a part of an assembled molecule, consisting on several
> residues, so I want to rotate only one of these residues, for example,
> residue 10. I have tried different combinations:
>
> set sel [atomselect top "resid 10"]
> $sel rotate z by 45
>
> $sel [rotate z by 45]
>
> $sel rotate [z by 45]
>
> But I always get errors.

yes, because none of this is not a supported syntax. please have a look at:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node121.html

> By the other hand, when I have tried to rotate the whole molecule
>
> set sel [atomselect top "resid 10"]
> rotate z by 45
>
> It works, but when I try to write the coordinates using:
>
> $sel writepdb file.pdb
>
> they are identical to the first ones!

yes, because the rotate command rotates the *view* (i.e. the camera),
it doesn't change the coordinates. please check out:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node146.html

what you need is:

$sel move $matrix

and the rotation matrix can be computed beforehand with:

set matrix [transaxis z 45]

check out:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node191.html

HTH,
   axel.

> Please, could anyone help me to rotate a selection in a molecule and to save
> its rotated coordinates?

> Thanks a lot for your help in advance.
>
> Best wishes,
>
> Rebeca.
>
>
>
>
> Dr Rebeca García
> Universidad de Santiago de Compostela
> Spain
>
>

--
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
International Centre for Theoretical Physics, Trieste. Italy.