[chimerax-users] 2D plots and graphs for protein-ligand interactions

Enrico Martinez jmsstarlight at gmail.com
Mon Sep 12 03:20:57 PDT 2022


Right, thank you very much!
This was indeed required for the update of the chimera-x daily!
Just one question: would it be possible to customize the histogram
plot produced via such python script? E.g. change colors of the bars
or indicate the name of the residues involved in the h-bonds?
Many thanks in advance
Cheers
Enrico

Il giorno ven 9 set 2022 alle ore 20:11 Tom Goddard via ChimeraX-users
<chimerax-users at cgl.ucsf.edu> ha scritto:
>
> So the chimerax-daily command is installed in a separate location from the production releases.  So if you install both, you will have a /usr/bin/chimerax and a /usr/bin/chimerax-daily.
>
> The bug in the installation process was in the post-install script, so the command is already there.  That particular bug has to with with integrating ChimeraX in the system menus and no effect on starting ChimeraX from a terminal.  You might see a similar error when installing the next chimerax-daily -- that will not have that bug :-).
>
>     -- Greg
>
> On 9/9/2022 10:41 AM, Tom Goddard wrote:
>
> Greg Couch our Linux expert would have to answer that question.
>
> Tom
>
> On Sep 9, 2022, at 1:09 AM, Enrico Martinez via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>
> P.S. Are there other possibilities to install chimera-daily in a distinct directory from the chimerax stable release not to overlap between the both ?
>
> Il giorno ven 9 set 2022 alle ore 10:07 Enrico Martinez <jmsstarlight at gmail.com> ha scritto:
>>
>> Thank you Tom!
>> Actually I faced the problem with the installation of the chimerax-daily on the ubuntu-20.04
>> (currently I am using the 1.4 version realized in june 2022). Here is the error of the installation:
>>
>> root at Perfetto-7920-Tower:/home/enrico/Downloads# dpkg -i ./chimerax-daily.deb
>> (Reading database ... 322925 files and directories currently installed.)
>> Preparing to unpack ./chimerax-daily.deb ...
>> Deregister desktop menu and associated mime types
>> Remove Python cache files
>> Unpacking ucsf-chimerax-daily (2022.09.08ubuntu20.04) over (2022.09.08ubuntu20.04) ...
>> Setting up ucsf-chimerax-daily (2022.09.08ubuntu20.04) ...
>> Install desktop menu and associated mime types
>> Traceback (most recent call last):
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/core/__main__.py", line 724, in init
>>     run(sess, cmd)
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run
>>     results = command.run(text, log=log, return_json=return_json)
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run
>>     result = ci.function(session, **kw_args)
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/linux/cmd.py", line 23, in linux_xdg_install
>>     install(session, verbose=verbose, system=system)
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/linux/_xdg.py", line 428, in install
>>     generate(session, info, system, verbose)
>>   File "/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/linux/_xdg.py", line 421, in generate
>>     from chimerax.core import localized_app_name
>> ImportError: cannot import name 'localized_app_name' from 'chimerax.core' (/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/chimerax/core/__init__.py)
>> dpkg: error processing package ucsf-chimerax-daily (--install):
>>  installed ucsf-chimerax-daily package post-installation script subprocess returned error exit status 70
>> Processing triggers for man-db (2.9.1-1) ...
>> Errors were encountered while processing:
>>  ucsf-chimerax-daily
>>
>>
>> Il giorno ven 9 set 2022 alle ore 00:07 Tom Goddard <goddard at sonic.net> ha scritto:
>>>
>>> Hi Enrico,
>>>
>>>   As Elaine says, ChimeraX isn't a plotting package, so it doesn't let you set colors, sizes, scales, ..., of plots.  You could save the plot ChimeraX makes with Python, but I don't think it is very useful to do in an automated way because the aspect ratio of the plot will probably be poor and you cannot control it in a script.  At any rate, for reference here is Python that would save the image
>>>
>>> from chimerax.core.commands import run
>>> plot = run(session, 'crosslinks histo #1.1')
>>> plot.save_plot('histogram.png')
>>>
>>> This will need a September 9, 2022 or newer daily build because I just made the "crosslinks histogram" command return the plot, before it did not return it.
>>>
>>>   The figures in the paper were made interactively in ChimeraX on a high resolution display and just a screen capture was used to save an image.  Although as Elaine notes the right-click context menu on those plot windows has a "Save Plot As..." menu entry that will save at 300 dots per inch resolution.
>>>
>>> Tom
>>>
>>> Example histogram of hydrogen bond lengths for pdb 7qfc saved with the context menu entry "Save Plot As..."
>>>
>>> <histogram.png>
>>>
>>> On Sep 8, 2022, at 9:10 AM, Elaine Meng via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>>
>>> Hello,
>>> The main advantage of these plots inside ChimeraX is that they are interactive with the 3D structure (e.g. you click something on the plot, it does something in the 3D window).  They weren't meant for making figures for hundreds of molecules in scripts.
>>>
>>> So, there are no options to customize plot appearance, and the only way to save the histogram currently is by interactively using the context menu on that window, as mentioned in the help:
>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/crosslinks.html#histogram>
>>>
>>> If you wanted to make your own plots with everything about the appearance customized, currently you would have to write python scripts to dump the data and then use your own favorite plotting program to generate images.
>>> Best,
>>> Elaine
>>> -----
>>> Elaine C. Meng, Ph.D.
>>> UCSF Chimera(X) team
>>> Department of Pharmaceutical Chemistry
>>> University of California, San Francisco
>>>
>>>
>>> On Sep 8, 2022, at 1:40 AM, Enrico Martinez via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>>
>>> Thanks a lot, Elaine!
>>> Actually crosslink hist #1 works very well!
>>> Could you please specify would it be possible to plot the histogram
>>> (using batch chimera-x execution) or alternatively add it directly to
>>> the produced png image?
>>> I did not find any possibility to save the plot or to customize its
>>> appearance (color of the bars etc).
>>> Cheers
>>> Enrico
>>>
>>> Il giorno mer 7 set 2022 alle ore 17:52 Elaine Meng
>>> <meng at cgl.ucsf.edu> ha scritto:
>>>
>>>
>>> Hello!
>>> The chain contacts diagram shown in Fig 4b is made with the "interfaces" command.  Then you can use context menu on that contacts diagram to make the interface-residue plot in Fig 4d.  Please see the "interfaces" help for details on both of those.
>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/interfaces.html>
>>>
>>> The histogram plot in Fig 5b  is made with the command "crosslinks histogram" but first you have to have some crosslinks, or other pseudobonds such as from finding H-bonds or contacts.  Then in the "crosslinks histogram" command you specify the pseudobond model to plot their distances.  See "crosslinks histogram" help:
>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/crosslinks.html#histogram>
>>>
>>> Also for a more detailed example see the "Interactive H-bond Histogram" feature highlight, which includes a script (.cxc file):
>>> <https://www.rbvi.ucsf.edu/chimerax/features.html#hbond-histogram>
>>>
>>> I hope this helps,
>>> Elaine
>>> -----
>>> Elaine C. Meng, Ph.D.
>>> UCSF Chimera(X) team
>>> Department of Pharmaceutical Chemistry
>>> University of California, San Francisco
>>>
>>>
>>> On Sep 7, 2022, at 2:18 AM, Enrico Martinez via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>>
>>> Dear ChimeraX users!
>>> I am dealing with the analysis of protein-ligand interactions in a
>>> single PDB structure. I am looking for any tools implemented in
>>> Chimera-X, which could be used to analyse the interactions (besides
>>> the hbond and contact tools giving info in the log files).
>>> I wonder to know which commands and corresponded ChimeraX tools could
>>> be used to produce the 2D contact diagrams shown on the Fig.4 as well
>>> as python graphs demonstrated on the Fig.5 in the Chimera-X article:
>>> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5734306/
>>>
>>> Many thanks in advance!
>>> Cheers
>>> Enrico
>>>
>>>
>>>
>>> _______________________________________________
>>> ChimeraX-users mailing list
>>> ChimeraX-users at cgl.ucsf.edu
>>> Manage subscription:
>>> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
>>>
>>>
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
>
>
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users



More information about the ChimeraX-users mailing list