[Chimera-users] rotation matrices around a given center (Chimera-users Digest, Vol 62, Issue 3)

Jonathan Hilmer jkhilmer at gmail.com
Mon Jun 2 13:23:22 PDT 2008


I haven't tried it out, but it looks like all you have to do is apply
a transformation to your model before you apply the set of rotations.
You could create a set of matrices to do it all in one step, but
that's more trouble than it's worth.  Something like this should work:


Jonathan

###############################################
from chimera import openModels
from PDBmatrices import  chimera_xform
from Icosahedron import icosahedral_symmetry_matrices

icomats = icosahedral_symmetry_matrices(orientation = '222r')
centerRot = (161.,161.,161.)
tMat = ((1.0,0.0,0.0,-centerRot[0]), (0.0,1.0,0.0,-centerRot[1]),
(0.0,0.0,1.0,-centerRot[2]))

for rmat in icomats:
	m, = openModels.open('/dummy/dummy.pdb')   # open a copy of the model
	m.openState.xform = chimera_xform(tMat)   # set translation to for
center of rotation offset
	m.openState.xform = chimera_xform(rmat)       # set rotation
###############################################





On Mon, Jun 2, 2008 at 1:00 PM,  <chimera-users-request at cgl.ucsf.edu> wrote:
>   1. How to define a center of rotation when applying a        symmetry
>      (Giovanni Cardone)
>   2. Re: Volume viewer negative isosurface (Elaine Meng)
>   3. problem with opengl glx kubuntu (Fabian Glaser)
>   4. Re: OS X aqua version (Thomas Goddard)
>   5. Re: OS X aqua version (Eric Pettersen)
>   6. Re: problem with opengl glx kubuntu (Greg Couch)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 2 Jun 2008 12:18:25 -0400
> From: Giovanni Cardone <cardoneg at mail.nih.gov>
> Subject: [Chimera-users] How to define a center of rotation when
>        applying a      symmetry
> To: chimera-users at cgl.ucsf.edu
> Message-ID: <919BC0E8-98BD-4F1A-97DD-13F048B71C13 at mail.nih.gov>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> I would like to apply a rotation to a pdb model, in order to place
> copies of it in equivalent symmetry points (icosahedral symmetry).
> I am not sure I understand all the different coordinate systems in
> chimera, but digging into the program code, I was able to write the
> following script.
> I am not sure it is the best way to do it, and obviously at the
> moment it does not work properly, because I am not specifying the
> center of rotation.
> With respect to the coordinates of the pdb model, I know the center
> of symmetry, let's say (161,161,161), but I don't know how to impose it.
> I tried to assign these coordinates to the parameter 'cofr', but the
> result does not change.
> Does anyone know how to apply, inside a script, a rotation matrix
> around a given point?
> Any other feedback on the correctness of the script is very welcome.
>
> Thank you.
>
> Giovanni
>
>
>
> ###############################################
>
> from chimera import openModels, Point
>
> from PDBmatrices import  chimera_xform
>
> from Icosahedron import icosahedral_symmetry_matrices
>
>
> icomats = icosahedral_symmetry_matrices(orientation = '222r')
>
>
> for rmat in icomats:
>
>    xf = chimera_xform(rmat)
>
>    m, = openModels.open('/dummy/dummy.pdb')   # open a copy of the
> model
>
>    m.openState.xform = xf       # set rotation
>
> ###############################################
>
>
>
>
> =============================================
>    Giovanni Cardone
>    Laboratory of Structural Biology Research
>    National Institutes of Health
>    50 South Drive (Building 50), Room 1511
>    Bethesda, MD  20892-8025  USA
>
>    Tel:  (301) 451-8247
>    FAX:  (301) 480-7629
>    Giovanni_Cardone at nih.gov
> =============================================



More information about the Chimera-users mailing list