How to make publication quality images with PyMOL
If you’re into computational chemistry and want to share your research with the world, at some point you will need to know how to make publication-quality images.
High-quality images are essential for communicating your research findings to the scientific community. As a computational or non-computational chemist, you may be using molecular visualization software to generate images that represent the structures of molecules or proteins, and these images can be used in publications, presentations, and posters to illustrate your results.
Additionally, by creating clear and visually appealing images, you can make it easier for readers to understand the structure and function of the molecules you are studying, which can help to make your research more accessible to a wider audience.
Images with PyMOL
When it comes to visualizing molecular structures for computational chemistry research, there are various software tools available in the market.
While each of these software tools has its own strengths and weaknesses, PyMOL is widely regarded as one of the most powerful and versatile tools for creating high-quality images of molecular structures. With PyMOL, you can produce a range of images, from simple small molecule representations to complex 3D macromolecule structures.
That being said, mastering PyMOL can be intimidating for beginners. But don’t worry, in this blog post, I will guide you through the process of creating publication-quality images in PyMOL. I will show some tips to create stunning images that are perfect for your research.
Orient and center a molecule in PyMOL
The first thing you want to accomplish to generate an image is to adjust the view of the molecule or protein structure. You can use your mouse to get the view that best fits your needs but you can also use the command line to make sure that the system is properly oriented and centered in the interface. To this aim, we can use the orient
and center
commands in PyMOL.
To orient your system with the XYZ axis you can type:
|
|
If you want to center it you can use:
|
|
Both of these commands can be used with a selection meaning that you can choose a set of atoms and use them to orient or center your system based on them. If you are not familiar with the PyMOL selection tool you can find more info here
To center your view on residue 110:
|
|
To orient the view on a ligand named LIG
you can use:
|
|
Rendering an image in PyMOL: The ray
command
Here comes the best part. If you are here you are probably wondering how to render high-quality images with PyMOL. The good news is that this process is quite intuitive in PyMOL.
This is due to the built-in ray tracing technology that allows you to generate high-quality images of molecular structures with realistic shadows, reflections, and transparency effects. The kind of fancy images you generally find in papers and presentations.
As already mentioned, the procedure is quite easy.
You just need to set up the view according to your needs, and then you can simply type ray
in the PyMOL command line and hit enter:
|
|
Easy as that. PyMOL will then start the ray tracing process and generate an image of the current scene, which you can export and use as you want.
You can also specify different parameters to control the ray-tracing process. Among others, you can choose to scale the width and height of the figure:
|
|
For instance:
|
|
will ray trace the current scene, but scaled to 1280x720 pixels.
Different ray trace modes
It’s not over yet. PyMOL also offers different ray trace modalities.
You can choose them with the set ray_trace_mode
command. Four modes are available and you can select them with 0
, 1
, 2
, and 3
. After the selection, you simply need to run the ray
command to start the rendering.
Here is what they look like:
set ray_trace_mode, 0
: The default rendering mode for PyMOL displaying natural colors.
set ray_trace_mode, 1
: This mode gives natural colors with black outlines.
set ray_trace_mode, 2
: Black outline with no colors.
set ray_trace_mode, 3
: quantized color with black outline.
Notice that you can change the color of the outline with the set ray_trace_color
command.
|
|
Change the background color in PyMOL
A black background color is rarely useful for publication types of images. Therefore, while we already discuss how to change the color and the appearance of your system here, we still need to discuss how to change the background color in PyMOL.
To change the background color in PyMOL use the bg_color
command followed by the color you want.
|
|
Some examples:
|
|
In some cases, you may also want to create a representation of your system with an opaque background. This is especially useful when you want to overlay your molecular structure on top of another image or integrate it into a larger design (e.g., a poster or a presentation).
To achieve this you need to use the set ray_opaque_background
command. You can set the opaque background on
or off
:
set ray_opaque_background, on
$\Rightarrow$ Non-transparent backgroundset ray_opaque_background, off
$\Rightarrow$ Transparent background
This will make the background transparent and export the image with a transparent background:
|
|
The image from PyMOL will be shown over a checkerboard and will only appear transparent once you export it.