Links for Molecular Structure Analysis and Graphics in Biomedical Sciences
This is a five week course (15 hours) offered in the Spring Semester at OUHSC every year since 2010. The purpose of the course is to build the competence of gradute students in interpreting molecular strutures of proteins. We use PyMOL to visualize molecular strutures and other software to analyze the structures. All of the software listed on this webpage is free to academics. We do not do any programming. However, the skills gained and principles understood by working with the software will transfer to other biomolecular software that the students will encounter later in their research careers. We use the book Structural Bioinformatics edited by Gu and Bourne as a textbook.
1 Introduction and PyMOL Installation
2 PDB files and PyMOL Basics
3 Heteroatoms and Molecular Surfaces
4 Structure Evaluation
5 Protein Evolution and Prediction of Protein-Protein Interations
6 Structure Superposition and Identifying Molecular Motion from Static Models
7 Modeling and Dynamics
8 Using Rosetta with PyMOL
9 Ligand Docking and Designing Mutants
10 Molecular Movies and Journal Cover Art
PyMOL was developed by Warren Delano starting in 1998 until his untimely death in 2009. PyMOL is now maintianed by Schrödinger Inc. The program is written in C for fast execution. The users interact with the PyMOL binary through a Python-based interface, hence the Py in PyMOL. The current binaries are available to subscribers who pay an annual subscription fee. New binaries are released about once every four months. The improvements are minor and incremental and sometimes break existing features. It is a good idea to hang onto several earlier versions. A version number greater than 1.72 is current enough for most purposes. The subscribers also get access to on-line documentation and to personalized technical support from the developers of PyMOL. The latter is helpful if you want to do something that is not available already through existing commands or scripts.
The large and active community of users have added a lot of functionality to PyMOL by contributing scripts and plugins and suggestions for better or new features. To acknowledge the contributions of the user community contributions, the penultimate and older binaries are available for free from other sources. I suggest using the other sources until you know that you will be using PyMOL frequently. The source code is available at sourceforge.net. However, it is a challenge to install PyMOL from source because you have to have a number of other dependent software already installed. I have succeeded in compiling PyMOL from the source code only on Ubuntu Linux. See the Linux install link below.
Free, unsupported sources of PyMOL
- For all platforms, the easist approach is to install PyMOL from the PyPI repository of Python software. You need to have Python 2.7 installed. You may need to install the program easy_install and then pip. Next, on the command line, enter sudo -H pip install pymol. You can upgrade at a later time with the command sudo -H pip install --upgrade pymol. This form of PyMOL is launched by typing on the command line pymol.
- Installing PyMOL on Windows. Detailed instructions on the PyMOL Wiki.
- Source of PyMOL installers for Windows. Visit the above link first. You need to know the version of your computer's Python. Check on the command line within an interactive Python session by entering import sys;print(sys.version). You also need to understand how to use *.whl files to install software. See the PyMOL mailing list for posts about recent installation issues. You can also try searching forpymol on StackExchange.com
- Installing PyMOL on Mac. These directions are at the PyMOL Wiki. You will need to have installed in advance the free Xcode software (you will have to register for free as a developer even though you are not one), the command line tools, and Xquartz.app . You may have already install these software for other scientific programs that depend on X11. Then try using pip to install pymol as outlined above.
You can also install PyMOL via one of the other software repositories for macOS: macports, fink, or homebrew. Select only one repository because they do not interact well together. I have used all three. I currently use macports, and I do not plan to switch because I find the documentation for the other repositories to be too hard to follow when I am having trouble installing software. PyMOL from these repositories is invoked by typing pymol on the command line. PyMOL from pip or the other repositories have the advantage of allowing access to the your other Python modules from within PyMOL. If you do not understand what that means, do not worry; it is not important to the basic operation of PyMOL.
- Installing PyMOL on Linux. Note that the Ubuntu the version of PyMOL that is installed with apt-get is often out of date by seveal years but good enough for most uses.
Official source of PyMOL binaries
PyMOL.org. Source of paid current versions and free eductional versions of PyMOL. These binaries are generally easier to install. Howeve,for the Mac, you still need to have installed Xcode, the command line tools, and Xquartz.app in advance of installing PyMOL to able to convert MacPyMOL to PyMOLX11Hybrid. Only the hybrid version gives you the ability to install plugins. Xquartz is needed anyways to run X11 dependent scientific software on the Mac, so you will probably need Xquartz.app eventually.
Customizing your pymolrc file
The pymolrc is an optional file in your home diretory that is read on startup by PyMOL. You put PyMOL Scripting Language commands or Python commands or settings in this file that are executed on startup. For example, it is useful to startup with a white background, so add the line bg_color white
. Add one command per line (a vertical script) or join the commands with semicolons on one line (a horizontal scirpt).
Quick starts in PyMOL
There are dozens of the videos about PyMOL on YouTube, if you are patient enough to sit through them. Below at are some guides that may be a faster way to get going.
- Bare essentials of PyMOL. This self-guided tutorial takes 20-40 minutes to work through. It covers the essentials, including saving an image to a file and rendering images in 3D for use witn red-cyan glasses. These glasses are very inexpensive and clip on versions are available.
- Practical PyMOL For Beginners. This tutorial is more extensive than one above, and it is illustrated.
Sources of answers to frequently asked questions
- PyMOL Wiki Main Page A very extensive collecton of web pages. The first place to go for answers. Now maintained by the Strutural Biology Grid based at Harvard U. Actually, the new table of contents page is more useful for finding information. The old table of contents page is still useful too.
- PyMOL mailing list. The vast archives of past posts go back to 2001 and are a good place to search for answers to questions that others have asked.
- FAQs about PyMOL at source forge. This is also the location of the source code.
- PyMOL questions and answers on stackexchange. Stackexchange has a rich collection of questions from the frequent and trivial to the arcane and interesting.
- Warren L. DeLano 2004 PyMOL manual This is the official and free manual about PyMOL. Subscribers have access to on-line documentation. I am a subscriber, but I never use the latter because of I am too impatient to login. I relie on Google, the PyMOL Wiki, and the PyMOL User mailing list.
PyMOL commands, settings, and colors: the Nuts-and-Bolts of getting stuff done
The real power of PyMOL is in the exquisite control of the image provided by its commands and settings. For example, the ray command has over 50 settings! There is also exquisite control over the colors and the spectra used. You can string these commands and settings together on the command line with semicolons to form a horizontal script (watch this 4 minute video video and vist this webpage, which explains horizontal scripting) that is easy to edit after recalling the executed code with the up arrow key. Try it! You will like it! But be careful. Horizontal scripting can be addictive!
The PyMOL Scripting Language syntax may seem strange at first. The syntax is simply Python function calls without the parentheses and double quotes. If you do not know Python, you can still figure out the syntax quite quickly.
- Commands. The verbs of PyMOL.
- Psico An additional set of commands from the Psico package--not part of the base distribution of PyMOL. These commands extend the capabiities of PyMOL.
- Settings. The adjectives of PyMOL. There are over 600 of them!
- Colors. This page includes the spectral range color schemes.
- Representations. This page includes an index of web pages about each representation. Each webpage has a list of the relavant settings. A good place to go to quickly explore your options alternative representations.
- Biochemical Properties. This page is an index to 18 others pages about functions and scripts for measuring various biophyiscal properties of molecular structures.
Scripts and Plugins
The PyMOL commands are written in a user readable syntax. They are stored in plain text files with the file extension pml. They can be run by entering @ followed immediately by the name of the script file (e.g, @first.pml). I use this kind of script to make and edit figures for publication and movies for presnentations. The script enables me to tweak the figure at a later time or to use it as a template to make a similar figure with a new structure. The regulaur use of scripts enables the practice of reproducible research, so their use is a good habit to adopt, just like the keeping of laboratory notebook.
The pml scripts are limited in their ability to call external programs and modules. Python scripts (they have the file extension py) are used for this purpose. Fortunately, the PyMOL commands can be included directly into Python scripts as arguments to the pymol.cmd() function. Python scripts are not as easy for nonprogrammers to interpret as the pml scripts.
Python scripts extend what can be done with PyMOL. Some Python scripts run external programs. You may have to install these external programs separately.
Plugins are Python scripts dressed up with graphical user interfaces (GUIs). The GUIs ease the initial exploratory use of a script. For this reason, they are required by the reviewers of papers about scripts. Plugins are not useful for large scale comparative studies due to the tedium and errors that occur with manual entry of parameter values for each structure.
A collection of user-supplied scripts and plugins are stored in a repository on GitHub. You can install of these scripts and plugins locally by using the program git. Git is installed on the macOS with the Xcode command line tools. It can be invoked from the command line. It is used retrieve software from GitHub.com and to track updates to documents in plain text locally. On other operating systems, you may have to install git; use the link to the left to learn more. After installing git on your computer, you type git clone git://github.com/Pymo-Scripts/Pymol-script-repo.git in the folder where you want to store the plugins. This command will create the subfolder Pymol-script-repo. You can then use in PyMOL the very powerful built-in plugin manager developed by Dr. Thomas Holder to load these scripts and plugins into PyMOL. Later, you can go to the Pymol-script-repo folder and type git pull origin master to update your collection of plugins and scripts with new versions of the scripts and plugins and with new scripts and plugins that have been added to the repository since your last update. The use of git to retrieve and update your collection of plugins saves many hours of manual work. The plugin manager has also saved countless of hours of frustration with plugin installation. Unfortunately, not all scripts and plug-ins are stored in the git repository. Use PubMed, Google, or both to find additional PyMOL scripts and plugins.
If you want to write your own plugin, there is a simple tutorial on the PyMOL Wiki. PyMOL uses the Python module Tkinter for plugin GUI development.
Text editors are used to look inside PDB coordinate files and to edit PyMOL script files. PyMOL lacks a built-in text editor, although the text box in the command line of the external GUI does allow the copying and pasting of commands. PDB coordinate files and script files are written in plain text. MS Word (and TextEdit on macOS) write out documents to binary files by defualt. They are not really appropriate for editing plain text files. The following links are to free text editors that have GUIs. Just pick one to install if you do not have a favorite one already. I recommend Sublime Text 3 because it is intuitive and has sharp color contrast with syntax highlighting that eases the editing of script files. The simple command line editors nanoand pico may already be installed on your computer. They work well enough to get the job done, but they lack color highlighting. The command line editors vim and emacs are very powerful, but they take months of daily practice to master.
Platform Independent, GUI-based Text Editors:
- Sublime Text 3. You can test a trial version of this program indefinitely. You can use the Package Control to install a pymol language highighter.
- Atom. This editor is less initutive but more powerful. You can install the language-pymol package, which is derived from the Pymol.tmbundle for TextMate, which runs only on macOS.
Text Editors For Windows:
Text Editors For Mac:
- Exquistive control over appearance of molecular structure.
- Large and helpful user community.
- Readily extended with scripts and plugins. If you can imagine it, you can do it in PyMOL.
- Most popular program for making molecular movies.
- Most popular program for making images of molecules for journal cover artwork.
- Most frequent molecular viewing program in larger structural biology software packages.
- Has survived for 20 years. It will probably last another 20 years because it is so adaptable. li>
- It can be extended with Python, which is becoming the most popular programming language in scientific computing. li>
Good alternatives to PyMOL
There are many molecular graphics packages beyond PyMOL. I have listed ones that have caught my attention.
Jump back to top
- UCSF Chimera Loaded with advanced structural analysis tools. Easily extended with Python scripts.
- ccp4mg Excellent for making quick and striking images of crystal structures.
- JMOL Very feature rich and customizable with scripts. Not as much precise control over appearance of the structure as with PyMOL, but you can still make publication quality figures.
- JSMOL A version o of JMOL that runs interactively in HTML5 webpages. Excellent for displaying molecules on the web.
- Molscript The venerable program for making molecular images as vector graphic files rather than as png bitmap files as from PyMOL. Molscript had been a commericial software package. It is now open source and available on GitHub.com.
- Molsoft Browser Free viewer assoicated with a proprietary software suite that is designed to assist structure-based drug design.
- Raster3D Photorealistic Molecular Graphics. Raster3D makes distinctive figures.
- VMD Visual Molecular Dynamics. The molecular graphics viewer for the NAMD molecular dynamics package.
- Yasara Yet Another Scientific Aritificial Reality Application. The free viewer makes striking figures with little effort. Proprietary versions enalbe interactive molecular dynamics.
Chapter 10 in Gu and Bourne: PDB, mmCIF and other data formats
- PDBEditor Java base PDB file viewer and editor. It is very powerful it is ability to make selections.
- PDB file format guide This document explains the fixed column format of the traditional PDB file. Many programs depend on this outdated format. It will likely be in used for another decade. It may be replaced with modern file formats that are flexible but hopelessly hard to read.
- BioPandas This is a Python module that works with molecular structures in pandas-like DataFrames.
Chapter 11: The Worldwide Protein Data Bank
This chapter explains the organization of the the Protein Data Bank.
- wwPDBThe Worldwide Protein Data Bank
- RCSB (US PDB)Research Collaboratory for Structural Bioinformatics
- PDBeProtein Data Bank in Europe
- PDBj Protein Data Bank Japan
- NDB Nucleic Acid Database
Physical Molecular Models
Molecular Models as Art
Jump back to top
- Metal Sites in Proteins, MESPEUS database. This actively curated database has valuable statistics on metal--protein ligand bond lengths and angles.
- Molesoft Browser Pro, this is an alternative molecular graphics program that has been customized for structure-based drug design.
- ValLigURL,Ligand Validator at Uppsala University
- PRODRG,this website can return the coordinates of a molecule supplied with a simple 2D diagram in a plain text file. The number of times that you can access this site per day are limited due to its heavy use.
Molecular and Electrostatic Surfaces
Jump back to top
Jump back to top
- MOLPROBITY. The site is used to evaluate the quality of protein and nucleic acid crystal structures. The program uses atom-atom clashes to evaluate struture quality after adding hydrogens. It also provides a current version of the Ramachandran plot. It can be run on-line. The kinemages can be viewed on-line or off line with the King.app. The latter depends on Java. You also have to allow the running of Java programs on your computer under your system preferences.
- pymolprobity A Molprobity visualization plugin for PyMOL.
- SF-TOOL which is used to check x-ray data quality.
- TLS Motion Determination Home
Protein-Protein Interaction Databases:
Jump back to top
The overlaying or superposing of molecular structures has to be done thoughtfully to lead to meaningful interpretations.
Jump back to top
Links cited in lectures
Homology Modeling Software
Homology Model Quality Checking
Related links about molecular dynamics, not covered in course
Jump back to top
Extending the PyMol Viewer
Other Rosetta Labs
Jump back to top
Cover Art Related Sites
Jump back to top