[chimerax-users] Obtain electrostatic potential from PQR/DX via script

Lohry, David dlohry at vols.utk.edu
Thu Feb 2 10:46:04 PST 2023


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 at cgl.ucsf.edu>
Sent: Thursday, February 2, 2023 1:30 PM
To: Lohry, David <dlohry at vols.utk.edu>
Cc: chimerax-users at cgl.ucsf.edu <chimerax-users at cgl.ucsf.edu>
Subject: Re: [chimerax-users] Obtain electrostatic potential from PQR/DX via script

[You don't often get email from meng at 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.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fmeasure.html%23mapvalues&data=05%7C01%7Cdlohry%40vols.utk.edu%7Cd209a42f93ca469bea7608db054b92d6%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638109594368478433%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jhgNkhPlNnDEfmKqaeVVEkFXKyvQt3h54SY03P38J5c%3D&reserved=0>
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fsave.html%23attributes&data=05%7C01%7Cdlohry%40vols.utk.edu%7Cd209a42f93ca469bea7608db054b92d6%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638109594368478433%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=imoOH4eeaQJ3kc%2Fh%2F4AM1XDfzXa83tnq1ICFxnGnvww%3D&reserved=0>

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.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fsurface.html&data=05%7C01%7Cdlohry%40vols.utk.edu%7Cd209a42f93ca469bea7608db054b92d6%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638109594368478433%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wWqwUxxmQiQ046gc0TBMjKd%2FwElgWAtQ65r9tc1JeBw%3D&reserved=0>

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.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fmarker.html%23create&data=05%7C01%7Cdlohry%40vols.utk.edu%7Cd209a42f93ca469bea7608db054b92d6%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638109594368478433%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=kofUdQwsNq43TvB%2F0z58ZxQibAmeP9dKIV9Bzup2b3E%3D&reserved=0>

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.edu%2Fchimerax%2Fdocs%2Fuser%2Fformats%2Fdefattr.html&data=05%7C01%7Cdlohry%40vols.utk.edu%7Cd209a42f93ca469bea7608db054b92d6%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638109594368478433%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fUhdJj%2FyT2XFO7ziNcYrqw6b3SfF822LqxrvYIHEGhw%3D&reserved=0>

...with contents:

attribute: cesp
recipient: atoms
match mode: 1-to-1
        #2/M:1 at M        1.6767187
        #2/M:2 at M        1.9566636
        #2/M:3 at M        -0.15276606
        #2/M:4 at M        -0.13766149
        #2/M:5 at M        3.8019018
        #2/M:6 at M        3.8222048
        #2/M:7 at M        1.3163166
        #2/M:8 at M        1.6913735
        #2/M:9 at M        -12.664384
        #2/M:10 at M       -12.545011
        #2/M:11 at M       0.17837371
        #2/M:12 at M       0.13978194
        #2/M:13 at M       -13.340148
        #2/M:14 at 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 at 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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20230202/5eb47d0b/attachment.html>


More information about the ChimeraX-users mailing list