Hi Rafi,

  We plan on making a Python library that includes the non-graphics functions of ChimeraX such as adding hydrogens and writing PDB files.  We expect to have some initial version of that in the next 6 months.  You would install it from PyPi or Conda and you could easily do that on Google Colab.  But right now we only distribute the ChimeraX desktop application.  You could install that on Colab but your Colab script to do that install would need to fetch it from the web without going through a user license.  I guess you could put the ChimeraX installer on your own machine and have the Colab script fetch it from your machine and run the installer.  Or you could upload the installer by hand through the Google Colab interface.  That gets pretty cumbersome to do by hand if you will be doing it more than once.  Since Google Colab times out after some hours of use you cannot just leave it installed as you could on a paid virtual machine such as AWS, or Google Cloud, or Microsoft Azure.  The application takes maybe a minute to install, so pretty slow even if you automate it with a script.  So it seems painful to do using the ChimeraX application.

  So I'd say it won't be easy to use ChimeraX as a library until we distribute the Python library.  But if you were sufficiently motivated you could still do it with the current ChimeraX application.  We have funding to develop the library from CZI which ends in August 2023 but will likely be extended some months, so we expect to deliver this library before the close of that funding, and your use is exactly the reason we are providing the ChimeraX library as a Python package, to allow use in your own non-graphical processing.

Tom


On Apr 26, 2023, at 8:49 AM, Rafi Brent <rafi.brent@yale.edu> wrote:

Hi Tom,
   Thanks so much for your help. The use case involves a couple of simple transformations in nogui mode, namely adding hydrogens and converting a pdb file to mol2. While there are other Colab-compatible packages which perform these tasks, the specific implementations vary slightly, yielding results that are distinct from what I have previously obtained using a local installation of chimera (I assume that ChimeraX would have similar implementations as well). I'd like this Colab notebook to exactly reproduce the results from my local use of chimera if at all possible, so any specific advice you may have about how to install ChimeraX to Colab or call the associated functions would be very helpful.

Best,
Rafi

On Thu, Apr 20, 2023 at 7:25 PM Tom Goddard <goddard@sonic.net> wrote:
Hi Rafi,

  You could have a Google Colab notebook install ChimeraX and then you could run ChimeraX command in nogui mode or python code through the ChimeraX REST facility, and possibly save images of the graphics to show in the notebook.  But I don’t grasp the value of it since ChimeraX is all about interactive visualization where you can rotate and inspect structures.  One issue you will face is that ChimeraX cannot be installed without agreeing to a license when dowloading - not sure how you might handle that in a notebook.  But I suggest figuring out the valuable use case first.

   Tom

> On Apr 21, 2023, at 5:28 AM, Zach Pearson via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
>
> Hi Rafi,
>
> We are working hard to fully deprecate Chimera, and haven’t made its source code accessible for use or extension outside of the desktop application. I would caution against looking for it; the compilation process is complex and depends on resources that may not even be available anymore. Chimera was also written in Python 2.7, a language the computing community is working hard to put to rest — Colab doesn’t support it anymore!
>
> We do have plans to release a substantial part of ChimeraX on PyPi this year as a public beta, and I’ll make a note to send you an email when that release happens. Then you should be able to use it in Colab like any other PyPi package. Let me know if I can answer any other questions you may have.
>
> -------------------
> Zach Pearson
> Programmer, ChimeraX Team
> UCSF RBVI
> zjp@cgl.ucsf.edu
>
>
>
>> On Apr 20, 2023, at 13:44, Rafi Brent via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
>>
>> To whom it may concern,
>>     I'm wondering if there's any way to access Chimera without having the GUI downloaded on a local computer. Specifically, I'd like to run chimera as part of a public Google Colab (.ipynb) notebook, which would allow users to access the chimera functionality through either installing a PyPi package or calls to a web-accessible API. Do you know of any tool like this, or have any other ideas for how Chimera could be used in Colab notebook? Thanks so much for any advice you may have.
>>
>> Sincerely,
>> Rafi Brent
>> _______________________________________________
>> Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
>> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users
>
> _______________________________________________
> Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users