Rapid generation of high-quality structure figures for publication with PyMOL-PUB

Abstract Motivation 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. Results 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. Availability and implementation Our tool is publicly available at https://github.com/BGI-SynBio/PyMOL-PUB.


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€ odinger, 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.

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: 1) hide unimportant elements; 2) adjust structure states by translation, rotation, and scaling; 3) select specific parts of one or more structures; 4) specify the presentation mode and coloring scheme; 5) 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-meansquare 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.

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).

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.

Figure 1 .
Figure 1.(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