Introduction to PyMOL: Exploring Molecular Structures in 3D

March 14, 2024 Off By admin
Shares

Course Description: This course provides an introduction to PyMOL, a powerful tool for visualizing and analyzing molecular structures in 3D. Participants will learn the basic principles of molecular visualization, how to use PyMOL’s interface, and how to perform common tasks such as loading structures, selecting atoms, and creating publication-quality images.

Prerequisites: Basic understanding of bioinformatics and molecular biology concepts is recommended but not required. Familiarity with Python scripting can be beneficial for advanced topics.

Target Audience: The course is suitable for students, researchers, and professionals in the fields of bioinformatics, structural biology, chemistry, and related disciplines who want to learn how to visualize and analyze molecular structures using PyMOL.

Introduction to Molecular Visualization

Overview of PyMOL and its features

PyMOL is a powerful and popular molecular visualization tool used by scientists and researchers in structural biology, bioinformatics, and related fields. It allows users to visualize and analyze molecular structures in 3D, making it an invaluable tool for understanding the structure and function of biological macromolecules such as proteins, nucleic acids, and small molecules. Here is an overview of PyMOL and its features:

  1. Molecular Visualization: PyMOL provides high-quality 3D visualization of molecular structures, allowing users to rotate, zoom, and manipulate structures to gain insights into their spatial arrangement.
  2. Structure Editing: PyMOL allows users to edit molecular structures, such as adding or removing atoms, residues, or bonds, to create custom structures or models for visualization and analysis.
  3. Surface and Volume Rendering: PyMOL can generate molecular surfaces and volumes to visualize molecular shapes and properties, such as electrostatic potentials or solvent-accessible surfaces.
  4. Molecular Animation: PyMOL can create molecular animations to visualize dynamic processes, such as protein folding, ligand binding, or molecular dynamics simulations.
  5. Electron Density Maps: PyMOL can display electron density maps obtained from X-ray crystallography or cryo-electron microscopy (cryo-EM) to visualize the density of atoms in a molecular structure.
  6. Measurement and Analysis Tools: PyMOL provides tools for measuring distances, angles, and dihedral angles in molecular structures, as well as tools for analyzing hydrogen bonding, molecular contacts, and surface area.
  7. Scripting and Customization: PyMOL is highly customizable and extensible through Python scripting, allowing users to automate tasks, create custom visualizations, and integrate PyMOL into larger workflows.
  8. Integration with Other Tools: PyMOL can import and export molecular structures in various file formats, allowing for compatibility with other molecular modeling and simulation software.

Overall, PyMOL is a versatile and powerful tool for molecular visualization and analysis, making it an essential tool for researchers in structural biology, bioinformatics, and related fields.

Importance of molecular visualization in bioinformatics and structural biology

Molecular visualization plays a crucial role in bioinformatics and structural biology for several reasons:

  1. Structural Insights: Visualizing molecular structures in 3D helps researchers gain insights into the spatial arrangement of atoms and molecules, which is critical for understanding their function and interactions.
  2. Drug Discovery: Molecular visualization is essential for drug discovery and design, allowing researchers to visualize how potential drug molecules interact with target proteins and predict their binding affinity and specificity.
  3. Protein Function Prediction: By visualizing protein structures, researchers can predict the function of unknown proteins based on their structural similarities to known proteins with known functions.
  4. Structural Alignment: Molecular visualization tools allow for the alignment of multiple protein structures, which is useful for comparing structures, identifying conserved regions, and studying evolutionary relationships.
  5. Molecular Dynamics Simulations: Visualization is essential for analyzing the results of molecular dynamics simulations, which are used to study the movement and behavior of molecules over time.
  6. Education and Communication: Molecular visualization is valuable for teaching complex biological concepts and communicating research findings to a broader audience.
  7. Structure Validation: Visualization tools are used to validate the quality of experimentally determined protein structures, such as those obtained from X-ray crystallography or cryo-electron microscopy.
  8. Model Building and Refinement: Molecular visualization tools are used for building and refining molecular models based on experimental data, such as electron density maps.

Overall, molecular visualization is an essential tool in bioinformatics and structural biology, enabling researchers to study complex biological systems, make informed predictions, and advance our understanding of the molecular basis of life and disease.

Getting Started with PyMOL

Installation and setup

