Question about pad parameter

Hello, I am using the volume cover command to crop the chain from the protein map. Here is what I did:
open 12554 from emdb open 7ns0 volume cover #1 atomBox #2/A1 pad 1.0 Suppose I want to add extra 17 voxels on each size of the chain, what value of pad should I add? Also, could you tell me the unit of pad in this command? Thank you very much.
Best regards, Thu

Hello, The pad values are in whatever physical units of distance your data are in, usually angstroms (and certainly your PDB structure is in angstroms). <https://rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#cover> I wouldn't know offhand how big the "voxels" are in your map, but you can see a list of many settings for the map including voxel size with command "volume settings" and then convert from that angstrom voxel size to the pad value that you want. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 4, 2022, at 9:32 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello, I am using the volume cover command to crop the chain from the protein map. Here is what I did:
open 12554 from emdb open 7ns0 volume cover #1 atomBox #2/A1 pad 1.0 Suppose I want to add extra 17 voxels on each size of the chain, what value of pad should I add? Also, could you tell me the unit of pad in this command? Thank you very much.
Best regards, Thu

Thank you very much for your help. You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8? I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much. Best regards, Thu On Fri, Nov 4, 2022 at 6:29 PM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hello, The pad values are in whatever physical units of distance your data are in, usually angstroms (and certainly your PDB structure is in angstroms). <https://rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#cover>
I wouldn't know offhand how big the "voxels" are in your map, but you can see a list of many settings for the map including voxel size with command "volume settings" and then convert from that angstrom voxel size to the pad value that you want.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 4, 2022, at 9:32 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hello, I am using the volume cover command to crop the chain from the protein map. Here is what I did:
open 12554 from emdb open 7ns0 volume cover #1 atomBox #2/A1 pad 1.0 Suppose I want to add extra 17 voxels on each size of the chain, what value of pad should I add? Also, could you tell me the unit of pad in this command? Thank you very much.
Best regards, Thu

Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said. To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929 Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329. For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2: save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143 <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu

Good morning, Thank you very much for your explanation. It is truly helpful. For my second question, is there a way to write the region of a map to a text file? For example, when I open the map of emdb 12554, I have the region of 0 0 0 to 449 449 449. Is there any way we can write these numbers into a text file (for example: id_12554 0 0 0 449 449 449)? Thank you very much. Best regards, Thu On Mon, Nov 7, 2022 at 11:26 AM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said.
To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me
voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929
Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329.
For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2:
save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu

As far as I know you would need to use "volume settings" to show the info in the Log and then just copy/paste yourself into some other text editor to create a text file. Or save the whole Log (e.g. command "log save") but that will give an HTML file, not a text file. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/log.html#save> Elaine
On Nov 7, 2022, at 8:40 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Good morning, Thank you very much for your explanation. It is truly helpful. For my second question, is there a way to write the region of a map to a text file? For example, when I open the map of emdb 12554, I have the region of 0 0 0 to 449 449 449. Is there any way we can write these numbers into a text file (for example: id_12554 0 0 0 449 449 449)? Thank you very much.
Best regards, Thu
On Mon, Nov 7, 2022 at 11:26 AM Elaine Meng <meng@cgl.ucsf.edu> wrote: Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said.
To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me
voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929
Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329.
For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2:
save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu
<Screen Shot 2022-11-07 at 11.33.31 AM.png>_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thank you so much for your help. Have a great day. Best regards, Thu On Mon, Nov 7, 2022 at 11:45 AM Elaine Meng <meng@cgl.ucsf.edu> wrote:
As far as I know you would need to use "volume settings" to show the info in the Log and then just copy/paste yourself into some other text editor to create a text file. Or save the whole Log (e.g. command "log save") but that will give an HTML file, not a text file. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/log.html#save>
Elaine
On Nov 7, 2022, at 8:40 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Good morning, Thank you very much for your explanation. It is truly helpful. For my second question, is there a way to write the region of a map to a text file? For example, when I open the map of emdb 12554, I have the region of 0 0 0 to 449 449 449. Is there any way we can write these numbers into a text file (for example: id_12554 0 0 0 449 449 449)? Thank you very much.
Best regards, Thu
On Mon, Nov 7, 2022 at 11:26 AM Elaine Meng <meng@cgl.ucsf.edu> wrote: Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said.
To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me
voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929
Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329.
For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2:
save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu
<Screen Shot 2022-11-07 at 11.33.31 AM.png>_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Hi Thu, It sounds like you are trying to automate some processing. If you want to write out the region bounds with Python you could put this code in bounds.py and open it in ChimeraX after opening your map data. from chimerax.map import Volume with open('bounds.txt', 'w') as output: for v in session.models: if isinstance(v, Volume): (i0,j0,k0), (i1,j1,k1) = v.region[:2] output.write(f'{v.name.replace(" ","_")} {i0} {j0} {k0} {i1} {j1} {k1}\n') There are many examples of ChimeraX Python scripts at the ChimeraX Recipes web site https://rbvi.github.io/chimerax-recipes/ Tom
On Nov 7, 2022, at 8:40 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Good morning, Thank you very much for your explanation. It is truly helpful. For my second question, is there a way to write the region of a map to a text file? For example, when I open the map of emdb 12554, I have the region of 0 0 0 to 449 449 449. Is there any way we can write these numbers into a text file (for example: id_12554 0 0 0 449 449 449)? Thank you very much.
Best regards, Thu
On Mon, Nov 7, 2022 at 11:26 AM Elaine Meng <meng@cgl.ucsf.edu <mailto:meng@cgl.ucsf.edu>> wrote: Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said.
To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me
voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929
Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329.
For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2:
save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map>>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu
<Screen Shot 2022-11-07 at 11.33.31 AM.png>_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>

