Understanding the output of the align command

Hi, I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding. For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following: *Axis 0.11 -0.018 0.99Axis point 166 190 0Rotation angle (degrees) 108Shift along axis -0.24* I would think my turn command should be *turn 0.11,-0.018,0.99 108 models #1 center 166,190,0* But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108. I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command? Many thanks in advance, I hope explained this clearly. Best, Yazan

Hi Yazan, I’d recommend instead using fitting (e.g. “fitmap” command or “Fit in Map” tool) to make the map align to the atomic model(s) as needed once you’ve moved them to different positions, or if the map and atoms are already aligned, just always move them together rather than separately. I.e. if you’re rotating, why not move both the atomic and map models in the same rotation command (“turn” or “roll”)?? You can save each set of model positions with command “view name” and then later (in the movie script) use “view” to reset to the previously saved positions over multiple frames. The positions are saved in sessions so you can set it all up ahead of time before running the script of the movie part. <http://rbvi.ucsf.edu/chimerax/docs/user/commands/fitmap.html> <http://rbvi.ucsf.edu/chimerax/docs/user/movies.html> <http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#name> Personally I wouldn’t even try to deal with matrices. It is much too confusing (at least to me) and depends on the map and atom coordinates already being fit to each other before you open them. Note, however, there is also a “view matrix” command to apply a tranformation matrix, which might make it slightly less confusing than trying to apply it with other commands. <http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#matrix> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 13, 2019, at 3:34 PM, Yazan Abbas <yazan.abbas@gmail.com> wrote:
Hi, I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding.
For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following:
Axis 0.11 -0.018 0.99 Axis point 166 190 0 Rotation angle (degrees) 108 Shift along axis -0.24
I would think my turn command should be
turn 0.11,-0.018,0.99 108 models #1 center 166,190,0
But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108.
I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command? Many thanks in advance, I hope explained this clearly. Best, Yazan

Hi Elaine, What I am actually doing is making a movie showing a morph between different atomic coordinates. There is unmodelled density that I wish to move/rotate along the same trajectory that one of the chains is moving. I found that using the turn or roll command to move the density alongside the coordset command which shows the model morph works well enough. However, turn or roll around the y axis is not as precise as an axis of rotation that is determined by the align command, which is what I am trying to achieve. Best, Yazan On Tue, Aug 13, 2019 at 6:51 PM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Yazan, I’d recommend instead using fitting (e.g. “fitmap” command or “Fit in Map” tool) to make the map align to the atomic model(s) as needed once you’ve moved them to different positions, or if the map and atoms are already aligned, just always move them together rather than separately. I.e. if you’re rotating, why not move both the atomic and map models in the same rotation command (“turn” or “roll”)??
You can save each set of model positions with command “view name” and then later (in the movie script) use “view” to reset to the previously saved positions over multiple frames. The positions are saved in sessions so you can set it all up ahead of time before running the script of the movie part.
<http://rbvi.ucsf.edu/chimerax/docs/user/commands/fitmap.html> <http://rbvi.ucsf.edu/chimerax/docs/user/movies.html> <http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#name>
Personally I wouldn’t even try to deal with matrices. It is much too confusing (at least to me) and depends on the map and atom coordinates already being fit to each other before you open them. Note, however, there is also a “view matrix” command to apply a tranformation matrix, which might make it slightly less confusing than trying to apply it with other commands. <http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#matrix>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 13, 2019, at 3:34 PM, Yazan Abbas <yazan.abbas@gmail.com> wrote:
Hi, I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding.
For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following:
Axis 0.11 -0.018 0.99 Axis point 166 190 0 Rotation angle (degrees) 108 Shift along axis -0.24
I would think my turn command should be
turn 0.11,-0.018,0.99 108 models #1 center 166,190,0
But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108.
I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command? Many thanks in advance, I hope explained this clearly. Best, Yazan

