Sometimes we need to access old versions of Pymol [1]. Running some plugins on Pymol is difficult due to Python incompatibility. New Pymol versions require Python 3.x whereas older versions run on Python 2.x. Therefore, we need to maintain multiple versions of Pymol on a single system. In this article, we will install Pymol 1.7.x along with the latest version (Pymol 2.5.2) on Ubuntu. Later, we will create shortcuts for them.
Preparing the system
$ sudo apt-get update
$ sudo apt-get upgrade
Downloading Pymol version 2.5.2
To download the latest version of Pymol, just go to this page and click on ‘Download’. You can also download using the following command.
Let’s change to the directory where we want to download Pymol, here we are downloading in ‘Downloads‘.
$ cd Downloads/
$ wget https://pymol.org/installers/PyMOL-2.5.2_293-Linux-x86_64-py37.tar.bz2
Downloading Pymol version 1.7.x
It is a bit complicated to download this version of Pymol because it is not easily available. So, go to this page and it will display a form to get a license. If you would like to get a license then fill out the given form or if you want it for educational purposes then look under the ‘Students and Instructors‘ section. You will find a link or just click here. Register yourself with an institutional email address. Later, you will get a link along with a username and a password. After logging in, you will see different versions. I could not find 1.8.x but there is 1.7.x which also requires Python 2.x to run. So, this one is also fine. Download the tar file.
Installing Pymol version 2.5.2
Now make a directory, you can name it whatever you want. We are naming it ‘Pymol2.5.2’.
$ mkdir Pymol2.5.2
Move the downloaded tar file to this directory as shown below or just simply cut-paste using the GUI.
$ mv PyMOL-2.5.2_293-Linux-x86_64-py37.tar.bz2 /home/username/Downloads/Pymol2.5.2
If this doesn’t work, then use sudo. Now move inside the newly-created directory.
$ cd Pymol2.5.2/
Now extract the tar file.
$ tar xjf PyMOL-2.5.2_293-Linux-x86_64-py37.tar.bz2
It will create a new directory named pymol. Inside this directory, you will find a file named ‘pymol’. This is the file that you can run from the terminal and will start the Pymol version 2.5.2.
$ cd pymol/
Remember the complete path, we are in ‘/Downloads/Pymol2.5.2/pymol‘. Now, just run the following command to start pymol.
$ ./pymol
Installing Pymol version 1.7.x
We are going to follow the same steps as shown above for the latest version.
Create a new directory. We are naming it ‘Pymol1.7’. Move the downloaded tar file into this directory. Extract it and you will be able to run the old version.
$ mkdir Pymol1.7
$ mv PyMOL-1.7-Linux-x86_64.tar.bz2 /home/username/Downloads/Pymol1.7
$ cd Pymol1.7/
$ tar xjf PyMOL-1.7-Linux-x86_64.tar.bz2
It will create a new directory named pymol. Inside this directory, you will find a bin directory and inside this, there is an executable file named ‘pymol‘. This is the file that you can run from the terminal and will start the Pymol version 1.7.
$ cd pymol/
You can see that both the versions create new directories named ‘pymol’. Don’t get confused with that.
Remember the complete path, we are in ‘/Downloads/Pymol1.7/pymol‘. Now, just run the following command to start pymol.
$ ./pymol
Creating shortcuts
Now since we are able to run both versions successfully. But it is not convenient to provide a complete path to the pymol executables every time. Therefore, we are creating desktop shortcuts, then you will be able to run them just by double-clicking on the shortcuts. For now, we are creating this file on the Desktop. Later, we will move it to the destination folder.
Creating shortcut for Pymol version 2.5.2
Create a file named ‘Pymolv25.desktop‘ and open it in an editor. Paste the following. Remember to replace ‘user‘ in the path with your actual username.
[Desktop Entry] Name=Pymolv25 Comment=Get help with GNOME # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! Keywords=documentation;information;manual;help; OnlyShowIn=GNOME;Unity; Exec=/home/user/Downloads/Pymol2.5.2/pymol/bin/pymol Icon=/home/user/Downloads/Pymol2.5.2/pymol/share/pymol/data/pymol/icons/icon2_128x128.png # Translators: Do NOT translate or transliterate this text (this is an icon file name)! StartupNotify=true Terminal=false Type=Application Categories=GNOME;GTK;Core;Documentation;Utility; MimeType=x-scheme-handler/ghelp;x-scheme-handler/help;x-scheme-handler/info;x-scheme-handler/man; X-Ubuntu-Gettext-Domain=yelp
Save this file.
Creating a shortcut for Pymol version 1.7.x
Both the versions use the same logo (the yellow one). Therefore, to differentiate between these two versions, I downloaded another Pymol icon. You can download any different logo and save it in the pymol1.7 directory as ‘logo.png’. Create a file named ‘Pymolv17.desktop’ and open it in an editor. Paste the following.
[Desktop Entry]
Name=Pymolv17
Comment=Get help with GNOME
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=documentation;information;manual;help;
OnlyShowIn=GNOME;Unity;
Exec=/home/user/Downloads/Pymolv1.7/pymol
Icon=/home/user/Downloads/Pymolv1.7/logo.png
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;Core;Documentation;Utility;
MimeType=x-scheme-handler/ghelp;x-scheme-handler/help;x-scheme-handler/info;x-scheme-handler/man;
X-Ubuntu-Gettext-Domain=yelp
Save this file and close.
Now, move both of these files to /usr/share/applications.
$ sudo mv /home/user/Desktop/Pymolv25.desktop /usr/share/applications
$ sudo mv /home/user/Desktop/Pymolv17.desktop /usr/share/applications
Now change to /usr/share/applications/ and give permissions to both files.
$ cd /usr/share/applications/
$ sudo chmod +x Pymolv25.desktop
$ sudo chmod +x Pymolv17.desktop
You will see the shortcuts in your Applications. Later on, you can pin them as your favorites so they will appear on Dock.
What if shortcuts don’t appear in the Applications?
It might be possible that the shortcuts won’t appear in the Applications. In that case, do the following.
- Go to /usr/share/applications and copy any shortcut that is available on your desktop. For example, Anydesk.
$ cd /usr/share/applications/
$ sudo cp anydesk.desktop Pymolv25.desktop
- Now, edit the file.
$ sudo gedit Pymolv25.desktop
OR
$ sudo nano Pymolv25.desktop
- Change the name, exec, and icon path in the Pymolv25.desktop file.
- Similarly, do the same for the Pymolv17.desktop file.
Now, enjoy both versions of Pymol!
References
- The PyMOL Molecular Graphics System, Version 1.2r3pre, Schrödinger, LLC.