PyMOL is a molecular visualization tool widelyused by the Rosetta community.
The PyMOL Wiki containsdocumentation on the program methods and numerous examples. Beginnersshould startwith this tutorial.A simple workshop is part of thePyRosetta tutorials.
PyMol is a molecular visualization software that allows to display and study protein & other molecular structures in 3D. Pymol could also be extended using short python scripts.
- PyMOL is an open-source molecular visualization system created by Warren Lyford DeLano. This program can produce high-quality 3D images of small molecules and biological macromolecules —and is one of the few open-source model visualization tools available for use in.
- ” PyMol is a multiplatform molecular graphics software with many advanced features such as rendered cartoon ribbons and surfaces, internal ray tracing and movie tools and is fast becoming the new “standard” in molecular graphics.
If you are building PyMOL from source on Linux (this does not take longand is explainedhere) then you mayneed to install the python-dev and glutg3-dev packages and possibly themesa-common-dev package as well. Some notes on building PyMOL for Python 2.7 on a Python 3 system are included below.
Information on making movies in PyMOL can be found at http://www.pymolwiki.org/index.php/PLoS.
PyMOL_Mover
PyMOL is so popular in the community, we developed a Mover to sendRosetta data directly to PyMOL.
PyMOL Side
Setting Up PyMOL
In PyMOL, run the PyMOL-RosettaServer.py script, found at<path to Rosetta main>/source/src/python/PyRosetta/src/PyMOL-RosettaServer.py
(the main directory of PyRosetta). This willstart the listener and output information about the connectionestablished. No further work should be required to view PyMOL_Moveroutput from the same computer.
We recommend creating a .pymolrc
file in your home folder, and adding the following line:
run <path to Rosetta main>/source/src/python/PyRosetta/src/PyMOL-RosettaServer.py
This way is convenient: the PyMOL-Rosetta link is established each time you start PyMOL.
Changing PyMOL Listener IP
start_rosetta_server
It's that simple. This method of the Server script automatically connectsto the machine's current IP. This IP address can be set manually and theServer script defaultly connects at 127.0.0.1. Make sure that theconnection is to an accessible IP and that the PyMOL_Mover isoutputting to that IP. To change the IP manually use either commandbelow at a PyMOL command prompt:
start_rosetta_server 187.1.3.37, 9001
or
cmd.start_rosetta_server('187.1.3.37','9001')
Rosetta Usage
Here are the options for observing a Rosetta simulation through JD2, Rosetta's job manager). See below for PyRosetta code.
- Attach PyMOL observer to pose at the beginning of the simulation, and outputs a new PyMOL 'state' every seconds. A value of 0 indicates to not skip any packets from sending! Don't forget to run the PyMOLPyRosettaServer.py script within PyMOL!
- default = 'false',
- 'Only Update the simulation in on energy change. Useful if pymol observer is segfaulting on length changes.
- default = 'false'
- Only update the simulation in pymol on conformation change.
- default = 'false'
- Keep history when using show_simulation_in_pymol flag?
PyRosetta Usage
Sending Structures
Application of the mover sends pose coordinate data to PyMOL renderingan image of the structure. Simply apply the mover to a pose. You canachieve the same results by using dump_pdb to produce a .pdb of thepose and load it into PyMOL...but the mover is much faster and avoidsunnecessary file writing. pymover = PyMOL_Mover() pymover.apply(pose)
Sending Energy
Use the send_energy method to color the structure in PyMOL based on theresidue relative energies. Currently, the color spectrum spans from blue(low energy=happy) to red (high energy=sad). Make sure the pose has beenscored first. The send_energy can accept a ScoreType name and colorresidues in PyMOL based on this score term of the last score functionapplied.
pymover.send_energy(pose) pymover.send_energy(pose,'fa_atr') pymover.update_energy=True pymover.apply(pose) pymover.energy_type='fa_sol' pymover.apply(pose)
The PyMOL_Mover features a update_energy option which, when True,automatically colors residues by energy when the Mover is applied. Thescore term sent can be set with the PyMOL_Mover.energy_type option.
Changing Mover IP
To send PyMOL_Mover output to a new IP address, simply change thePyMOL_Mover options as specified below:
pymover.link.udp_ip = '127.0.0.1' pymover.link.udp_port = 65000 pymover.apply(pose)
Keeping History
Another useful PyMOL_Mover feature is the keep_history flag. Whenmarked True, poses with the same 'name' (see below) are loaded into newstates of the associated PyMOL object ie. applying the PyMOL_Mover doesnot overwrite the structure in PyMOL but instead loads it into the nextstate. Protocol movies can be created easily using PyMOL's moviebuilding features and these output states.
pymover.keep_history=True pymover.apply(pose) other_mover.apply(pose) pymover.apply(pose)
To accurately view intermediate changes, you can change the pose name.This will result in a different object when the pose data is loaded intoPyMOL. To change a pose name use: pose.pdb_info().name('new_name')
Remember, color in PyMOL is per object NOT per state so any successivecoloring will erase the old coloring (another reason you may want tochange the pose name when inspecting a protocol).
PyMOL Observer
The PyMOL_Observer object waits for 'events' to happen on the pose andwhen triggered, applies its own PyMOL_Mover to the structure. This isideal for situations where you don't want to apply the mover directly,such as lengthy protocols or quick inspection. Since a PyMOL_Observerhas a PyMOL_Mover, all the options above can be set on its mover(called pymol) including keep_history, link.udp_ip, andupdate_energy.
pyobs = PyMOL_Observer() pyobs.add_observer(pose) pyobs.pymol().update_energy=True
Getting PyMOLObserver working on a Python3 system
The Pymol Molecular Graphics System
Some Linux systems, including Arch based linux such as Manjaro, Antergos and ArchBang, now ship with Python3 as the default.Python2 is also available.Pymol (installed with Python3) does not work with Rosetta's PyMOLObserver.
For compiling and installing Pymol with Python2.7, for a version compatible with Rosetta:
1) RequirementsLibraries as well as development files (headers) of the following software is required:
- Subversion
- Python (with distutils)
- Pmw (Python Megawidgets)
- OpenGL driver (NVidia works)
- GLEW
- GLUT (freeglut)
- libpng
- freetype
- libxml2 (optional, for COLLADA export, disable with --no-libxml)
- msgpack-c 1.0+ (optional, for fast MMTF loading, new in SVN r4167, disable with --use-msgpackc=no)
2) Get latest source from SVNLet's say we will download the Pymol source code to /tmp. This will download the latest source to /tmp/pymol:
3) Compiling and installing PymolPymol Tutorial
This will install PyMOL as normal user into ${HOME}/pymol-svn:
Now launch PyMOL like this:To add this new PyMOL to your path:4) Connecting to RosettaSo long as you are using this freshly-built pymol, it will work with Rosetta normally; do not use a previously-installed Python3 PyMOL by mistake.
Pymol Tutorial
Pymol Commands
See Also
Pymol Tutorial
- PyMolMover: RosettaScripts PyMolMover documentation
- Graphics and GUIs: Home page for graphical interfaces with Rosetta
- Comparing structures: Essay on comparing structures
- Extending the PyMol Viewer: How to add new functionality to Rosetta's PyMOL Mover
- PyRosetta Toolkit: Tutorials for using/modifying the PyRosetta Toolkit GUI
- PyRosetta Toolkit GUI: Information on the PyRosetta Toolkit user interface
Pymol Wiki
PyMOL can interpret over 30 different file formats from PDB files to multi-SDF files to volumetric electron density maps. PyMOL's straightforward graphical user interface allows first-time and expert users alike to create stunning 3-D images from their favorite file formats. Images and movies can then be saved in a cross-platform Session file, ensuring that every object position, atom color, molecule representation, molecular state, frame, and movie can be viewed by colleagues exactly as intended.
Using PyMOL, data can be represented in nearly 20 different ways. Spheres provides a CPK-like view, surface and mesh provide more volumetric views, lines and sticks put the emphasis on bond connectivity, and ribbon and cartoon are popular representations for identifying secondary structure and topology. PyMOL's quick demo, accessible through the built-in Wizard menu, gets users started with all of the standard representations.
Features:
VIEW 3D Molecular Structures
RENDER Figures Artistically
ANIMATE Molecules Dynamically
EXPORT PyMOL Geometry
PRESENT 3D Data with AxPyMOL
DEVELOP with JyMOL