Skip to content

fomightez/Jupyter-desktop_with_pymol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 

Repository files navigation

Jupyter Desktop Server with PyMOL installed

Binder

How to start a remote computing session and open & use PyMOL on the remote desktop

To get started, click on launch binder badge at the top of bottom of this page.

In the upper left of the desktop screen, click on Applications > select Run Program... from the top of the list, and enter pymol (all lowercase). Click the Launch button below where you entered pymol That will Launch PyMOL on a remote, temporary computer streaming in your browser.

Adjust the width of the PyMOL window by dragging on the bottom right corner down and to the right to maximize screen real estate to suit your preference.

Next to any PyMOL> prompt you see on the screen, type fetch followed by a PDB id and you'll be viewing your choice of molecule.

There is a Remote Clipboard tool in the upper right corner for passing text into and out of the remote virtual machine where is this running.

If you end up making anything useful, such as a session file (ending in .pse) or an image file, you'll want to download it to your local machine. You'll need to do that from a different interface with the remote machine. Look at the URL of your PyMOL session screen and copy it. It will look similar to the following but be unique in some ways, such as the part in front of mybinder may be different depending on where in the global network the remote machine is:

https://hub.gke.mybinder.org/user/fomightez-jupyt-ktop_with_pymol-r7gbgfa3/desktop/?token=zdDDLXhXTzSw7Xcg0g1zfg

You want to look for desktop in front of /?token.. and copy everything in front of desktop to ANOTHER browser window and add on lab at the end. This will result in something like this example below that's built on the example above:

https://hub.gke.mybinder.org/user/fomightez-jupyt-ktop_with_pymol-r7gbgfa3/lab

Hit return to load the page. Your generated PyMOL session file (ending in .pse) or image file should appear in the list of files in the file navigation panel in the upper. Right-click on the file in the list, and select Download from the middle of the list of possible actions.


How to use the PyMOL GUI in general

I list a number of resources for using PyMOL here.
There are several tutorials listed towards that bottom of that list that use the graphical user interface for interacting with PyMOL. Using PyMOL via a mouse and display is how people tpyically use PyMOL. Those steps should work in sessions launched from here. However, the top of that list emphasizes using the commands and scripts to interact with PyMOL and allow one to work more reproducibly or accomplish repetitive tasks.


How to use PyMOL using scripts and the API

While using PyMOL via a mouse and display is how people tpyically use PyMOL, it isn't the only way.
If you want to use PyMOL reproducibly or do repetitive tasks in a largely automated way using scripts and the API, see here for PyMOL use via commandline on Jupyter using MyBinder.


Extending PyMOL's abilities

There's software availabe that extends PyMOL's abilties and features. For example, psico is a python module which extends PyMOL with many commands. I have made a separate repo here as a playground for adding such extensions. See there and the 'Technical details' below for guidance if adding these to this remote-served PyMOL interests you.


Technical details

Click to expand and see technical details from July 8th 2025 onward

July 8th 2025, I have restored to a working state. The version of the desktop Jupyter with PyMOL installed and working as a GUI. This is based on the Linux Desktop offered by Spyder here and no longer the version I used before that is more detailed under older technical details below.

In addition to restoring it to working again in MyBinder, this addsa Remote Clipboard tool in the upper right corner that makes it possible to pass text into and out of the remote virtual machine where is this running. This is amazing.

The current version of PyMOL here now is the open source one detailed here and here and here <=== Probably the most, that most people are looking for.

I do note there is also this one that would require dismissing the activation. That was the one I used prior but switched for now to the open source to see how it goes.

Click to expand and see technical details from October 27th, 2021 to July 8th 2025

