In the previous tutorials we have seen that professional images can be quickly generated via the PyMOL GUI. However, unless you are sure that you will not need to get back to the image for further modifications later, a much better option is to use PyMOL pml script files to generate images.
Pml files are ASCII files (unformatted text files), which contain PyMOL commands (that you may interactively type into the PyMOL command line) and they should be saved with the extension *.pml. You generate these in your favorite text editor. You can use Wordpad or notepad, the standard Windows text editor, or more sophisticated text editors such as Context or Sublime, that provide syntax highlighting. They do not know the pml syntax but python syntax highlighting is suitable and helps to highlight the syntax and display comments in grey. For Sublime you can install syntax highlighting for pml scripts.
The advantage of using pml script files is that it is very easy to make adjustments to the image, which can be a lot of work if you start from the saved pse files. In the script file it is perfectly documented how superpositions have been made (which residues and atoms, which algorithm) or which pdb file or electron density map was used and at which contour level the electron density map was shown. This may be important information for the publication manuscript. The pml script file is a perfect documentation of the image and starting point for modifications.
Usually starting from a suitable template, the pml script file is modified in the text editor and saved to image-name.pml. If you need more info concerning the commands, use a web search engine with "pymol your_command". Make yourself familiar with PyMOL selections.
In the PyMOL command line you type "@image-name.pml" (provided that you changed directory via "cd" to your current working directory) to execute the commands in the pml file.
Use a sensible file naming scheme. I use the following:
my_image.pml | The pml script file. Always generate a new file for each image with the sane base file name. An exeption might be very minor modifications, e.g. two images differing in 90° rotation or different resolution. In this case I would suggest that my_image.pml generates my_image_0deg.png and my_image_90deg.png |
my_image.png | The generated image. |
manuscript_composite_image-name.svg | An inkscape svg file to generate a composite file of one or several images with labels for the main manuscript part. |
manuscript_composite_image-name.svg | The image generated from inkscape. |
SI_composite_image-name.svg | Ditto for SI part. |
SI-composite_image-name.png | Image for SI part. |
Edit these template files to generate new images.
pml file with comments |
without comments |
view in html page |
usage |
general_comments.pml | general.pml | general_comments | This file should provide commands for most images |
Back to PyMOL tutorial main page.