Literate programming with CCTBX and PyMOL in Jupyter notebooks

Blaine H. M. Mooers · Acta Crystallographica Section A Foundations and Advances · 2021

Computational notebooks like Jupyter notebooks facilitate the practice of literate programming.Literature programming involves writing prose with inserts of executable code.The output from the code is woven in amongst the prose in the document.The reader can interact with the code and explore the effects on the output of changing the values of parameters.The reader can import new sets of real or simulated data for analysis with the same code.The code can also be exported from the notebook into a script file for independent execution.Here, we provide support for literate programming by structural biologists in Jupyter Notebooks being run in JupyterLab via PyMOL code written in Python for passing commands from the Jupyter Notebook to PyMOL by means of the PyMOL's application programming interface (API) for Python.The support is in the form of the Jupyterlabpymolpysnips library (https://github.com/MooersLab/jupyterlabpymolpysnips)(Mooers 2021a).We also supply support for using the cctbx library alongside PyMOL in the same notebook via the Jupyterlabcctbxpysnips library (https://github.com/MooersLab/jupyterlabcctbxsnips)(Mooers2021b).Jupyter notebooks can be simultaneously edited and run in several text editors and integrated development environments (IDEs) like PyCharm and Visual Studio Code.We also support these activities with libraries formatted for these coding additional environments.Literate programming is one way to support reproducible research for some portions of the structural biology workflow.

Read the paper · More papers on PaperTik