view and the center of mass of the selection

Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico

Just look at the help for the "turn" command... it has a "center" option that lets you specify the center of rotation to use during the turn. The "center" can be given in several ways, including as x,y,z. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/turn.html> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/pointspec.html#point> Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 18, 2022, at 3:28 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico

Thank you Elaine! I did it like this: # calculate com for the ligand define centroid ligand name lig_com # then view the new model of the centroid view #1.1.3 orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 wait one question: I have not found a way to use the "view" with the name of the model "lig_com", always operating with the model number (#1.1.3). May I use "lig_com" for the same operation? Cheers Enrico вт, 18 янв. 2022 г. в 19:45, Elaine Meng <meng@cgl.ucsf.edu>:
Just look at the help for the "turn" command... it has a "center" option that lets you specify the center of rotation to use during the turn. The "center" can be given in several ways, including as x,y,z.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/turn.html> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/pointspec.html#point>
Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 18, 2022, at 3:28 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico

Sorry no, you cannot use the centroid model name in the turn command. However, you could make the centroid a named selection using the "name" command. That selector name should not have an underscore character, however. It could have a hyphen, as in this example: name lig-com #1.1.3 turn y 30 center lig-com color lig-com white hide lig-com If you use that approach, you would still have to put the model number one time in the script, but then all the other places can use the name of the named selection. name command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html> By the way, instead of making a centroid model, you could just use "ligand" or any other specification of multiple atoms as the center in the turn command. This was mentioned in the help links I sent you in the previous message below. However, the rotation will use the center of the bounding box of those atoms rather than the geometric centroid. If that is good enough, however, it could save you some steps. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 19, 2022, at 3:33 AM, Enrico Martinez <jmsstarlight@gmail.com> wrote:
Thank you Elaine! I did it like this:
# calculate com for the ligand define centroid ligand name lig_com # then view the new model of the centroid view #1.1.3 orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 wait
one question: I have not found a way to use the "view" with the name of the model "lig_com", always operating with the model number (#1.1.3). May I use "lig_com" for the same operation? Cheers Enrico
вт, 18 янв. 2022 г. в 19:45, Elaine Meng <meng@cgl.ucsf.edu>:
Just look at the help for the "turn" command... it has a "center" option that lets you specify the center of rotation to use during the turn. The "center" can be given in several ways, including as x,y,z.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/turn.html> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/pointspec.html#point>
Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 18, 2022, at 3:28 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico

You could avoid the model number entirely by making the first line: name lig-com ##name=lig_com "##name=lig_com" equates to "the model whose 'name' attribute is 'lig_com'". --Eric Eric Pettersen UCSF Computer Graphics Lab
On Jan 19, 2022, at 12:32 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Sorry no, you cannot use the centroid model name in the turn command.
However, you could make the centroid a named selection using the "name" command. That selector name should not have an underscore character, however. It could have a hyphen, as in this example:
name lig-com #1.1.3 turn y 30 center lig-com color lig-com white hide lig-com
If you use that approach, you would still have to put the model number one time in the script, but then all the other places can use the name of the named selection.
name command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html>
By the way, instead of making a centroid model, you could just use "ligand" or any other specification of multiple atoms as the center in the turn command. This was mentioned in the help links I sent you in the previous message below. However, the rotation will use the center of the bounding box of those atoms rather than the geometric centroid. If that is good enough, however, it could save you some steps.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 19, 2022, at 3:33 AM, Enrico Martinez <jmsstarlight@gmail.com> wrote:
Thank you Elaine! I did it like this:
# calculate com for the ligand define centroid ligand name lig_com # then view the new model of the centroid view #1.1.3 orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 wait
one question: I have not found a way to use the "view" with the name of the model "lig_com", always operating with the model number (#1.1.3). May I use "lig_com" for the same operation? Cheers Enrico
вт, 18 янв. 2022 г. в 19:45, Elaine Meng <meng@cgl.ucsf.edu>:
Just look at the help for the "turn" command... it has a "center" option that lets you specify the center of rotation to use during the turn. The "center" can be given in several ways, including as x,y,z.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/turn.html> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/pointspec.html#point>
Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 18, 2022, at 3:28 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thank you very much! Actually I had to to it for "view" command: # 1.1.3 corresponds to the centroid of the ligand: view #1.1.3 orient clip false; so the below commands works either very well! name lig-com #1.1.3 view lig-com orient clip false; thank you very much again! Cheers Enrico ср, 19 янв. 2022 г. в 22:17, Eric Pettersen <pett@cgl.ucsf.edu>:
You could avoid the model number entirely by making the first line:
name lig-com ##name=lig_com
"##name=lig_com" equates to "the model whose 'name' attribute is 'lig_com'".
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Jan 19, 2022, at 12:32 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Sorry no, you cannot use the centroid model name in the turn command.
However, you could make the centroid a named selection using the "name" command. That selector name should not have an underscore character, however. It could have a hyphen, as in this example:
name lig-com #1.1.3 turn y 30 center lig-com color lig-com white hide lig-com
If you use that approach, you would still have to put the model number one time in the script, but then all the other places can use the name of the named selection.
name command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html>
By the way, instead of making a centroid model, you could just use "ligand" or any other specification of multiple atoms as the center in the turn command. This was mentioned in the help links I sent you in the previous message below. However, the rotation will use the center of the bounding box of those atoms rather than the geometric centroid. If that is good enough, however, it could save you some steps.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 19, 2022, at 3:33 AM, Enrico Martinez <jmsstarlight@gmail.com> wrote:
Thank you Elaine! I did it like this:
# calculate com for the ligand define centroid ligand name lig_com # then view the new model of the centroid view #1.1.3 orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 wait
one question: I have not found a way to use the "view" with the name of the model "lig_com", always operating with the model number (#1.1.3). May I use "lig_com" for the same operation? Cheers Enrico
вт, 18 янв. 2022 г. в 19:45, Elaine Meng <meng@cgl.ucsf.edu>:
Just look at the help for the "turn" command... it has a "center" option that lets you specify the center of rotation to use during the turn. The "center" can be given in several ways, including as x,y,z.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/turn.html> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/pointspec.html#point>
Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 18, 2022, at 3:28 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX users! I am using view command to center the camera on the ligand an then, to rotate th whole system to the desired position: view #1.1 & ligand orient clip false; turn z 90; turn y 45; turn x -90; turn x 77 may I rather center the camera on the center of mass of the ligand calculated using measure center ligand If so, how may I combine the both commands together? Thank you in advance! Enrico
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Enrico Martinez
-
Eric Pettersen