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/