To install PyMOL, you can follow these general steps. Note that the exact steps may vary depending on your operating system (Windows, macOS, Linux) and the version of PyMOL you are installing (open-source PyMOL, PyMOL 2, etc.):

  1. Download PyMOL: Visit the PyMOL website (https://pymol.org/) and download the appropriate installer for your operating system.
  2. Install PyMOL: Run the installer and follow the on-screen instructions to install PyMOL on your computer. Make sure to select any desired options or components during the installation process.
  3. License Activation (if applicable): If you are installing a commercial version of PyMOL, you may need to activate your license during the installation process. Follow the instructions provided with your license key.
  4. Launch PyMOL: Once PyMOL is installed, you can launch it from the Start menu (Windows) or the Applications folder (macOS). If you are using a Linux distribution, you can launch PyMOL from the terminal by typing pymol.
  5. Setup Preferences (Optional): You can customize PyMOL’s settings and preferences by navigating to the Preferences menu in PyMOL. Here, you can configure options such as display settings, color schemes, and default directories.
  6. Install Plugins (Optional): PyMOL supports plugins that add additional functionality. You can install plugins by downloading them from the PyMOL wiki or other sources and placing them in the appropriate plugins directory.
  7. Update PyMOL (Optional): Periodically check for updates to PyMOL to ensure you have the latest features and bug fixes. You can usually update PyMOL through the software itself or by downloading the latest installer from the PyMOL website.

Please note that these are general steps, and the exact installation and setup process may vary depending on your specific system and requirements. It’s always a good idea to refer to the official PyMOL documentation or user guides for detailed instructions.

Basic navigation in the PyMOL interface

The PyMOL interface can be divided into several main areas, each serving different functions. Here’s a basic overview of how to navigate the PyMOL interface:

  1. Main Display Window: This is the main area where molecular structures are displayed in 3D. You can rotate, zoom, and translate the view using the mouse or keyboard shortcuts:
    • Rotate: Click and drag the mouse to rotate the view.
    • Zoom: Scroll the mouse wheel forward or backward to zoom in or out.
    • Translate: Hold down the Ctrl (Cmd on Mac) key while clicking and dragging the mouse to translate the view.
  2. Control Panel: The control panel contains various tabs and menus for controlling the display and analysis of molecular structures. You can access different tools and features, such as selecting atoms, measuring distances, and changing display settings, from the control panel.
  3. Command Line: The command line at the bottom of the PyMOL window allows you to enter commands directly. You can use the command line to perform various operations, such as loading structures, selecting atoms, and running scripts. Press Enter to execute a command.
  4. Object Panel: The object panel lists all the loaded molecular structures and objects in the scene. You can use the object panel to select and manipulate individual objects, such as hiding or showing them, changing their colors, and applying transformations.
  5. Toolbar: The toolbar contains icons for commonly used commands and functions, such as loading structures, selecting atoms, and adjusting the view. You can click on the icons to perform these actions.
  6. Menus: PyMOL has several menus at the top of the window, such as File, Edit, Display, and Settings, which contain additional commands and options for working with molecular structures.

To navigate in the PyMOL interface, you can use a combination of mouse actions, keyboard shortcuts, and commands entered in the command line. Practice using these basic navigation tools to become familiar with the PyMOL interface and start exploring molecular structures.

Loading and Viewing Structures

Loading molecular structures into PyMOL from files is a fundamental operation in molecular visualization. Here’s a basic overview of how to do it:

  1. Open PyMOL: Launch PyMOL on your computer.
  2. Load Structure: In the PyMOL interface, go to the “File” menu and select “Open” or use the command open followed by the file path. You can load a variety of file formats, such as PDB, CIF, XYZ, Mol2, and others.
  3. View Structure: Once the structure is loaded, it will appear in the PyMOL viewer. You can manipulate the view using the mouse or the PyMOL commands to zoom, rotate, and translate the structure.
  4. Color and Style: You can change the color and representation style of the structure using the commands color and show, respectively. For example, color red will color the structure red, and show sticks will show the structure as stick representations.
  5. Save Session (Optional): If you want to save your current PyMOL session, including the loaded structure and any changes you’ve made, you can go to the “File” menu and select “Save Session” or use the save command.
  6. Close Structure: To close the loaded structure, you can use the delete command followed by the object name. For example, delete my_structure will delete the structure named “my_structure.”

By following these steps, you can load molecular structures into PyMOL and begin visualizing and analyzing them.

Manipulating the view: zooming, rotating, and translating

In PyMOL, you can manipulate the view of your molecular structure in various ways, including zooming, rotating, and translating. Here’s how you can do it:

  1. Zooming:
    • To zoom in or out, you can use the scroll wheel on your mouse. Scroll up to zoom in and scroll down to zoom out.
    • Alternatively, you can use the zoom command followed by a factor. For example, zoom 2.0 will zoom in by a factor of 2, and zoom -2.0 will zoom out by a factor of 2.
  2. Rotating:
    • To rotate the view, click and drag with the left mouse button in the PyMOL viewer. This will rotate the structure around the center of the view.
    • You can also use the rotate command followed by the axis of rotation (x, y, or z) and the angle of rotation in degrees. For example, rotate x, 90 will rotate the structure 90 degrees around the x-axis.
  3. Translating:
    • To translate the view, click and drag with the middle mouse button (or the left and right buttons together) in the PyMOL viewer. This will move the structure in the plane of the screen.
    • You can also use the translate command followed by the axis of translation (x, y, or z) and the distance to translate. For example, translate x, 5.0 will translate the structure 5.0 units along the x-axis.
  4. Centering:
    • To center the view on a specific atom or selection, you can use the center command followed by the selection. For example, center my_selection will center the view on the atoms in the selection named “my_selection.”

By using these commands and techniques, you can manipulate the view of your molecular structure in PyMOL to focus on specific regions or aspects of the structure.

Selections and Representations

Selecting atoms and residues

In PyMOL, you can select atoms and residues in your molecular structure using selection commands. Here’s how you can select atoms and residues:

  1. Selecting Atoms:
    • To select specific atoms, you can use the select command followed by a selection name and a selection expression. For example, select my_atoms, resi 10 will select all atoms in residue 10.
    • You can also use logical operators to combine selection expressions. For example, select my_atoms, resi 10 and name CA will select the alpha carbon atom in residue 10.
  2. Selecting Residues:
    • To select entire residues, you can use the select command with the byres keyword. For example, select my_residues, resi 10 byres will select all atoms in residue 10 and all atoms bonded to those atoms.
    • You can also use the select command with the around keyword to select residues within a certain distance of a selection. For example, select nearby_residues, around 5 of my_selection will select residues within 5 angstroms of the atoms in my_selection.
  3. Combining Selections:
    • You can combine selections using logical operators such as and, or, and not. For example, select my_selection, resi 10 and not name CA will select all atoms in residue 10 except for the alpha carbon atom.
  4. Using Selections:
    • Once you have selected atoms or residues, you can use the selection name in other commands. For example, show sticks, my_atoms will display the selected atoms as stick representations.
  5. Clearing Selections:
    • To clear a selection, you can use the delete command followed by the selection name. For example, delete my_selection will clear the selection named “my_selection.”

By using these selection commands, you can manipulate and analyze specific atoms and residues in your molecular structure in PyMOL.

Changing representation styles: lines, sticks, spheres, etc.

In PyMOL, you can change the representation style of your molecular structure to visualize it in different ways. Here are some common representation styles and how to change them:

  1. Lines:
    • To display the molecular structure as lines, use the show command followed by lines. For example, show lines will display the structure as lines.
  2. Sticks:
    • To display the molecular structure as sticks, use the show command followed by sticks. For example, show sticks will display the structure as sticks.
  3. Spheres:
    • To display the molecular structure as spheres, use the show command followed by spheres. For example, show spheres will display the structure as spheres.
  4. Cartoon:
    • To display the molecular structure as a cartoon, use the show command followed by cartoon. For example, show cartoon will display the structure as a cartoon.
  5. Ribbons:
    • To display the molecular structure as ribbons, use the show command followed by ribbon. For example, show ribbon will display the structure as ribbons.
  6. Surface:
    • To display the molecular structure as a molecular surface, use the show command followed by surface. For example, show surface will display the structure as a surface.
  7. Combining Representations:
    • You can combine different representation styles using the show command. For example, show sticks, resi 10 will display residue 10 as sticks.
  8. Changing Colors:
    • You can change the color of the representation using the color command followed by a color name or RGB values. For example, color red, resi 10 will display residue 10 in red.

By using these commands, you can change the representation style of your molecular structure in PyMOL to visualize it in different ways.

Structural Analysis

Measuring distances, angles, and dihedrals

In PyMOL, you can measure distances, angles, and dihedrals between atoms or groups of atoms in your molecular structure using the measure command. Here’s how you can do it:

  1. Measuring Distances:
    • To measure the distance between two atoms, use the distance command followed by the selection of the two atoms. For example, distance d1, resi 10 and name CA, resi 20 and name CA will measure the distance between the alpha carbon atoms in residues 10 and 20 and label the measurement as “d1.”
    • To display the measurement, use the show command with the labels option. For example, show labels, d1 will display the distance measurement.
  2. Measuring Angles:
    • To measure the angle between three atoms, use the angle command followed by the selections of the three atoms. For example, angle a1, resi 10 and name CA, resi 20 and name CA, resi 30 and name CA will measure the angle between the alpha carbon atoms in residues 10, 20, and 30 and label the measurement as “a1.”
    • To display the measurement, use the show command with the labels option. For example, show labels, a1 will display the angle measurement.
  3. Measuring Dihedrals:
    • To measure the dihedral angle between four atoms, use the dihedral command followed by the selections of the four atoms. For example, dihedral phi, resi 10 and name N, resi 10 and name CA, resi 10 and name C, resi 10 and name N will measure the dihedral angle of residue 10 and label the measurement as “phi.”
    • To display the measurement, use the show command with the labels option. For example, show labels, phi will display the dihedral angle measurement.

These measurements can be useful for analyzing the geometry of your molecular structure and understanding its conformational properties.

Superimposing structures and aligning molecules

In PyMOL, you can superimpose structures and align molecules to compare their structures or analyze structural changes. Here’s how you can do it:

  1. Superimposing Structures:
    • To superimpose two or more structures, use the align command followed by the selections of the atoms you want to align. For example, align structure1, structure2 will superimpose structure2 onto structure1 based on the selected atoms.
    • By default, PyMOL will align the structures based on the C-alpha atoms of proteins. You can specify different selections or atoms for alignment by providing them as arguments to the align command.
  2. Aligning Molecules:
    • To align molecules based on a specific selection, you can use the align command with the object keyword followed by the object names and the selection. For example, align structure1, structure2, object=0, target_state=0, source_state=0, target_selection=my_selection, source_selection=my_selection will align structure2 onto structure1 based on the atoms selected in my_selection.
    • You can also use the intra_fit command to align a single object to itself based on a selection. For example, intra_fit my_selection will align the atoms selected in my_selection in the same object.
  3. Displaying the Superimposed Structure:
    • To display the superimposed structure, you can use the show command to show the aligned atoms in a specific representation. For example, show sticks, structure2 will display structure2 as stick representations after it has been aligned to structure1.

By using these commands, you can superimpose structures and align molecules in PyMOL to compare their structures or analyze structural changes.

Advanced Visualization Techniques

Creating molecular surfaces

In PyMOL, you can create molecular surfaces to visualize the shape and properties of your molecular structures. There are several types of molecular surfaces you can create, including solvent-accessible surfaces, solvent-excluded surfaces, and molecular electrostatic potential surfaces. Here’s how you can create these surfaces in PyMOL:

  1. Solvent-Accessible Surface (SAS):
    • To create a solvent-accessible surface, use the show surface command followed by the solvent option. For example, show surface, solvent will create a solvent-accessible surface for the current selection.
    • You can customize the surface display by adjusting parameters such as transparency (transparency) and color (color). For example, set transparency, 0.5 will set the surface transparency to 50%, and color blue, surface will set the surface color to blue.
  2. Solvent-Excluded Surface (SES):
    • To create a solvent-excluded surface, use the show surface command without the solvent option. For example, show surface will create a solvent-excluded surface for the current selection.
    • Similar to the solvent-accessible surface, you can customize the display of the solvent-excluded surface using transparency and color settings.
  3. Molecular Electrostatic Potential (MEP) Surface:
    • To create a molecular electrostatic potential surface, you first need to calculate the electrostatic potential for your structure using a program such as APBS (Adaptive Poisson-Boltzmann Solver).
    • Once you have the electrostatic potential data, you can load it into PyMOL using the load command. For example, load electrostatic_potential.dx will load the electrostatic potential data from a DX file.
    • To display the MEP surface, use the show surface command with the map option followed by the name of the electrostatic potential map. For example, show surface, map=electrostatic_potential will display the MEP surface for the loaded electrostatic potential map.

Creating molecular surfaces in PyMOL can enhance your visualization and analysis of molecular structures, allowing you to explore the shape and properties of molecules in more detail.

Using labels and annotations

In PyMOL, you can add labels and annotations to your molecular structures to provide context and highlight important features. Here’s how you can use labels and annotations in PyMOL:

  1. Adding Labels to Atoms or Residues:
    • To add a label to a specific atom or residue, use the label command followed by the selection of the atom or residue and the text of the label. For example, label resi 10, "My Label" will add the label “My Label” to residue 10.
    • You can customize the appearance of the label using options such as font size (font_size), font color (color), and background color (bg_color). For example, set label_size, 20 will set the font size of all labels to 20 points.
  2. Adding Annotations:
    • Annotations are similar to labels but can be positioned at specific coordinates in the 3D space of your molecular structure. To add an annotation, use the annotate command followed by the x, y, and z coordinates and the text of the annotation. For example, annotate 10, 10, 10, "Annotation Text" will add an annotation at the coordinates (10, 10, 10) with the text “Annotation Text”.
  3. Displaying Labels and Annotations:
    • By default, labels and annotations are displayed when you create them. You can hide them using the hide labels or hide annotations command, and show them again using the show labels or show annotations command.
  4. Customizing Labels and Annotations:
    • You can customize the appearance of labels and annotations using the set command with specific settings. For example, set label_size, 20 will set the font size of all labels to 20 points, and set label_color, red will set the font color of all labels to red.
  5. Saving Labels and Annotations:
    • Labels and annotations are part of the PyMOL session and will be saved when you save your session. If you want to save them as a separate file, you can use the label and annotate commands in a script file and run the script to recreate the labels and annotations when needed.

By using labels and annotations, you can add descriptive information and notes to your molecular structures, making it easier to interpret and present your results.

Creating High-Quality Images

Rendering images for publication

Rendering high-quality images for publication in PyMOL involves setting up the scene, adjusting the settings, and exporting the image in the desired format. Here’s a general guide to rendering images in PyMOL:

  1. Set up the Scene:
    • Arrange your molecular structure in the desired orientation and style. You can use commands such as zoom, rotate, and show to adjust the view and representation of your structure.
  2. Adjust Display Settings:
    • Fine-tune the display settings for your structure, including colors, representations (e.g., sticks, spheres), and lighting. Use commands like color, show, and set to customize the appearance of your structure.
  3. Set the Image Size and Resolution:
    • Use the ray command to set the image size and resolution. For example, ray 1920, 1080 will set the image size to 1920×1080 pixels. Higher resolutions are suitable for publication-quality images.
  4. Adjust Rendering Settings:
    • Use the set command to adjust rendering settings such as ambient occlusion, shadows, and anti-aliasing. For example, set ray_trace_fog, off will disable fog effects during rendering.
  5. Render the Image:
    • Use the ray command to render the image. PyMOL will use ray tracing to generate a high-quality image. Depending on the complexity of your scene and the resolution, rendering may take some time.
  6. Export the Image:
    • Once the rendering is complete, use the png, jpeg, or tiff command to export the image in the desired format. For example, png filename.png will save the image as a PNG file.
  7. Post-Processing (Optional):
    • If necessary, you can further edit the image using image editing software to adjust colors, add labels, or annotate features. However, PyMOL’s rendering should produce a high-quality image suitable for publication in most cases.

By following these steps, you can render high-quality images of your molecular structures in PyMOL for publication in scientific journals or presentations.

Adding effects like shadows and depth cueing

In PyMOL, you can add effects like shadows and depth cueing to enhance the visual appeal of your molecular structures. Here’s how you can do it:

  1. Shadows:
    • To add shadows to your molecular structure, use the set command to enable ray tracing and set the shadow settings. For example:
      vbnet
      set ray_trace_mode, 3 # Enable ray tracing with shadows
      set ray_shadows, on # Turn on shadows
    • Adjust the shadow parameters, such as the shadow intensity and softness, using the set command. For example:
      bash
      set ray_shadow, 0.1 # Set shadow intensity (0-1)
      set ray_shadow_decay_factor, 0.1 # Set shadow decay factor (0-1)
      set ray_shadow_decay_range, 5.0 # Set shadow decay range
  2. Depth Cueing:
    • Depth cueing adds depth perception to your molecular structure by adjusting the color intensity based on the distance from the viewer. Use the set command to enable depth cueing and set the depth cueing parameters. For example:
      bash
      set depth_cue, on # Turn on depth cueing
      set depth_cue_mode, 1 # Linear depth cueing mode
      set depth_cue_start, 0.0 # Start distance for depth cueing
      set depth_cue_end, 100.0 # End distance for depth cueing
    • Adjust the depth cueing parameters (depth_cue_start and depth_cue_end) to control the depth cueing effect.
  3. Rendering the Image:
    • After setting up the shadow and depth cueing effects, use the ray command to render the image with the effects applied. For example:
      yaml
      ray 1920, 1080 # Render the image with a resolution of 1920x1080
  4. Exporting the Image:
    • Once the rendering is complete, use the png, jpeg, or tiff command to export the image with the effects applied. For example:
      bash
      png filename.png # Export the image as a PNG file

By adding shadows and depth cueing to your molecular structures in PyMOL, you can create visually striking images that highlight the 3D nature of the structures and improve depth

Animation and Movie Making

Creating simple molecular animations

Creating simple molecular animations in PyMOL involves setting up a series of frames representing different states of your molecular structure and then rendering them into a video file. Here’s a basic guide to creating simple molecular animations in PyMOL:

  1. Set Up the Scene:
    • Arrange your molecular structure in the starting position of your animation. Adjust the view, representation, and style as desired.
  2. Define Animation Frames:
    • Use the frame command to define key frames in your animation. For example, frame 1 will set the current state as frame 1. Make any necessary adjustments to your structure for the next frame, then use frame 2 to set the next key frame, and so on.
  3. Interpolate Frames:
    • Use the mview command to interpolate between key frames to create smooth transitions. For example, mview store, 1 will store the current view as frame 1, and mview interpolate, 2 will interpolate between frames 1 and 2.
  4. Set Animation Parameters:
    • Use the set command to adjust animation parameters such as the number of frames (total) and the frame rate (movie_fps). For example, set total_frames, 100 will set the total number of frames to 100, and set movie_fps, 30 will set the frame rate to 30 frames per second.
  5. Render the Animation:
    • Use the ray command to render each frame of the animation. You can use a loop to iterate through each frame and render it. For example:
      arduino
      for i in range(1, 101):
      frame =
      i
      ray

      This will render frames 1 to 100.

  6. Export the Animation:
    • Once all frames have been rendered, you can use external software to compile them into a video file. PyMOL does not directly export animations to video formats, so you will need to use software like Adobe Premiere, Final Cut Pro, or ffmpeg to create the final video.
  7. Optional: Add Effects:
    • You can add effects such as depth cueing (set depth_cue) and shadows (set ray_shadow) to enhance the appearance of your animation. Experiment with different settings to achieve the desired effect.

By following these steps, you can create simple molecular animations in PyMOL to illustrate dynamic processes or conformational changes in your molecular structures.

Exporting movies for presentations

Exporting movies from PyMOL for presentations involves rendering the frames of your animation and compiling them into a video file. Here’s a general guide to exporting movies from PyMOL:

  1. Set Up Your Animation:
    • Create and set up your molecular animation in PyMOL using the steps outlined in the previous answer. Make sure your animation is smooth and visually appealing.
  2. Render Animation Frames:
    • Use the ray command to render each frame of your animation. You can use a loop to render multiple frames. For example:
      arduino
      for i in range(1, 101):
      frame =
      i
      ray

      This will render frames 1 to 100.

  3. Export Frames as Images:
    • Use the png or jpeg command to export each frame as an image file. For example, png frame1.png will export the current frame as a PNG image named “frame1.png”.
  4. Compile Images into a Video:
    • Once you have exported all frames as images, you can use video editing software to compile them into a video file. Most video editing software, such as Adobe Premiere, Final Cut Pro, or even free tools like ffmpeg, can import image sequences and convert them into a video format.
  5. Adjust Video Settings:
    • In your video editing software, you can adjust settings such as frame rate, resolution, and video format. Match these settings to the settings you used in PyMOL to ensure smooth playback and high-quality output.
  6. Export Video File:
    • Once you have adjusted the settings, export your video file from the video editing software. Choose a suitable format for your presentation, such as MP4 or MOV.
  7. Test Your Video:
    • Before your presentation, make sure to test your video to ensure it plays correctly and looks as expected. Pay attention to any audio, transitions, or effects you have added.

By following these steps, you can export movies from PyMOL for presentations, allowing you to showcase your molecular animations in a professional and visually appealing manner.

Plugins and Extensions

Overview of useful plugins and extensions

PyMOL offers a range of plugins and extensions that can enhance its functionality and streamline your workflow. Here’s an overview of some useful plugins and extensions for PyMOL:

  1. APBS Tools: Allows you to calculate and visualize electrostatic potentials using the Adaptive Poisson-Boltzmann Solver (APBS) within PyMOL.
  2. BioUnit: Helps in identifying and visualizing biological units in macromolecular structures, useful for studying protein-protein interactions and complexes.
  3. PyMOL Movie Studio: A graphical user interface (GUI) for creating molecular animations in PyMOL, simplifying the process of animating complex molecular movements.
  4. MMTF PyMOL: Enables PyMOL to read and visualize structures encoded in the Macromolecular Transmission Format (MMTF), which can reduce file sizes and improve performance.
  5. PyMOL Molecule Builder: Allows for the interactive construction of molecular structures, making it easier to build complex molecules and visualize their properties.
  6. PyPathway: Helps in visualizing metabolic pathways and networks, integrating pathway information with molecular structures for a comprehensive view.
  7. VolPyMOL: Enables volumetric data visualization in PyMOL, useful for visualizing electron density maps, molecular surfaces, and other volumetric data.
  8. PyShape: Provides tools for shape analysis and comparison of molecular structures, useful for studying ligand binding and protein interactions.
  9. PDB2PQR: Allows for the conversion of PDB files to PQR format, which includes the addition of atomic charges and radii for molecular electrostatics calculations.
  10. PyMod: A tool for homology modeling and comparative protein structure modeling, assisting in the prediction of protein structures based on known templates.

These plugins and extensions can expand the capabilities of PyMOL and make it a more versatile tool for molecular visualization, analysis, and modeling.

Installing and using additional functionalities

o install and use additional functionalities in PyMOL, such as plugins and extensions, you can follow these general steps:

  1. Download the Plugin/Extension:
    • Go to the website or repository where the plugin/extension is available and download the appropriate files. Some plugins/extensions may come as Python scripts, while others may require specific installation steps.
  2. Install the Plugin/Extension:
    • If the plugin/extension is a Python script, you can simply copy the script file to your PyMOL installation directory or a directory where PyMOL can find it. Alternatively, you may need to follow specific installation instructions provided by the plugin/extension developer.
  3. Load the Plugin/Extension:
    • Once the plugin/extension is installed, you can load it in PyMOL using the run command. For example, if the plugin script is named my_plugin.py, you can load it using run my_plugin.py.
  4. Use the Plugin/Extension:
    • After loading the plugin/extension, you can use its functionality within PyMOL. This may involve using specific commands, GUI interfaces, or options that the plugin/extension provides. Consult the documentation or instructions provided with the plugin/extension for details on how to use it.
  5. Enable Auto-Loading (Optional):
    • To automatically load a plugin/extension every time PyMOL starts, you can add the run command to your PyMOL configuration file (typically located at ~/.pymolrc or C:\Users\YourUsername\pymolrc).
  6. Update the Plugin/Extension (Optional):
    • Periodically check for updates to the plugin/extension and install newer versions if available. This can ensure that you have access to the latest features and improvements.
  7. Troubleshooting:
    • If you encounter any issues with the installation or use of a plugin/extension, refer to the documentation or support resources provided by the developer. You may also seek help from the PyMOL community forums or mailing lists.

By following these steps, you can install and use additional functionalities in PyMOL to enhance your molecular visualization and analysis capabilities.

Case Studies and Practical Applications

Pymol exercise

In this Exercise we will use the visualization program PyMOL and also have a brief look at the PDB, the home of all experimental protein structures.

If you have used PyMOL before or even done this exercise previously (and you did it very thoroughly), you can go quickly through this exercise or even jump directly to for example item 31. Or ask Jon what to do…

    1. Open the internet browser and go to http://www.uniprot.org/uniprot/O15527. Here you can find information on the protein “8-oxoguanine DNA glycosylase”, human OGG1. In the isoform -OGG1 (Isoform 1A) there are 345 residues. The sequence is given by:

>sp|O15527|OGG1_HUMAN N-glycosylase/DNA lyase OS=Homo sapiens

MPARALLPRRMGHRTLASTPALWASIPCPRSELRLDLVLPSGQSFRWREQSPAHWSGVLA

DQVWTLTQTEEQLHCTVYRGDKSQASRPTPDELEAVRKYFQLDVTLAQLYHHWGSVDSHF

QEVAQKFQGVRLLRQDPIECLFSFICSSNNNIARITGMVERLCQAFGPRLIQLDDVTYHG

FPSLQALAGPEVEAHLRKLGLGYRARYVSASARAILEEQGGLAWLQQLRESSYEEAHKAL

CILPGVGTKVADCICLMALDKPQAVPVDVHMWHIAQRDYSWHPTTSQAKGPSPQTNKELG

NFFRSLWGPYAGWAQAVLFSADLRQSRHAQEPPAKRRKGSKGPEG

In the “Structure” section on the page you will find links to 3D structure databases (in the “Links” column). What is the PDB identifier for the structure with the best resolution? What is the resolution for structure 1EBM? Are any of the structures for the full-length protein? Are there any visible hydrogen atoms in any of the structures? Why not?

Screen Shot 2014-11-16 at 14

Here you can search for protein structures determined by either X-ray crystallography or NMR. There are various ways to search the database, the most common being by protein name, acronym, organism, protein class or author name.

    1. Type in 1EBM in the search field and press enter to search for this structure. You get only one hit, so you are sent directly to the “Structure Summary” for this structure. Which macromolecules does this structure contain? How many chains are there? What is chain A? Is it mutated? (Now, in the fall of 2018, the database claims that the protein in not mutated. This is a change since the spring, and the last 15 years, and is wrong! It is mutated, Lys249 (K on blue background on previous page) to Gln. This is clearly stated in the original article. This is good example of an error in partially automatically generated databases). Do you have any suggestions for why the researchers behind this study have mutated a single residue in the middle of the sequence? If not, you will have the chance to guess later in this exercise. Is it a full-length protein? What is missing? Do you have any suggestions for why it is not full-length? (Hint: Structural disordered regions are hard to crystallize)

    1. Click on “Download Files” (up at the right hand side) and download the “PDB Format” file. Save it, for example on the Desktop, as 1EBM.pdb. Take a look at the pdb-file, for example in WordPad or nano. It shows among other things the experimentally determined positions (atomic coordinates) of all the atoms in the model (including many water molecules). Who are the authors of this work? Is this an X-ray crystallography or NMR study? What is the resolution of the structure? What do you find in the fields “REMARK 200”? Did they use a synchrotron for this work? What do you find in the fields “REMARK 465” and “REMARK 470”? Can you explain the missing residues/atoms? What do you find on the “SEQRES” lines?
    2. On the “Structure Summary” page for 1EBM, left hand side, there is a picture of 1EBM and links to various “viewers”. Click on the links at “3D View: Structure” to open the viewers. Default viewer is NGL. Play a little with these tools and try at least NGL and JSmol. What is the green ball you see with the JSmol and NGL viewers? You might need to go back to the “Structure Summary” page and look at “Small Molecules/Ligands” to get an idea. In JSmol, rotate the structure (by left-clicking and dragging) and zoom in and out (using the mouse wheel). Right click to get a menu and for example choose “Style”, “Scheme” and “CPK Spacefill” to get the protein visualized in a different way.
    3. Open PyMOL (you will find the shortcut in the Start Menu or in the All Programs listing, under Windows, at least…). You can make the “Viewer” window bigger by pulling at the corner.
    4. Open the 1ebm.pdb file in PyMOL (FileOpen → select file on desktop).

    1. Turn on sequence display (DisplaySequence).
    2. Play around with the protein structure using the mouse buttons (left = rotate, middle press = move, middle scroll = clipping, middle click = centring and right = zoom). If you manage to “get lost in protein space” you can always centre the molecule again by “middle-clicking” with the mouse at any given amino acid in the sequence display on the top. You can also “right-click” on the background and choose “zoom (vis)”.
    3. The isolated red crosses/stars are single water molecules that are fixed in the crystal near the protein surface. We don’t need them right now, so press “H” for hide and go down to the waters item on the pop-up list (this is just next to “1ebm” in the upper right corner of the viewer).
    4. Actually, let’s turn off the whole protein. Select “H” → everything.
    5. Select “S” for show, then select cartoon. Now you only see the trace of the main chain of the protein. You can also see the DNA duplex bound to OGG1. Select a nice colour by pressing “C” and then pick one from the list according to your liking. Try one of the “spectrum” → “rainbow” colouring schemes as well.
    6. Use “H” → everything again and then “S” and choose (hiding everything again when you want to)
      1. lines”. This is “wireframes”. Colour “gray 60” and then “by element”, first option. Now you see carbon atoms as gray, oxygens as red and nitrogens as blue.
      2. sticks”.
      3. ribbon”. This is often called a “C-trace” and is a line connecting all the C atoms.
      4. spheres”. This is CPK space-filling spheres. Choose a nice colouring scheme.
      5. surface”. You get the full surface of the protein complex. Choose a nice colouring scheme.

    1. Hide everything and show as cartoon. Colour according to secondary structure “by ss”. How many -sheets do you find? How many -strands does each sheet contain? Are there more -helices or -sheets in OGG1? Scroll the sequence in the PyMOL Viewer window (at the top) and locate the residue Asp174. Click on this residue in the sequence (i.e. click on the “D”). The “D” is now highlighted, it is “selected”. Numbering in the sequence is a bit awkward… Residue 171 is Ile and residue 176 is Val, got it? You will also find little pink squares on the structure corresponding to this selection. Finally, you find the selection as “(sele)” in a separate row on the right hand side of the Viewer window. For this selection choose “A” → “rename selection” and type the name “Asp174” before you press enter. If you click on “(Asp174)” the little pink squares disappear, but you can still use this selection later.
    2. Show the whole structure as “cartoon” and Asp174 as “sticks”. Zoom in on Asp174 and choose a colouring that makes it easy to see. What kind of secondary structure element is Asp174 located in?

 

    1. Hide “everything” (for 1ebm) and then show as “sticks”. Colour “gray 60” and then “by element” (first option in the list). You see some residues sticking out into the solvent from the surface of the protein. Would you describe the side chains of these residues as hydrophilic or hydrophobic?

    1. Choose one of these residues by clicking on it. You have made a new selection “(sele)”. For “(sele)”, do “L” → “residues” to get this residue labelled. Which residue is it? Which amino acid is it?

 

    1. Can you find any areas within the structure that are rich in hydrophobic residues? What forces are stabilizing the structure in these regions?

    1. The segment “NIARITGMVERLCQAFG” is a part of OGG1, residues 151-167. Go to http://emboss.bioinformatics.nl/cgi-bin/emboss/pepwheel and generate a helical wheel plot with this sequence (Use default settings). Does the helical wheel plot suggest/hint that this is an -helix or a -sheet in this enzyme? Why? Can you find the sequence in the structure? Is it an -helix or a -sheet? Which part of the segment is facing the solvent? What do we call something that is hydrophobic on one side and hydrophilic on the other?
    2. Select the residues 151-167. Display only this alpha helix and hide everything else. Show as “sticks” and colour “by element”. Approximately how many turns are there in this helix? Which atoms are involved in H-bonds stabilising the -helix? There are two residues involved in each of these H-bonds. How many residues is it between them in the sequence? Can you locate the bonds which define the rotations phi and psi? Where are the C atoms? It may be easier to answer the questions if you first do “Hide” → “Side chain” to see only the main chain atoms. You can let PyMOL make an attempt on localizing H-bonds by doing “Actions” → “find” → “polar contacts” → “within selection”. As you see, there are too many H-bonds. You may fix this by typing (in the Viewer window at the command line/lower left corner after “PyMOL>” the following: “set h_bond_max_angle, 30”. If you repeat the “find polar contacts” procedure you should now get a slightly better result.

    1. Show the whole protein again. Far down on the right-hand side you see “selecting residues”. That means that if you click on the structure, you can choose single residues. Click on the word “selecting” until you get “selecting chains”. Click on a part of the protein in the main window and confirm by looking at the sequence bar that you have chosen the full “chain A” and nothing more.

 

    1. Create a new object by typing “create OGG1, sele”. Click on “1ebm” to make this object inactive. You now only see your new object “OGG1” in the main window. Locate the N-terminus and the C-terminus. Are their any gaps in the protein backbone? Which residues are missing? Why are they missing?
    2. For the object OGG1, select “H” for hide, and then select everything. The molecule disappears.
    3. For the same object, select “S” for show, and then select surface. A nice protein surface is calculated and displayed.

    1. Active sites are often located in grooves or holes in the surface. Where do you think the active site is located?
    2. This protein is a DNA glycosylase that scans DNA and recognises and removes 8-oxoguanine (8-oxoG), which is guanine (G) with an oxygen atom bound at position 8 on the DNA base. The protein belongs to the helix-hairpin-helix superfamily of DNA glycosylases. Make 1EBM active again and hide everything in this object. Create a new selection that contains the DNA chains. For this selection choose “A” → “rename selection” and type the new name “DNA” before you press enter. Use “S” for show, and then select “sticks” for “DNA”.
    3. DNA containing 8-oxoG is the substrate for this enzyme. Can you now locate the active site?

    1. DNA glycosylases flip the damaged base into the binding pocket. This leaves a vacant space in the DNA duplex. OGG1 inserts a residue into this vacant slot. Which residue is that? You might want to change the rendering of the protein, show as “sticks” for example, in order to find this residue.
    2. Make a new selection containing only the single residue 8-oxoG (i.e. the “8OG” in the sequence!). Rename the selection “8oxoG”. The command “select ActSite, 8oxoG around 8” will make a new selection called “ActSite”. It contains all atoms within 8 Å of “8oxoG”. Show both 8oxoG and ActSite as “sticks” and hide everything else. One Phe and one Cys residue are “stacking” against 8-oxoG in the active site pocket. Which ones?

    1. This structure contains the mutant OGG1 K249Q. Can you find residue 249 in the structure? Do you have any suggestions for why the researchers behind this study have mutated this residue?
    2. Make a nice illustration of 8-oxoG containing DNA bound to OGG1 by generating an appropriate “scene” and do ray-tracing by typing “ray”. You might try
      1. Type “bg_color white”
      2. Type “set ray_trace_fog, 0” and “set ray_shadow, 0” to remove shadows and a “foggy” look of the ray-traced image
      3. Typing “ray 2000” gives a picture that is 2000 pixels wide. You may save it by typing for example “save directory/OGG1.png”.

    1. Take a look at the PyMOL wiki page: http://www.pymolwiki.org. Here you find, in addition to a lot of other useful stuff, small scripts and plugins that people have written in order to make PyMOL even more useful. Click on the “Script Library” link. In the “Structural Biology” category, click on the “AngleBetweenHelices” link. What will this script do?
    2. Download the script (at the “Download” link in the yellow box) and store it on your computer in a directory somewhere. Make sure you know the full path of that directory. Under Microsoft Windows, for example, store it in “C:\temp\”. If you store the file anglebetweenhelices.py somewhere else, use that path name below.

In PyMOL, type “run C:\temp\anglebetweenhelices.py” to run the script (use the correct path name!). Apparently not much happens, but you now have some more commands that you may use, for example “angle_between_helices sele1, sele2”. Hide the 1EBM object in PyMOL by clicking on 1EBM in the upper right corner. Make sure the OGG1 object is active. Show this object as cartoon and colour by “ss” (secondary structure). Select residues 232 to 241 (this is an alpha-helix) and rename the selection Helix1. Do the same with residues 247 to 259 and name this Helix2. Give Helix 1 and 2 nice new colours.

Now type the command “angle_between_helices Helix1, Helix2”. What happens?

Open the anglebetweenhelices.py file in a text editor. As you might see, this script is written in Python. Actually, PyMOL itself is written in Python. Now let us modify this script a bit. In the script you find the statement “coneend = cpv.add(end, cpv.scale(direction, 4.0*radius))”. Change the “4.0” to “15.0”. Further down you find “radius * 1.75,”. Change “1.75” to “5.0”. Finally, a bit further up you find “symmetric=False, color=’green’, color2=’red’):”. Change “green” to “blue” and “red” to “yellow”. Save the file and in PyMOL run it again by typing “run C:\temp\anglebetweenhelices.py”. Now do “angle_between_helices Helix1, Helix2”. What happens this time?

 

Additional things you might do if you have time:

  • Experiment with anglebetweenhelices.py and make more changes to the script.
  • Try a cartoon rendering in PyMOL, but type “cartoon putty”. You will get a tube following the trace of the protein, but with the diameter of the tube showing the B-factor. Some regions are thin (little thermal motion) while others are fat (a lot of thermal motion).

  • Have a look at an NMR structure ensemble in PyMOL, for example 1N0Z. Run through the various states. Which parts of this protein segment is structurally disordered and which parts have a regular 3D structure?

  • Look at electron density that was used to generate 1EBM at the PDBe (http://www.ebi.ac.uk/pdbe). On the page for 1EBM, click on “3D Visualisation” under “Quick Links” to open the LiteMOL viewer. Check the density for residues 78 to 84. Is anything missing? Also look at the electron density around 8-oxoG.

Screen%20Shot%202017-11-15%20at%2015

http://pymolwiki.org/index.php/Selection_Algebra

    • Check out the various plugins or the “gallery” and learn how to make the various illustrations (http://pymolwiki.org/index.php/Gallery)
    • Make a nice illustration of your favourite structure from the PDB?
    • Learn how to make this picture:

http://pymolwiki.org/index.php/File:QuteMolLike.png

ray

 

Shares