Hi Yazan, Each model has its own coordinate system, and there is the global coordinate system of the scene. If you haven't moved any of the models (by aligning, match maker, fitting, move selected mouse mode, move command with models option, ...) then all those coordinates match up. If you have moved some models and then you want to apply a rotation you have to know 1) what coordinate system you got the rotation axis and angle for, and 2) what coordinate system you are using when you apply the rotation. For 1) you are using the align command to get the rotation. You didn't include the relevant output from the align command in your post where it says the matrix is in the coordinate system of the first model in the align command. You then try to apply that with the turn command and since you didn't specify a coordinate system it is using the scene coordinates. Obviously that is not going to work if the first model in the align command was already moved and has a different coordinate system than the scene coordinates. You could specify the coordinate system in the turn command (option "coordinateSystem #1") which says what coordinate system the rotation axis and center point are in. But I'm with Elaine, you are trying to do something too tricky, and you are going to have to know exactly what you are doing, including the above multiple coordinate system details to get it to work. You might find the "view position #3 sameAs #1" command to be useful -- it moves model #3 to have the same coordinate system as model #1. So if #3 is something you want to move along with model #1 you can keep executing that command to make them track each other. There are other tricks, like you could make model #3 a submodel of #1 so it automatically is dragged along with model #1. Tom
On Aug 13, 2019, at 3:34 PM, Yazan Abbas <yazan.abbas@gmail.com> wrote:
Hi,
I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding.
For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following:
Axis 0.11 -0.018 0.99 Axis point 166 190 0 Rotation angle (degrees) 108 Shift along axis -0.24
I would think my turn command should be
turn 0.11,-0.018,0.99 108 models #1 center 166,190,0
But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108.
I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command?
Many thanks in advance, I hope explained this clearly.
Best,
Yazan
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thanks Tom, You are right, I did miss the part of the output where it tells me which coordinate system it is using. Cheers, Yazan On Tue, Aug 13, 2019 at 7:44 PM Tom Goddard <goddard@sonic.net> wrote:
Hi Yazan,
Each model has its own coordinate system, and there is the global coordinate system of the scene. If you haven't moved any of the models (by aligning, match maker, fitting, move selected mouse mode, move command with models option, ...) then all those coordinates match up. If you have moved some models and then you want to apply a rotation you have to know 1) what coordinate system you got the rotation axis and angle for, and 2) what coordinate system you are using when you apply the rotation. For 1) you are using the align command to get the rotation. You didn't include the relevant output from the align command in your post where it says the matrix is in the coordinate system of the first model in the align command. You then try to apply that with the turn command and since you didn't specify a coordinate system it is using the scene coordinates. Obviously that is not going to work if the first model in the align command was already moved and has a different coordinate system than the scene coordinates. You could specify the coordinate system in the turn command (option "coordinateSystem #1") which says what coordinate system the rotation axis and center point are in.
But I'm with Elaine, you are trying to do something too tricky, and you are going to have to know exactly what you are doing, including the above multiple coordinate system details to get it to work.
You might find the "view position #3 sameAs #1" command to be useful -- it moves model #3 to have the same coordinate system as model #1. So if #3 is something you want to move along with model #1 you can keep executing that command to make them track each other. There are other tricks, like you could make model #3 a submodel of #1 so it automatically is dragged along with model #1.
Tom
On Aug 13, 2019, at 3:34 PM, Yazan Abbas <yazan.abbas@gmail.com> wrote:
Hi,
I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding.
For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following:
*Axis 0.11 -0.018 0.99Axis point 166 190 0Rotation angle (degrees) 108Shift along axis -0.24*
I would think my turn command should be
*turn 0.11,-0.018,0.99 108 models #1 center 166,190,0*
But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108.
I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command?
Many thanks in advance, I hope explained this clearly.
Best,
Yazan
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Hi Tom, The view position #3 sameAs #1 command worked perfectly, thanks for letting me know about it! Best, Yazan On Tue, Aug 13, 2019 at 7:44 PM Tom Goddard <goddard@sonic.net> wrote:
Hi Yazan,
Each model has its own coordinate system, and there is the global coordinate system of the scene. If you haven't moved any of the models (by aligning, match maker, fitting, move selected mouse mode, move command with models option, ...) then all those coordinates match up. If you have moved some models and then you want to apply a rotation you have to know 1) what coordinate system you got the rotation axis and angle for, and 2) what coordinate system you are using when you apply the rotation. For 1) you are using the align command to get the rotation. You didn't include the relevant output from the align command in your post where it says the matrix is in the coordinate system of the first model in the align command. You then try to apply that with the turn command and since you didn't specify a coordinate system it is using the scene coordinates. Obviously that is not going to work if the first model in the align command was already moved and has a different coordinate system than the scene coordinates. You could specify the coordinate system in the turn command (option "coordinateSystem #1") which says what coordinate system the rotation axis and center point are in.
But I'm with Elaine, you are trying to do something too tricky, and you are going to have to know exactly what you are doing, including the above multiple coordinate system details to get it to work.
You might find the "view position #3 sameAs #1" command to be useful -- it moves model #3 to have the same coordinate system as model #1. So if #3 is something you want to move along with model #1 you can keep executing that command to make them track each other. There are other tricks, like you could make model #3 a submodel of #1 so it automatically is dragged along with model #1.
Tom
On Aug 13, 2019, at 3:34 PM, Yazan Abbas <yazan.abbas@gmail.com> wrote:
Hi,
I am trying to make a movie to rotate density in a manner that follows rotation between two atomic coordinates. To do that, I am aligning the two models and using the reportMatrix output to inform turn and move commands in order to transform the density. However, I am encountering some difficulty, and I'm not sure if this is related to bugs or my lack of understanding.
For example, if I want to move from the position of model #1 to model #2, "align #1/b toAtoms #2/b move nothing reportMatrix true" produces the following:
*Axis 0.11 -0.018 0.99Axis point 166 190 0Rotation angle (degrees) 108Shift along axis -0.24*
I would think my turn command should be
*turn 0.11,-0.018,0.99 108 models #1 center 166,190,0*
But that doesn't work. I can get it to work if I assume that the reported axis is x,z,y instead of the expected x,y,z. Also, I have to use a rotation angle of -108 instead of 108.
I'm not sure if I am using the axis point value correctly though, is it correct to use that as my center of rotation? It's location (166, 190, 0) places at the top of the box, which seems unusual to me. And finally, would I use this same information in a move command (i.e. move axis distance(shift), as reported by the align command?
Many thanks in advance, I hope explained this clearly.
Best,
Yazan
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Tom Goddard
-
Yazan Abbas