translation + rotation of a whole scene

Hi list, I have a question about rotating and translating a bunch of models together while preserving their spatial relations. In particular, I would like to apply a matrix almost as in the matrixset command. THe difference is that I do not want to apply it individually to each model, but to one chosen models, while having the rest move together with the chosen model. Is that feasible in chimera? cheers, Nils

Hi Nils, Perhaps I am misunderstanding your question, but the movement commands such as move, turn, roll, ... move all the models together. Normally all models are movable ("activated for motion") but the activation status of each can be toggled using select/~select commands, or the Model Panel "Active" checkboxes, or the checkboxes under the Command Line. http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/ movies.html#moviecommands http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/mouse.html#activedef You can combine various motion commands with the select command to sequentially manipulate different subsets of the models. Here is a tiny example (commands): open 1zik open 1gcn open 6bna preset apply int 1 roll y 2 45 move x -1 25 move x 10; move y -10 ~select 0,1 move x 2 10 turn z 45 select 0,1 move y 1 25 Semicolon (;) is for stringing commands together when you don't want to see intermediate states. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On Jun 10, 2008, at 10:32 AM, Nils Becker wrote:
Hi list, I have a question about rotating and translating a bunch of models together while preserving their spatial relations. In particular, I would like to apply a matrix almost as in the matrixset command. THe difference is that I do not want to apply it individually to each model, but to one chosen models, while having the rest move together with the chosen model. Is that feasible in chimera? cheers, Nils

Hi Elaine, thanks for your answer. Sorry that I did not make my question clearer. I know that move, turn , roll etc. do move models together. However, this is not what I need. I need to specify a precise orientation and position of one of the molecule models, say #0, so that the view direction is exactly along a symmetry axis of that model. This orientation and position was generated externally and I have it available as a rotation matrix and translation vector, in the same format as that used by matrixset/matrixget. I could write the same matrix into a matrixset file N times for N models in the session. This however does not rotate the molecules together, but sets each one individually to the orientation and position needed only for model 1. is it possible to do that? Thanks! Nils Elaine Meng wrote:
Hi Nils, Perhaps I am misunderstanding your question, but the movement commands such as move, turn, roll, ... move all the models together. Normally all models are movable ("activated for motion") but the activation status of each can be toggled using select/~select commands, or the Model Panel "Active" checkboxes, or the checkboxes under the Command Line.
http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/movies.html#moviecommands http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/mouse.html#activedef
You can combine various motion commands with the select command to sequentially manipulate different subsets of the models.
Here is a tiny example (commands): open 1zik open 1gcn open 6bna preset apply int 1 roll y 2 45 move x -1 25 move x 10; move y -10 ~select 0,1 move x 2 10 turn z 45 select 0,1 move y 1 25
Semicolon (;) is for stringing commands together when you don't want to see intermediate states. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html
On Jun 10, 2008, at 10:32 AM, Nils Becker wrote:
Hi list, I have a question about rotating and translating a bunch of models together while preserving their spatial relations. In particular, I would like to apply a matrix almost as in the matrixset command. THe difference is that I do not want to apply it individually to each model, but to one chosen models, while having the rest move together with the chosen model. Is that feasible in chimera? cheers, Nils

Hi Nils, Perhaps it is the "matrixcopy" command that you need ... if "matrixset" was used to position your first model, say #0, then you could apply the same transformation to the others with commands like: matrixcopy #0 #1 matrixcopy 0 2 (the pound signs # are optional) http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/matrixcopy.html This command does not require a matrix to be in a file. It simply applies the transformation of one model to another. Again you can combine all the commands with semicolons to avoid seeing the intermediate stages. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On Jun 11, 2008, at 1:55 AM, Nils Becker wrote:
Hi Elaine,
thanks for your answer. Sorry that I did not make my question clearer. I know that move, turn , roll etc. do move models together. However, this is not what I need.
I need to specify a precise orientation and position of one of the molecule models, say #0, so that the view direction is exactly along a symmetry axis of that model. This orientation and position was generated externally and I have it available as a rotation matrix and translation vector, in the same format as that used by matrixset/matrixget.
I could write the same matrix into a matrixset file N times for N models in the session. This however does not rotate the molecules together, but sets each one individually to the orientation and position needed only for model 1.
is it possible to do that?
Thanks! Nils

Hi Nils, I don't think there is a Chimera command to achieve what you want. Attached is a Python script that will do it. You edit the transform at the top of the script then open the file in Chimera. Tom # # Set the transform of model #0 and move all other models to maintain their # relative orientations. # ts = ''' 0.51458 0.246952 0.82111 -4.96189 -0.296782 0.949732 -0.0996463 2.3135 -0.804443 -0.192415 0.562004 8.44621 ''' t = [float(x) for x in ts.split()] def set_transform(model_id, transform): from chimera import Xform, openModels as om xform = Xform.xform(*transform, **{'orthogonalize': True}) xform.multiply(om.list(id = model_id)[0].openState.xform.inverse()) for os in set([m.openState for m in om.list()]): os.globalXform(xform) set_transform(0, t)
participants (3)
-
Elaine Meng
-
Nils Becker
-
Tom Goddard