Obtain electrostatic potential from PQR/DX via script

Hi everyone, I'm performing an analysis where I want to select different regions on a molecule and obtain a list of all of the electrostatic potentials from that region. My input is a PQR file with a DX file. These were generated from a PDB and APBS. The electrostatic potential can be viewed when the option "Report value at mouse position" is selected in the Surface Color tool (Tools...Volume Data...Surface Color...Options button) In the status bar at the bottom, it will show the value along with the coordinates. Is there a way to obtain this information via a ChimeraX command that I could script? Thank you!

Hi David, How would the command specify the 3D point where you want the electrostatic potential value? Do you have x,y,z coordinates for the points of interest? Are you interested in a Python script or a ChimeraX command script? Python allows you to more easily format the output to meet your needs. Tom
On Feb 1, 2023, at 7:10 PM, Lohry, David via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi everyone,
I'm performing an analysis where I want to select different regions on a molecule and obtain a list of all of the electrostatic potentials from that region. My input is a PQR file with a DX file. These were generated from a PDB and APBS.
The electrostatic potential can be viewed when the option "Report value at mouse position" is selected in the Surface Color tool (Tools...Volume Data...Surface Color...Options button) In the status bar at the bottom, it will show the value along with the coordinates.
Is there a way to obtain this information via a ChimeraX command that I could script?
Thank you!
_______________________________________________ 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

Hi David, There is a "measure mapvalues" command that will get values of a map (e.g. density or electrostatic potential) at atomic center positions and assign them as an atom attribute. Then the resulting attribute can be written to a file with the "save" command. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/measure.html#mapvalues> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#attributes> However, that is different than what you are viewing, the map values at surface vertices (or probably even 1.4 A outward from surface vertices since the default electrostatic coloring uses that offset to approximate the ESP at the solvent-accessible surface even though the solvent-excluded surface is what is actually displayed). These different surface definitions are shown in a diagram here: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/surface.html> These surface values are probably more relevant to understanding molecular interactions than the potential at the atomic centers, which would be singularities if those were the same atoms with charges used to calculate the potential. So an additional step is to make the surface vertices into "fake atoms" (markers) before using measure mapvalues etc. as mentioned at the beginning of this message. The command to make markers out of a surface is "marker fromMesh": <https://rbvi.ucsf.edu/chimerax/docs/user/commands/marker.html#create> So I was able to do this on a small example, first using "coulombic" to calculate an ESP map since I didn't have a dx handy, but your procedure would be analogous, simply opening your dx instead of using "coulombic". In the following example, the molecular surface is #1.1 and the fake atoms made from it are #2: open 1gcn coulombic protein map true surf marker fromMesh #1.1 edge 0.05 measure mapvalues #1.2 atoms #2 attribute cesp save ~/Desktop/cesp.defattr attrName cesp models #2 So now I have a plain text file cesp.defattr, format described here <https://rbvi.ucsf.edu/chimerax/docs/user/formats/defattr.html> ...with contents: attribute: cesp recipient: atoms match mode: 1-to-1 #2/M:1@M 1.6767187 #2/M:2@M 1.9566636 #2/M:3@M -0.15276606 #2/M:4@M -0.13766149 #2/M:5@M 3.8019018 #2/M:6@M 3.8222048 #2/M:7@M 1.3163166 #2/M:8@M 1.6913735 #2/M:9@M -12.664384 #2/M:10@M -12.545011 #2/M:11@M 0.17837371 #2/M:12@M 0.13978194 #2/M:13@M -13.340148 #2/M:14@M -13.404252 [.... etc ...] The main issue I can see is that you don't know where on the surface each fake atom is unless you do something to label or zoom in on it in the 3D display, e.g. size /M atomRadius 0.1 view /M:1 :<5 label /M:1 color yellow select /M:1 ...to see where on the surface that particular marker (fake atom) resides. Another issue is that the file will be quite large since there are lots of surface vertices. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Feb 1, 2023, at 7:10 PM, Lohry, David via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi everyone,
I'm performing an analysis where I want to select different regions on a molecule and obtain a list of all of the electrostatic potentials from that region. My input is a PQR file with a DX file. These were generated from a PDB and APBS.
The electrostatic potential can be viewed when the option "Report value at mouse position" is selected in the Surface Color tool (Tools...Volume Data...Surface Color...Options button) In the status bar at the bottom, it will show the value along with the coordinates.
Is there a way to obtain this information via a ChimeraX command that I could script?
Thank you!

