Re: [Chimera-users] Changing threshold value of attributes
Hi Abril, There are separate mailing list for Chimera and ChimeraX, so you should send ChimeraX questions to chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> . The problem you ran into has been fixed and the fix is in the 1.7 release candidate, so if you use that then things will work. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Nov 28, 2023, at 10:25 AM, Abril Gijsbers via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Dear community,
I want to render my model by attribute and change the thresholds (up and bottom limits). I want to change the 0.3 to 0.1 and the 2.6 to 2.7 (see the figure), this way I can compare the colour intensity with other conditions. <image.png>
When I do that, I get the following error. My ignorance in command use limits my understanding. Could someone help me out to understand this? I have a colleague that changes the up and bottom limit with no problem. Why? :(
ui tool show <> "Render By Attribute" Traceback (most recent call last): File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 759, in _set_value_cb self._redraw_cb() File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 646, in _redraw_cb self._bins = left + filled_bins + right ValueError: operands could not be broadcast together with shapes (0,) (157,)
ValueError: operands could not be broadcast together with shapes (0,) (157,)
File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 646, in _redraw_cb self._bins = left + filled_bins + right
See log for complete Python traceback.
Traceback (most recent call last): File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 760, in _set_value_cb self._move_cur_marker(v) File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 570, in _move_cur_marker self._active_markers._update_plot() File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1222, in _update_plot self._update_marker_coordinates() File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1207, in _update_marker_coordinates x, y = self._scene_xy(m.xy) File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1090, in _scene_xy return self.histogram._scene_xy(abs_xy) File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 512, in _scene_xy num_bins = len(self._bins) TypeError: object of type 'function' has no len()
TypeError: object of type 'function' has no len()
File "/Applications/ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 512, in _scene_xy num_bins = len(self._bins)
See log for complete Python traceback. _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
THank you! On Tue, Nov 28, 2023 at 12:53 PM Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Hi Abril, There are separate mailing list for Chimera and ChimeraX, so you should send ChimeraX questions to chimerax-users@cgl.ucsf.edu . The problem you ran into has been fixed and the fix is in the 1.7 release candidate, so if you use that then things will work.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Nov 28, 2023, at 10:25 AM, Abril Gijsbers via Chimera-users < chimera-users@cgl.ucsf.edu> wrote:
Dear community,
I want to render my model by attribute and change the thresholds (up and bottom limits). I want to change the 0.3 to 0.1 and the 2.6 to 2.7 (see the figure), this way I can compare the colour intensity with other conditions. <image.png>
When I do that, I get the following error. My ignorance in command use limits my understanding. Could someone help me out to understand this? I have a colleague that changes the up and bottom limit with no problem. Why? :(
ui tool show "Render By Attribute" Traceback (most recent call last): File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 759, in _set_value_cb self._redraw_cb() File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 646, in _redraw_cb self._bins = left + filled_bins + right ValueError: operands could not be broadcast together with shapes (0,) (157,)
ValueError: operands could not be broadcast together with shapes (0,) (157,)
File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 646, in _redraw_cb self._bins = left + filled_bins + right
*See log for complete Python traceback.*
Traceback (most recent call last): File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 760, in _set_value_cb self._move_cur_marker(v) File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 570, in _move_cur_marker self._active_markers._update_plot() File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1222, in _update_plot self._update_marker_coordinates() File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1207, in _update_marker_coordinates x, y = self._scene_xy(m.xy) File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 1090, in _scene_xy return self.histogram._scene_xy(abs_xy) File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 512, in _scene_xy num_bins = len(self._bins) TypeError: object of type 'function' has no len()
TypeError: object of type 'function' has no len()
File "/Applications/ ChimeraX-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py <http://chimerax-1.6.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/ui/widgets/histogram.py>", line 512, in _scene_xy num_bins = len(self._bins)
*See log for complete Python traceback.* _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
Dear Chimera, I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0. What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place? i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model what would be the volume coordinates to use in the command volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz. To go from one set of coordinates to the other I have tried: MapCoord = (ModelCoord - Orig) / Mapvsize and MapCoord = (ModelCoord /Mapvsize) - Orig None seems to extract the volume at the right place. The first one seems closer (??) Thanks Hernando
Hi Hernando, Please see previous answer on the chimerax-users list (which mentions both Chimera and ChimeraX). <https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/message/ADCRCKYI4IIJLY4GK6GODJA3YWRW74E6/> I should also mention you could consider drawing the region box interactively with the mouse in either program. In Chimera you could use the "Subregion selection" feature in the Volume Viewer dialog: <https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/volumeviewer.html#mouseselect> In ChimeraX it is done with the "crop" mouse mode, which you can assign to the right mouse button by clicking the crop icon in the Right Mouse tab of the toolbar: <https://rbvi.ucsf.edu/chimerax/docs/user/tools/mousemodes.html> In ChimeraX when you crop with the mouse it will report the equivalent command in the Log, which includes the region specification. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 2, 2024, at 1:41 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
HI Elaine, Thanks but I do need to make a rectangular submap and need to do it within a script (i.e. not using the GUI Subregion selection). The script so far reads the coordinates from the model and the map information (step, origin, etc) Thanks Hernando ___________________________________ Hernando Sosa, PhD. Dept. of Biochemistry Albert Einstein College of Medicine 1300 Morris Park Av. Bronx NY 10461 phone (718) 430-3456 emai: hernando.sosa@einsteinmed.<mailto:hernando.sosa@einsteinmed.org>edu ___________________________________ ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, January 2, 2024 5:17 PM To: Hernando J Sosa <hernando.sosa@einsteinmed.edu> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Sub Volume map CAUTION: This email comes from an external source; the attachments and/or links may compromise our secure environment. Do not open or click on suspicious emails. Please click on the “Phish Alert” button on the top right of the Outlook dashboard to report any suspicious emails. Hi Hernando, Please see previous answer on the chimerax-users list (which mentions both Chimera and ChimeraX). <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimera-users%40cgl.ucsf.edu%2Fmessage%2FADCRCKYI4IIJLY4GK6GODJA3YWRW74E6%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DAN1%2B5y4oxlnYBPuuYS6xp17l%2B1etDNohtHj7L0TWMY%3D&reserved=0<https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/message/ADCRCKYI4IIJLY4GK6GODJA3YWRW74E6/>> I should also mention you could consider drawing the region box interactively with the mouse in either program. In Chimera you could use the "Subregion selection" feature in the Volume Viewer dialog: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimera%2Fdocs%2FContributedSoftware%2Fvolumeviewer%2Fvolumeviewer.html%23mouseselect&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PLVAmSIS8uibPh8BZ45NfAIcKcETwcL7NMtGXwhioEg%3D&reserved=0<https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/volumeviewer.html#mouseselect>> In ChimeraX it is done with the "crop" mouse mode, which you can assign to the right mouse button by clicking the crop icon in the Right Mouse tab of the toolbar: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Ftools%2Fmousemodes.html&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bBiVZ%2FmOgBufRVH9q6DPeN2lCavKMVI1NlUog81y53A%3D&reserved=0<https://rbvi.ucsf.edu/chimerax/docs/user/tools/mousemodes.html>> In ChimeraX when you crop with the mouse it will report the equivalent command in the Log, which includes the region specification. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 2, 2024, at 1:41 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lWtILVWzOsW1XyGEzUtS9SBkdWoyMIyuHBTew7GKzkg%3D&reserved=0<https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/>
As mentioned, (1) Chimera Volume Viewer does not give you the map origin xyz coordinates (that you need for your first equation) directly, it only gives the map grid indices that fall at coordinates 0,0,0. So you would have to do another calculation to get the map origin xyz coordinates. Further, consider that the map origin has grid indices 1,1,1 not 0,0,0. I'm not sure about the equation to convert the above, but here is the easy way: (2) If you use ChimeraX command "volume settings" it will actually tell you the map origin xyz coordinates. Elaine
On Jan 2, 2024, at 2:34 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
HI Elaine,
Thanks but I do need to make a rectangular submap and need to do it within a script (i.e. not using the GUI Subregion selection). The script so far reads the coordinates from the model and the map information (step, origin, etc)
Thanks
Hernando
___________________________________ Hernando Sosa, PhD. Dept. of Biochemistry Albert Einstein College of Medicine 1300 Morris Park Av. Bronx NY 10461 phone (718) 430-3456 emai: hernando.sosa@einsteinmed.edu ___________________________________
From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, January 2, 2024 5:17 PM To: Hernando J Sosa <hernando.sosa@einsteinmed.edu> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Sub Volume map
CAUTION: This email comes from an external source; the attachments and/or links may compromise our secure environment. Do not open or click on suspicious emails. Please click on the “Phish Alert” button on the top right of the Outlook dashboard to report any suspicious emails.
Hi Hernando, Please see previous answer on the chimerax-users list (which mentions both Chimera and ChimeraX). <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimera-users%40cgl.ucsf.edu%2Fmessage%2FADCRCKYI4IIJLY4GK6GODJA3YWRW74E6%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DAN1%2B5y4oxlnYBPuuYS6xp17l%2B1etDNohtHj7L0TWMY%3D&reserved=0>
I should also mention you could consider drawing the region box interactively with the mouse in either program.
In Chimera you could use the "Subregion selection" feature in the Volume Viewer dialog: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimera%2Fdocs%2FContributedSoftware%2Fvolumeviewer%2Fvolumeviewer.html%23mouseselect&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PLVAmSIS8uibPh8BZ45NfAIcKcETwcL7NMtGXwhioEg%3D&reserved=0>
In ChimeraX it is done with the "crop" mouse mode, which you can assign to the right mouse button by clicking the crop icon in the Right Mouse tab of the toolbar: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Ftools%2Fmousemodes.html&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bBiVZ%2FmOgBufRVH9q6DPeN2lCavKMVI1NlUog81y53A%3D&reserved=0>
In ChimeraX when you crop with the mouse it will report the equivalent command in the Log, which includes the region specification.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 2, 2024, at 1:41 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lWtILVWzOsW1XyGEzUtS9SBkdWoyMIyuHBTew7GKzkg%3D&reserved=0
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
Hi Hernando, The ChimeraX "volume zone" command or the Chimera "vop zone" command has an option minimalBounds that may do exactly what you want. It crops the rectangular bounds of a map to fit an atomic model. https://www.cgl.ucsf.edu/chimerax/docs/user/commands/volume.html#zone https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/vop.html#zone For example in ChimeraX open 1a0m open 1a0m from eds volume zone #2 near #1/A range 3 minimalBounds true save croppedmap.mrc model #2 The volume zone command also hides the part of the map contour surface far from the atoms, but you can save the cropped map to an MRC file and it has all the density in the full subbox containing the atoms. To answer your original question though, there are different origins for maps as Elaine mentioned (in grid index units or physical coordinates), and there are different coordinate systems for your fit atomic model and map. So if you want to see the actual Python code that does what the volume zone minimalBounds option does which involves converting the atom coordinates into the volume grid index coordinate system I can provide that. But we really need to work with specific code, not ambiguous terms like "origin" and "coordinates" which have various possible meanings. So show me some Python code of what you are doing, or I can provide some simple Python code example if the above minimalBounds option doesn't already do what you want. Tom 
On Jan 2, 2024, at 1:41 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
Hi Hernando, Elaine, Here's a little more detail. The "origin index" of a volume as reported by the "volume settings" command is the volume grid index (i,j,k) that corresponds to physical x,y,z volume coordinates x,y,z = (0.0, 0.0, 0.0). The grid indices start at 0 (not 1), so a map of size 100 in each dimension has grid indices 0 to 99 in each dimension. The "origin" value reported by "volume settings" is related but different -- it is the physical x,y,z volume coordinates for grid index (i,j,k) = 0,0,0, ie for the lower left front corner of the volume box. If you have an atomic model that was moved to fit into the map you can ask for its atom positions in Python using xyz = atoms.coords where atoms is a collection of atoms. But those coordinates are in the atomic model's coordinate system, which is not the same as the volume coordinate system since the atomic model was moved. You can also ask for the atom coordinates in scene coordinate system xyz = atoms.scene_coords If the volume has not been moved then those will match the volume x,y,z coordinates. But if the volume is moved then those would would have to be transformed to get coordinates in the volume coordinate system with Python code like: xyz = volume.scene_position.inverse() * atoms.scene_coords And if you actually wanted volume grid index coordinates those would have to be transformed like xyz = volume.data.xyz_to_ijk_transform * volume.scene_position.inverse() * atoms.scene_coords So the bottom line is you there are many coordinate systems involved and a fair bit to know in order to correctly transform between them. Tom
On Jan 2, 2024, at 2:54 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
As mentioned,
(1) Chimera Volume Viewer does not give you the map origin xyz coordinates (that you need for your first equation) directly, it only gives the map grid indices that fall at coordinates 0,0,0. So you would have to do another calculation to get the map origin xyz coordinates. Further, consider that the map origin has grid indices 1,1,1 not 0,0,0.
I'm not sure about the equation to convert the above, but here is the easy way: (2) If you use ChimeraX command "volume settings" it will actually tell you the map origin xyz coordinates.
Elaine
On Jan 2, 2024, at 2:34 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
HI Elaine,
Thanks but I do need to make a rectangular submap and need to do it within a script (i.e. not using the GUI Subregion selection). The script so far reads the coordinates from the model and the map information (step, origin, etc)
Thanks
Hernando
___________________________________ Hernando Sosa, PhD. Dept. of Biochemistry Albert Einstein College of Medicine 1300 Morris Park Av. Bronx NY 10461 phone (718) 430-3456 emai: hernando.sosa@einsteinmed.edu ___________________________________
From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, January 2, 2024 5:17 PM To: Hernando J Sosa <hernando.sosa@einsteinmed.edu> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Sub Volume map
CAUTION: This email comes from an external source; the attachments and/or links may compromise our secure environment. Do not open or click on suspicious emails. Please click on the “Phish Alert” button on the top right of the Outlook dashboard to report any suspicious emails.
Hi Hernando, Please see previous answer on the chimerax-users list (which mentions both Chimera and ChimeraX). <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimera-users%40cgl.ucsf.edu%2Fmessage%2FADCRCKYI4IIJLY4GK6GODJA3YWRW74E6%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DAN1%2B5y4oxlnYBPuuYS6xp17l%2B1etDNohtHj7L0TWMY%3D&reserved=0>
I should also mention you could consider drawing the region box interactively with the mouse in either program.
In Chimera you could use the "Subregion selection" feature in the Volume Viewer dialog: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimera%2Fdocs%2FContributedSoftware%2Fvolumeviewer%2Fvolumeviewer.html%23mouseselect&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PLVAmSIS8uibPh8BZ45NfAIcKcETwcL7NMtGXwhioEg%3D&reserved=0>
In ChimeraX it is done with the "crop" mouse mode, which you can assign to the right mouse button by clicking the crop icon in the Right Mouse tab of the toolbar: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Ftools%2Fmousemodes.html&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bBiVZ%2FmOgBufRVH9q6DPeN2lCavKMVI1NlUog81y53A%3D&reserved=0>
In ChimeraX when you crop with the mouse it will report the equivalent command in the Log, which includes the region specification.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 2, 2024, at 1:41 PM, Hernando J Sosa via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What should be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e. If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F&data=05%7C02%7Chernando.sosa%40einsteinmed.edu%7C5ab3b574a2b34fa1f29708dc0be0b4e4%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638398306939321160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lWtILVWzOsW1XyGEzUtS9SBkdWoyMIyuHBTew7GKzkg%3D&reserved=0
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (5)
-
Abril Gijsbers
-
Elaine Meng
-
Eric Pettersen
-
Hernando J Sosa
-
Tom Goddard