Mooers Blaine H M
Department of Biochemistry and Molecular Biology, University of Oklahoma Health Sciences Center, Oklahoma City, Oklahoma.
Stephenson Cancer Center, University of Oklahoma Health Sciences Center, Oklahoma City, Oklahoma.
Protein Sci. 2016 Oct;25(10):1873-82. doi: 10.1002/pro.2996. Epub 2016 Aug 16.
Scripts are used in PyMOL to exert precise control over the appearance of the output and to ease remaking similar images at a later time. We developed horizontal scripts to ease script development. A horizontal script makes a complete scene in PyMOL like a traditional vertical script. The commands in a horizontal script are separated by semicolons. These scripts are edited interactively on the command line with no need for an external text editor. This simpler workflow accelerates script development. In using PyMOL, the illustration of a molecular scene requires an 18-element matrix of view port settings. The default format spans several lines and is laborious to manually reformat for one line. This default format prevents the fast assembly of horizontal scripts that can reproduce a molecular scene. We solved this problem by writing a function that displays the settings on one line in a compact format suitable for horizontal scripts. We also demonstrate the mapping of aliases to horizontal scripts. Many aliases can be defined in a single script file, which can be useful for applying costume molecular representations to any structure. We also redefined horizontal scripts as Python functions to enable the use of the help function to print documentation about an alias to the command history window. We discuss how these methods of using horizontal scripts both simplify and enhance the use of PyMOL in research and education.
脚本在PyMOL中用于对输出外观进行精确控制,并便于日后重新制作类似图像。我们开发了水平脚本以简化脚本开发。水平脚本在PyMOL中能像传统垂直脚本一样创建完整场景。水平脚本中的命令用分号分隔。这些脚本可在命令行上交互式编辑,无需外部文本编辑器。这种更简单的工作流程加速了脚本开发。在使用PyMOL时,分子场景的图示需要一个18元素的视口设置矩阵。默认格式跨多行,手动重新格式化为一行很费力。这种默认格式阻碍了能重现分子场景的水平脚本的快速组装。我们通过编写一个函数解决了这个问题,该函数以适合水平脚本的紧凑格式在一行上显示设置。我们还展示了别名到水平脚本的映射。可以在单个脚本文件中定义许多别名,这对于将自定义分子表示应用于任何结构很有用。我们还将水平脚本重新定义为Python函数,以启用使用帮助函数将别名文档打印到命令历史窗口。我们讨论了这些使用水平脚本的方法如何在研究和教育中简化并增强PyMOL的使用。