Elaine: I think the approach with the fake atoms and measure mapvalues might be what I need. Tom: I had anticipated I would probably need to use a Python script to obtain the values however I was unable to find the ChimeraX command that would return the value. I might have enough information to give this a test. Thank you! ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Thursday, February 2, 2023 1:30 PM To: Lohry, David <dlohry@vols.utk.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Obtain electrostatic potential from PQR/DX via script [You don't often get email from meng@cgl.ucsf.edu. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi David, There is a "measure mapvalues" command that will get values of a map (e.g. density or electrostatic potential) at atomic center positions and assign them as an atom attribute. Then the resulting attribute can be written to a file with the "save" command. <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf....> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf....> However, that is different than what you are viewing, the map values at surface vertices (or probably even 1.4 A outward from surface vertices since the default electrostatic coloring uses that offset to approximate the ESP at the solvent-accessible surface even though the solvent-excluded surface is what is actually displayed). These different surface definitions are shown in a diagram here: <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf....> These surface values are probably more relevant to understanding molecular interactions than the potential at the atomic centers, which would be singularities if those were the same atoms with charges used to calculate the potential. So an additional step is to make the surface vertices into "fake atoms" (markers) before using measure mapvalues etc. as mentioned at the beginning of this message. The command to make markers out of a surface is "marker fromMesh": <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf....> So I was able to do this on a small example, first using "coulombic" to calculate an ESP map since I didn't have a dx handy, but your procedure would be analogous, simply opening your dx instead of using "coulombic". In the following example, the molecular surface is #1.1 and the fake atoms made from it are #2: open 1gcn coulombic protein map true surf marker fromMesh #1.1 edge 0.05 measure mapvalues #1.2 atoms #2 attribute cesp save ~/Desktop/cesp.defattr attrName cesp models #2 So now I have a plain text file cesp.defattr, format described here <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf....> ...with contents: attribute: cesp recipient: atoms match mode: 1-to-1 #2/M:1@M 1.6767187 #2/M:2@M 1.9566636 #2/M:3@M -0.15276606 #2/M:4@M -0.13766149 #2/M:5@M 3.8019018 #2/M:6@M 3.8222048 #2/M:7@M 1.3163166 #2/M:8@M 1.6913735 #2/M:9@M -12.664384 #2/M:10@M -12.545011 #2/M:11@M 0.17837371 #2/M:12@M 0.13978194 #2/M:13@M -13.340148 #2/M:14@M -13.404252 [.... etc ...] The main issue I can see is that you don't know where on the surface each fake atom is unless you do something to label or zoom in on it in the 3D display, e.g. size /M atomRadius 0.1 view /M:1 :<5 label /M:1 color yellow select /M:1 ...to see where on the surface that particular marker (fake atom) resides. Another issue is that the file will be quite large since there are lots of surface vertices. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Feb 1, 2023, at 7:10 PM, Lohry, David via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi everyone,
I'm performing an analysis where I want to select different regions on a molecule and obtain a list of all of the electrostatic potentials from that region. My input is a PQR file with a DX file. These were generated from a PDB and APBS.
The electrostatic potential can be viewed when the option "Report value at mouse position" is selected in the Surface Color tool (Tools...Volume Data...Surface Color...Options button) In the status bar at the bottom, it will show the value along with the coordinates.
Is there a way to obtain this information via a ChimeraX command that I could script?
Thank you!
participants (3)
-
Elaine Meng
-
Lohry, David
-
Tom Goddard