Hi Mr. Tom, Thank you very much for your help. It is exactly what I was looking for. The ChimeraX Recipes are extremely helpful, too. Best regards, Thu On Mon, Nov 7, 2022 at 9:07 PM Tom Goddard <goddard@sonic.net> wrote:
Hi Thu,
It sounds like you are trying to automate some processing. If you want to write out the region bounds with Python you could put this code in bounds.py and open it in ChimeraX after opening your map data.
from chimerax.map import Volume with open('bounds.txt', 'w') as output: for v in session.models: if isinstance(v, Volume): (i0,j0,k0), (i1,j1,k1) = v.region[:2] output.write(f'{v.name.replace(" ","_")} {i0} {j0} {k0} {i1} {j1} {k1}\n')
There are many examples of ChimeraX Python scripts at the ChimeraX Recipes web site
https://rbvi.github.io/chimerax-recipes/
Tom
On Nov 7, 2022, at 8:40 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Good morning, Thank you very much for your explanation. It is truly helpful. For my second question, is there a way to write the region of a map to a text file? For example, when I open the map of emdb 12554, I have the region of 0 0 0 to 449 449 449. Is there any way we can write these numbers into a text file (for example: id_12554 0 0 0 449 449 449)? Thank you very much.
Best regards, Thu
On Mon, Nov 7, 2022 at 11:26 AM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Thu, The pad value units are angstroms (not voxels) but it sounds like you understand that, since your math is correct: if you want 1.4 angstroms, then enter 1.4. If you want 23.8 angstroms then enter 23.8. If the voxel size (grid spacing) is 1.4 then those are equal to 1 grid unit and 17 grid units respectively, like you said.
To calculate the XYZ location of grid indices, like (0,0,0) and (103,95,143) you have to figure it out from the voxel size and origin coordinates, as reported by "volume settings" command. Say for example that this command gives me
voxel size = 1.4 1.4 1.4 origin = 2.525 -2.214 7.929
Then the coordinates of grid (0,0,0) are xyz (2.525,-2.214,7.929). The coordinates of grid (1,3,1) are x = 2.525 + 1(1.4) = 3.925, y = -2.214 + 3(1.4) = 1.986, z = 7.929 + 1(1.4) = 9.329.
For saving part of a map, you can enter grid indices with the "save" command "region" option, for example if your map is #2:
save ~meng/Desktop/mymap.mrc model #2 region 0,0,0,103,95,143
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#map>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 7, 2022, at 7:44 AM, Thu Nguyen via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Thank you very much for your help.
You mean that if the voxel size of my map is 1.4 (for example), then the pad value in the command will have the unit of the voxel size, which is 1.4 in this case? And if I want to add 17 extra voxels on each side, the pad value will be 1.4*17 = 23.8?
I do have another question about how to extract a region of a chain. For example, if a chain has its region of 0 0 0 to 103 95 143, how do we extract its location and save it in a text file? Thank you so much.
Best regards, Thu
<Screen Shot 2022-11-07 at 11.33.31 AM.png>
ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Thu Nguyen
-
Tom Goddard