Nuclear magnetic resonance (NMR) spectroscopy is a key analytical technique in the biomedical field, finding uses in drug discovery, metabolomics, and imaging as well as being the primary method for the determination of the structures of biological macromolecules in solution. In the course of a modern NMR structural or dynamic study of proteins and other biomolecules, experiments typically generate multiple gigabytes of 2D, 3D and even 4D data sets which must be collected, processed, analyzed, and visualized to extract useful information. The field has developed a number of software products to perform these functions, but few software suites exist that can perform all of the tasks which a typical scientist requires. For example, it is not uncommon for NMR data to be collected using software provided by the spectrometer vendor, processed and visualized using software from the NIH, and analyzed using software from a University, collaborator or developed in house. Complicating this process is the lack of a standard format for storing NMR data; each software program typically uses its own format for data storage.
nmrglue is an open source Python module for working with NMR data which acts as the "glue" to tie together existing NMR programs, and can be used to rapidly develop new NMR processing, analysis or visualization methods. With nmrglue, spectral data from a number of common NMR file formats can be accessed as numpy arrays. This data can be sliced, rearranged or modified as needed and written out to any of the supported file formats for later use in existing NMR software programs. In this way, nmrglue can act as the "glue" to tie together NMR workflows which employ existing NMR software.
In addition, nmrglue can be used in conjunction with other scientific python libraries to rapidly test, prototype, and develop new methods for processing, analyzing, and visualizing NMR data. The nmrglue package provides a number of common NMR processing functions, as well as implementation of scientific routines which may be of interest to other Python projects including peak pickers, multidimensional lineshape fitting routines, linear prediction functions, and a bounded least squares optimization. These functions together, with the ability to read, write and convert between a number of common file formats, allow developers to harness nmrglue for established routines while focusing on the novel portion of the new method being created. In addition, the numerical routines in numpy and scipy can be used to further speed this process. If these packages are used with the Ipython shell and matplotlib, a robust, interpreted environment for exploring and visualizing NMR data can be created using only open source software.
nmrglue is distributed under the New BSD license. Documentation, tutorials, examples, and downloadable install files and source code are available at http://code.google.com/p/nmrglue/. Despite a limited exposure in the scientific field, nmrglue is already used in a number of university research labs and portions of the package have been adapted for use in VeSPA, a software suite for magnetic resonance spectroscopy.