| Literature DB >> 28901669 |
Stuart McNicholas1, Tristan Croll2, Tom Burnley3, Colin M Palmer3, Soon Wen Hoh1, Huw T Jenkins1, Eleanor Dodson1, Kevin Cowtan1, Jon Agirre1.
Abstract
Scripting programming languages provide the fastest means of prototyping complex functionality. Those with a syntax and grammar resembling human language also greatly enhance the maintainability of the produced source code. Furthermore, the combination of a powerful, machine-independent scripting language with binary libraries tailored for each computer architecture allows programs to break free from the tight boundaries of efficiency traditionally associated with scripts. In the present work, we describe how an efficient C++ crystallographic library such as Clipper can be wrapped, adapted and generalized for use in both crystallographic and electron cryo-microscopy applications, scripted with the Python language. We shall also place an emphasis on best practices in automation, illustrating how this can be achieved with this new Python module.Entities:
Keywords: Clipper; NumPy; Python; SWIG; automation; crystallography; electron cryo-microscopy; libraries; pipelines; scripting
Mesh:
Substances:
Year: 2017 PMID: 28901669 PMCID: PMC5734304 DOI: 10.1002/pro.3299
Source DB: PubMed Journal: Protein Sci ISSN: 0961-8368 Impact factor: 6.725
Figure 1Overview of the files and commands involved in the generation of the Python interface. The build system chosen for this project is cmake, as it is well integrated with both CCP4 and CCP‐EM build pipelines. The only machine‐dependent files (highlighted in yellow) are Clipper's pre‐existing shared objects (.so) and the new shared object generated by SWIG as a companion to the Python interface. Both files (clipper.py and _clipper.so) are required for the module to work, and are distributed as part of CCP4 and CCP‐EM.
Figure 2Structure and functions within clipper.MiniMol. The original C++ implementation of MiniMol makes use of STL vectors, which can contain MModel, MPolymer, MMonomer or MAtom. These have been extended to allow for natural Pythonic access (see example in the main text).
Figure 3Comparison of C++ and Python run times. The run times of a map cutting tool written in C++ (cmapcut.cpp from CCP4, using the Clipper library) VS a Python counterpart (cut_by_density.py from the clipper_tools module, using the clipper_python module and NumPy). The test dataset was composed of 100 entries—map and fitted atomic model—obtained from the Electron Microscopy Data Bank (EMDB [19]) which were selected based on resolution—better than 4.0 Å. The results (elapsed time, measured using the time UNIX tool) were plotted with MatPlotLib [14], scaling both axes by log10.