October 26th, 2021, I had restored to a working state. the version of the desktop Jupyter with pymol installed and working as a GUI. This was the version of the desktop and Pymol that looked okay but graphically wasn't the best. It was based on what here is based on. I plan to leave that in the current state because I found on October 26th probably good to have some variants of this tech available since it can be a bit fragile and having things that I knew worked in past can be useful.
Lately, I had seen that here updated the Linux remote desktop look be nicer and have a better user experience. For example, in addition to the better graphics, you no longer had to choose 'Use default config' button after launch. Thought since better, it may help impove using PyMOL via this system, too, and so I made repository here, where I could adapt the current version of here to add in PyMOL. I succeeded in adding it in there and PyMOL worked with the better linux desktop interface (BETTER GRAPHICS AND DESKTOP EXPERIENCE) as of October 27th, 2021, in launches from this version. On October 27th, 2021, I converted this repo over from the previous desktop experience to the updated Linux dekstop experience based on here in the hopes I can easily now share the better desktop experience with PyMOL (BETTER GRAPHICS AND DESKTOP EXPERIENCE) instead of the older graphics experience that while useable, was not nearly as good as working with PyMOL directly on a computer. I find the experience based on here seems very close to working with it on your own machine if you expand the browser window and then click drag the PyMOL window inside the desktop view.

For now, it is basic PyMOL. I have removed the psico python module that extends PyMOL with several commands, as well as the rna-tools. In fact, I decided a separate place for running/testing extensions may be in order as I have referred people here for PyMOL now and would be best to maintain an experience close to what they'd have if installed the standard software. See https://github.com/fomightez/Jupyter-desktop_with_pymol_plus_extensions/ for that.

Click to expand and see technical details prior to October 27th, 2021.

This repo was originally meant to be able to run pymol_preview_generator.py from here; however, the XFCE desktop doesn't seem to allow the icons to be changed (even using gio set), and so that was a dead-end effort for now. However, since PyMOL did at leat work in the desktop GUI, I left it in this state and a use case arose later where I could use it for training.

Presently, PyMOL installed here has the psico python module that extends PyMOL with several commands. For example, presently load_aln and xfit are ready-to-use. Note that the addition of this module means save and fetch become 'overloaded with extra abilities as described here unless you use the psico.init approach specified there when importing. The fact psico doesn't even carry all the abilities needed, for example, xfit requirs the dependency csb is a reason I like using Binder when installing various combinations of 'extras' to test. This way I know my local installation will remain intact and I can just easily roll the repo back if something breaks, with no effect on anything else.

Original source repo allows running Run XFCE (or other desktop environments) on a JupyterHub. Source based on https://github.com/ryanlovett/nbnovnc and a fork of https://github.com/manics/jupyter-omeroanalysis-desktop .

Details on some of the underlying tech is found under 'Details' here. pymol_preivew added from here. PyMOL added as described here.

Originally, dimensions of the desktop geometry were set to '1680x1050' due to original source repo, but PyMOL interface was overly pixelated; copied '1024x768' geometry from here.

This had stopped working apparently when they updated behind-the-scenes of Binder in late summer/eary Fall 2021 (the change that made JupyterLab the default). Luckily, the headless one here continued to work and show it had PyQt5 installed and working which is what I thought was the issue with this one as a I attempted to fix before realizing PyQt5 worked there. And after much fussing around in October 2021, I got it back to working based on that repositories apt.txt and environment.yml as the basis. It did say, "There was an error initializing GLEW. Basics graphics, including shaders and volumes may be unavailable." However, I don't know if I overlooked this earlier and this is much improved since nothing was working in the last few days. While trying to fix the PyQt stuff, I had based on here also added several items to apt.txt that I didn't have before. Realized in looking for help fixing PyMOL on remote session in October 2021, that this list comes from here under what would be necessary for compiling. For now they are there; I meant to check if necessary or not. Also, I don't know what changed behind-the-scenes of Binder in late summer/eary Fall 2021. I guess the desktop version had additional stuff that got removed and this additional stuff made it so I didn't have to add much to apt.txt here prior to recently, so that it was simpler than the apt.txt at my HEADLESS-working pymol-binder. Odd, but I'm glad I had two different ones, one being more reliant on just what is in a repo, at the time.


Binder

About

Jupyter-Desktop with PyMOL installed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published