<div dir="ltr">Hi all,<div><br></div><div>Christian, thank you so much for your answer! I considered using biopython, but, as you pointed out, I also couldn't find a way to calculate SESA (areaSES), which is why I switched to Chimera, which allows such a calculation.</div><div>As Elaine explained, SESA is the solvent-excluded surface aerea, and the diagram she referenced is quite useful to understand their difference. As far as I could find out, there's not an immediate way to get SESA from SASA --- a specific algorithm is used to do so. I still think that I'll be able to run Chimera from python in the --nogui mode, so that it won't be necessary to implement such an algorithm, But, if I do, I'll post it here.</div><div><br></div><div>Elaine and Christian, thank you again for your replies and valuable help!</div><div><br></div><div>Best,</div><div>André.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em seg., 24 de jan. de 2022 às 13:42, Elaine Meng <<a href="mailto:meng@cgl.ucsf.edu">meng@cgl.ucsf.edu</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Christian,<br>
Just FYI and for the others on the list...<br>
<br>
People would like to have a lookup table of "completely exposed" reference values for SAS (not SES) for each of the standard amino acids because that is the only type of area that can be calculated in ChimeraX. ChimeraX calculates the residue SAS in the context of the specific structure, and then if there were a reference "completely exposed" value, you would divide by that to get % exposed. It's just a normalization factor for the size of the residue.<br>
<br>
We already have reference values for SES (which could be used in Chimera because Chimera can calculate SES). We just don't have them for SAS.<br>
<br>
There is a diagram showing the difference between SAS and SES here:<br>
<<a href="https://rbvi.ucsf.edu/chimerax/docs/user/commands/surface.html" rel="noreferrer" target="_blank">https://rbvi.ucsf.edu/chimerax/docs/user/commands/surface.html</a>><br>
<br>
Best,<br>
Elaine<br>
-----<br>
Elaine C. Meng, Ph.D. <br>
UCSF Chimera(X) team<br>
Department of Pharmaceutical Chemistry<br>
University of California, San Francisco<br>
<br>
> On Jan 24, 2022, at 4:28 AM, Christian Tüting via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
> <br>
> Hi Andre,<br>
> <br>
> I checked what you want to calculate. For me, I didn't even know that<br>
> there is something called SES, I only worked with SAS(A) so far. As far<br>
> as I see, you need a reference for the SES, to calculate the relative<br>
> exposure?<br>
> <br>
> But for the rest, I think you can go for a python only solution, which<br>
> is way faster, than starting chimera(x) for each calculation:<br>
> <br>
> dihedrals: calculatable from coordinates (so from pdb)<br>
> bfactor: directly in pdb file<br>
> kdh: value based on residue type (also in pdb)<br>
> sasa: calculatable from coordinates<br>
> <br>
> <br>
> So I wrote a piece of code, which will calculate these from a input pdb<br>
> file and save the values in a dataframe.<br>
> Here is the code: <a href="https://paste.ofcode.org/gCH5HDVtkg4DD3fcdqKfRZ" rel="noreferrer" target="_blank">https://paste.ofcode.org/gCH5HDVtkg4DD3fcdqKfRZ</a> (link<br>
> will be expire in 1 week).<br>
> <br>
> I also attach the file to this mail.<br>
> <br>
> The code was tested for the pdb file 1trn (hardcoded in the file), which<br>
> contains mutliple chains and heteroatoms and unusual residues, and as<br>
> far as I can see, the results looks correct. In principle, it's a<br>
> function, which just need to full path to the pdb file. <br>
> <br>
> <br>
> For the dependencies, it uses pandas and biopython.<br>
> <br>
> Additionally:<br>
> <br>
> For the SES calculation, if this could be calculated from the reference<br>
> and the SASA, it should be easy to implement. If you have a reference<br>
> for this, I might also include this for you.<br>
> <br>
> Best<br>
> Christian<br>
> <br>
> <br>
> ps. the code is not optimized, e.g., the load pdb module from biopython<br>
> is used twice. So the code could be also furhter optimized to be faster.<br>
> Also the manually read-in of the pdb file could be most likely done by<br>
> biopython and not manually, like I did :D<br>
> <br>
> <br>
>>>> André <<a href="mailto:andre.jfmdm@gmail.com" target="_blank">andre.jfmdm@gmail.com</a>> 01/21/22 7:06 PM >>><br>
> Hi Elaine,<br>
> <br>
> Thank you so much for your very helpful answer!<br>
> <br>
> Yeah, Tom told me before that it wouldn't be possible to directly<br>
> calculate<br>
> SESA and relSESA with ChimeraX. So, I'll probably have to stick with<br>
> Chimera. I've just discovered the "list" command (functional in<br>
> Chimera),<br>
> and I think that with it I'll be able to easily get all the attributes<br>
> by<br>
> using the --nogui startup.<br>
> I'll work on it in the following days, then I'll come back with updates.<br>
> <br>
> Once again, thank you very much!<br>
> <br>
> Best,<br>
> André.<br>
> <br>
> Em sex., 21 de jan. de 2022 às 13:55, Elaine Meng <<a href="mailto:meng@cgl.ucsf.edu" target="_blank">meng@cgl.ucsf.edu</a>><br>
> escreveu:<br>
> <br>
>> Hi André,<br>
>> Although it displays an SES, ChimeraX does not calculate SES areas,<br>
> only<br>
>> SAS areas (command "measure sasa" which also assigns a residue<br>
> attribute).<br>
>> <<a href="https://rbvi.ucsf.edu/chimerax/docs/user/commands/measure.html#sasa" rel="noreferrer" target="_blank">https://rbvi.ucsf.edu/chimerax/docs/user/commands/measure.html#sasa</a>><br>
>> <br>
>> For Chimera, another group had provided SES reference areas for the<br>
>> exposed state represented by G-X-G tripeptides, but I don't know of a<br>
>> similar SAS reference area set for ChimeraX that could be used to<br>
> calculate<br>
>> relative exposure, sorry. In case others are interested, the Chimera<br>
>> relative exposure calculation giving relSESA is described here:<br>
>> <<a href="https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/surfnorm.html" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/surfnorm.html</a>><br>
>> <br>
>> So depending on the importance of SESA and relSESA, you may need to<br>
> use<br>
>> Chimera, or at least some method outside of ChimeraX.<br>
>> <br>
>> In both ChimeraX and Chimera, bfactor is read from the input PDB file,<br>
> and<br>
>> phi and psi are calculated automatically for peptide/protein<br>
> structures<br>
>> when they are read in. ChimeraX atom and residue attributes:<br>
>> <<a href="https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html#atom" rel="noreferrer" target="_blank">https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html#atom</a>><br>
>> <<a href="https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html#residue" rel="noreferrer" target="_blank">https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html#residue</a>><br>
>> <br>
>> kdHydrophobicity is not a calculation, but a simple lookup table by<br>
> amino<br>
>> acid type. You may not need either program to "calculate" it, but it<br>
> is<br>
>> automatically assigned in Chimera. It can be assigned in ChimeraX by<br>
>> running this comand script:<br>
>> <<br>
>> <br>
> <a href="https://rbvi.ucsf.edu/chimerax/docs/user/kyte-doolittle_hydrophobicity.cxc" rel="noreferrer" target="_blank">https://rbvi.ucsf.edu/chimerax/docs/user/kyte-doolittle_hydrophobicity.cxc</a><br>
>>> <br>
>> <br>
>> ...or you can just assign it directly yourself by lookup table. The<br>
>> values along with some alternative hydrophobicity scales (lookup<br>
> tables)<br>
>> are summarized here:<br>
>> <br>
> <<a href="https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/hydrophob.html" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/hydrophob.html</a>><br>
>> <br>
>> I h> Department of Pharmaceutical Chemistry<br>
>> University of California, San Francisco<br>
>> <br>
>>> On Jan 21, 2022, at 7:28 AM, André via ChimeraX-users <<br>
>> <a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
>>> <br>
>>> Hi Christian,<br>
>>> <br>
>>> Thank you so much for your solution! That indeed helps a lot, since<br>
> it<br>
>> shows me how to execute ChimeraX scripts independently and directly<br>
> from<br>
>> Python!<br>
>>> <br>
>>> Now, do you know which commands I should use to calculate the<br>
> following<br>
>> structural attributes for all residues: areaSAS, areaSES, relSESA,<br>
> bfactor,<br>
>> kdhydro, phi, psi?<br>
>>> <br>
>>> I do it manually in Chimera (haven't figured out how to do the same<br>
> in<br>
>> ChimeraX yet), by following the route: Tools -> Structure Analysis -><br>
>> Render by Attribute -> File -> Save Attributes -> Attribute to Save,<br>
> which<br>
>> allows each attribute of residues to be saved as txt files, which<br>
> contain<br>
>> the residue number and respective attribute, for all residues in the<br>
>> protein. For example, the file for areaSAS looks like this:<br>
>>> <br>
>>> attribute: areaSAS<br>
>>> recipient: residues<br>
>>> :1.B 116.71626508235931<br>
>>> :2.B 118.39353680610657<br>
>>> ...<br>
>>> <br>
>>> Thus, that's what I wanted to do: figure out which commands I should<br>
> use<br>
>> to get the same result as the manual route above (although it is not<br>
>> really necessary that the txt file is generated directly -- if the<br>
> needed<br>
>> information appear in the stdout_as_str string, just like in the<br>
> example<br>
>> you showed, I'd be able to parse it to a file, and the problem would<br>
> be<br>
>> solved!).<br>
>>> <br>
>>> Once again, thank you for your help!<br>
>>> <br>
>>> Best,<br>
>>> André.<br>
>>> <br>
>>> <br>
>>> <br>
>>> Em sex., 21 de jan. de 2022 às 09:56, Christian Tüting <<br>
>> <a href="mailto:christian.tueting@biochemtech.uni-halle.de" target="_blank">christian.tueting@biochemtech.uni-halle.de</a>> escreveu:<br>
>>> Hi André,<br>
>>> <br>
>>> i am pretty sure, that my solution is very crude and that there are<br>
>>> better ways of doing it (like importing chimerax in the python code<br>
>>> directly). I guess, you'll get more anwsers soon.<br>
>>> <br>
>>> I quickly wrote a script, which performs a chimerax task<br>
> independently,<br>
>>> by just running python code.<br>
>>> <br>
>>> First: a chimerax script file with the desired commands:<br>
>>> <br>
>>> script.cxc:<br>
>>> open 7ott<br>
>>> surface #1<br>
>>> mearuse area #1<br>
>>> exit<br>
>>> <br>
>>> Note: the exit command is needed, otherwise the subprocress will<br>
> idle in<br>
>>> the chimerax cmd line.<br>
>>> <br>
>>> <br>
>>> Second: a python script, which execute this script in chimerax and<br>
>>> fetches the output:<br>
>>> <br>
>>> test.py:<br>
>>> <br>
>>> import subprocess<br>
>>> import os<br>
>>> <br>
>>> cwd = os.getcwd()<br>
>>> <br>
>>> chimerax =<br>
> "/Applications/ChimeraX_Daily.app/Contents/MacOS/ChimeraX"<br>
>>> scriptfile = f"{cwd}/script.cxc"<br>
>>> <br>
>>> cmd = [chimerax, "--nogui",scriptfile]<br>
>>> p = subprocess.run(" ".join(cmd),shell = True,capture_output=True)<br>
>>> <br>
>>> stdout_as_str = p.stdout.decode("utf-8")<br>
>>> print(stdout_as_str)<br>
>>> <br>
>>> This just runs a subprocess and fetches the output to a string,<br>
> which<br>
>>> you can than further analyse.<br>
>>> <br>
>>> <br>
>>> Best<br>
>>> Christian<br>
>>> <br>
>>> <br>
>>> <br>
>>> Dr. rer. nat. Christian Tüting<br>
>>> <br>
>>> Kastritis Laboratory for Biomolecular Research<br>
>>> Cryo-Electron Microscopy & Computational Structural Biology<br>
>>> ________________________________________________<br>
>>> Martin-Luther-Universität Halle-Wittenberg<br>
>>> Biozentrum, Room A.2.19<br>
>>> IWE ZIK HALOmem NWG III<br>
>>> "Kryo-Elektronenmikroskopie an Membranproteinkomplexen"<br>
>>> Weinbergweg 22, 06120 Halle<br>
>>> tel: +49 345 5524985<br>
>>> web (Lab): <a href="https://blogs.urz.uni-halle.de/kastritislab/" rel="noreferrer" target="_blank">https://blogs.urz.uni-halle.de/kastritislab/</a><br>
>>> web (HALOmem): <a href="https://www.halomem.de/en/" rel="noreferrer" target="_blank">https://www.halomem.de/en/</a><br>
>>>>>> André via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> 01/21/22<br>
> 1:29<br>
>>> PM >>><br>
>>> Hello!<br>
>>> <br>
>>> I'm working on an automated pipeline (in Python) for the structural<br>
>>> analysis of proteins. In particular, I'm using Chimera to calculate<br>
> and<br>
>>> save to .txt files some structural properties of residues (namely:<br>
>>> areaSAS,<br>
>>> areaSES, relSESA, bfactor, kdhydro, phi, psi). These files are the<br>
>>> inputs<br>
>>> of the pipeline.<br>
>>> However, currently the files are exported manually, and, f> > this step of calculating the attributes and exporting their<br>
> respective<br>
>>> files.<br>
>>> <br>
>>> I searched a lot, and tried some ways to achieve such an automation<br>
>>> (using<br>
>>> Chimera), but nothing worked.<br>
>>> And I also considered using ChimeraX. In particular, I went through<br>
>>> ChimeraX Programming Manual (<br>
>>> <a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html#" rel="noreferrer" target="_blank">https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html#</a>), but, if I<br>
>>> understood correctly, I'd only be able to import chimerax and use<br>
> its<br>
>>> functions in the Python interpreter within ChimeraX (Tools >><br>
> General >><br>
>>> Shell).<br>
>>> At first, I'd like to import chimerax as a module in a Python<br>
>>> interpreter<br>
>>> outside of ChimeraX, so that manually opening ChimeraX wouldn't be<br>
>>> necessary in order to save the files with the residues' attributes.<br>
> But,<br>
>>> from some other threads in the mailing list, I found that it<br>
> wouldn't be<br>
>>> possible (right?)<br>
>>> <br>
>>> But I also found out that I could write a .py script which<br>
> calculates<br>
>>> and<br>
>>> exports the files with the residues' properties, and then run it<br>
> with<br>
>>> ChimeraX application from the command-line, something like:<br>
> *chimerax<br>
>>> --nogui myscript.py*<br>
>>> If that works, I think that my automation problem would be solved!<br>
> The<br>
>>> only<br>
>>> problem is that I really couldn't figure out the Python code to<br>
>>> calculate<br>
>>> and export the aforementioned residues' properties (I took a look in<br>
>>> ChimeraX Recipes (<a href="https://rbvi.github.io/chimerax-recipes/" rel="noreferrer" target="_blank">https://rbvi.github.io/chimerax-recipes/</a>), but I<br>
>>> couldn't<br>
>>> find what I need, nor more detailed documentation).<br>
>>> <br>
>>> Given that, I'd like to know if anyone has done something like this,<br>
>>> and/or<br>
>>> have any guidance on how I could proceed.<br>
>>> <br>
>>> I really appreciate any help you can provide!<br>
>>> (And thanks to Tom Goddard for suggesting moving the discussion here<br>
> to<br>
>>> the<br>
>>> ChimeraX mailing list).<br>
>>> <br>
>>> Thank you so much,<br>
>>> André.<br>
>>> <br>
>>> _______________________________________________<br>
>>> ChimeraX-users mailing list<br>
>>> <a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>
>>> Manage subscription:<br>
>>> <a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br>
>> <br>
>> <br>
> <br>
> <analysis.py>_______________________________________________<br>
> ChimeraX-users mailing list<br>
> <a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>
> Manage subscription:<br>
> <a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br>
<br>
</blockquote></div>