Table of Contents
The most common use of NMRView involves visualizing and analyzing NMR spectra. Many users of NMRView will use other programs to transform the original time domain data into the frequency domain. Since there is no standard data format for NMR spectra that is in common use, NMRView has been designed to be very flexible in its ability to read spectra. Table 1 lists the file formats that NMRView can read directly without user needing to specify any parameters. Other file formats can be read by creating an NMRView parameter file that contains a description of the layout of the file.
Table 5.1. File Formats for Some NMR Processing Programs
| Program | Format | File Header | Block Header | Parameters |
|---|---|---|---|---|
| nmrPipe | Serial | 2048 | 0 | File Header |
| Felix | Sub-matrix | 2048 | 0 | File Header |
| VNMR | Serial | 32/28 | 24 | File Header and Param File |
| XWIN-NMR | Sub-matrix | 0 | 0 | Param File |
| NMRView | Sub-matrix | 2048 | 0 | File Header and Param File |
The discussion of NMR file formats does not make for very exciting reading. On the other hand many NMR spectroscopists have experienced the frustration of having collected perfectly good spectra but not been able to visualize them because of confusion over the data formats. In light of this perhaps the reader will bear with us as we summarize some of the features of the more common NMR file formats. As indicated in Table 1, files containing NMR data are commonly found in two different formats. In the serial format the experimental progression of data points (all the points in one row, followed by all the points in the next row) corresponds exactly to the order of data points in the actual data file (Figure 4). In the sub-matrix format a portion (the block size) of a row is followed by further portions of subsequent rows before the remaining data values of the row are found (Figure 4).
Of the two, the sub-matrix format provides for a layout of data on the disk that is much more efficient for NMRView to access. This is particularly true if the data are to be displayed in different orientations or if multiple datasets are to be analyzed simultaneously. Instead of accessing files with a serial format directly, it is generally better to convert them to the more efficient sub-matrix format.
The data file format for Felix files (10) is the sub-matrix format which is therefore already in an optimal format. NMRView can read these files directly. As noted in Table 1 the parameters describing the layout of the Felix file are contained within the file itself. NMRView can extract these parameters allowing it to properly read the data without any additional instructions. Furthermore when copying the Felix format file to another directory it is not necessary to copy any additional files with it. Note, that NMRView will only read Felix files that are in a real, rather than complex, data format.
The data file format for nmrPipe (11) files is the serial format. It is possible, by creating an appropriate parameter file, for NMRView to read these files directly. It is, however, preferable to convert them to the native NMRView format if they are to be used for more than a brief examination. Because of nmrPipe's elegant use of pipes, the user does not need to actually create an nmrPipe file and then convert it.
The processing scheme in nmrPipe is implemented by having a series of instances of the nmrPipe program executing at the same time. Each instance carries out a single processing step, for example, the Fourier transform. The output of one instance is directed to the input of the next instance by the use of UNIX pipes. At the beginning of the pipeline of programs is a program for reading data files, and at the end of the pipeline is a program for writing files. To produce a file in the format used by NMRView the last program in the pipeline should be pipe2xyz executing with the "-nv" flag.
FID | var2pipe | nmrPipe -SB | nmrPipe -FT | pipe2xyz -nv > NMRViewFile
By executing the processing scheme in this manner the data are moved directly, via the pipeline, from the original FID to the NMRView format output file. Parameters are stored in the nmrPipe file and are correctly carried all the way through the processing in to the NMRView file. Because of this it is useful to ensure that that the referencing parameters are set up correctly at the head of the pipeline.
Sometimes nmrPipe processing is done so that the final result is stored in nmrPipe's own format, or perhaps you've received data in this format from another user. Typically the nmrPipe datasets are stored as one (if it's 2D data) 2D dataset, or a series of 2D datasets (each one a plane) for higher dimensional data. The xyz2pipe command can be used to read these files send a series of 1D vectors to the output of the pipeline. This data can then be piped into an instance of the pipe2xyz command running with the -nv flag and thus output into an NMRView format dataset. For example:
xyz2pipe -verb -in plane%03d.ft123 -y | pipe2xyz -out hnco.nv -nv
It's important to remember that the nmrPipe data is always stored as a series of vectors within each plane file, and the output to the processing pipeline corresponds to a series of vectors parallel to one particular axis of the dataset. The output dimension can be specified with an "-x", "-y", "-z" or "-a" argument to the xyz2pipe command ("-y" is used in the previous example). If none of these arguments are specified, or the "-x" argument is specified, the output vectors will correspond to the arrangement of the data as it exists in the nmrPipe plane files. Using the other arguments ("-y", "-z" or "-a" ) the data will be transposed as it is read and then output as the specified dimension. Normally, these arguments can be used with the pipe2xyz command as well, but not if the "-nv" flag is included. Using "pipe2xyz -nv" the data is output to the NMRView file parallel to the same dimension as it is received from the pipeline. NMRView can work with no performance penalty with the data in any orientation, but often users prefer to have the dataset dimensions along particular axes. You may need to use the "-x", "-y", "-z" or "-a" arguments to the xyz2pipe command, or the "TP" or "ZTP" transpose commands with nmrPipe to have the data end up in your preferred orientation.
3.1.3 The data file format for VNMR (12) phase files is the serial format. As with nmrPipe files NMRView can read these files directly, but it is preferable to convert them to a sub-matrix format such as that used by NMRView. VNMR stores parameters in both file and block headers, and in an associated text-format parameter file. One dimensional and two-dimensional files can be converted to NMRView format using NMRView itself.
To convert a VNMR file to the NMRView file format choose the "Convert Varian Phasefile" item from the "Dataset" menu. The program will prompt you for input and output files and then convert the file. It is very important to note that Varian phasefiles can contain "holes" where the actual data have not been written to the disk file. To ensure that this is not the case, draw the entire file (full plot limits) and then issue a flush command within VNMR.
The data file format for processed XWIN-NMR(13) files (1r, 2rr, etc.) is the submatrix format. NMRView can read these files directly. At present, NMRViewJ can directly extract the necessary parameters to open these files, while with NMRView it is necessary to setup of a parameter file describing the content (see below).
Every spectral data file that NMRView opens can have associated with it a parameter file, the name of which is the base name of the data file with a ".par" extension (e.g. the par file for noesy.nv is noesy.par). This file can be used to store different reference parameters (which will override those contained in the actual data file) and store parameters which define the layout of data within the data file. Figure 5 shows a sample parameter file for a three dimensional file.
Opening a data file in a format that NMRView does not automatically recognize can be accomplished by creating a parameter file defining the layout of the content in the data file. The most important lines in the parameter file are the first two, which specify the header and dimensionality of the data file. Some examples:
A 512x512 file with 64x64 sub-matrix blocks and no header (typical of a Bruker file):
header 0 0
dim 2 512 512 64 64
A 2048x2048 file in a serial format with a 2048 block file header (typical of an nmrPipe file):
header 2048 0
dim 2 2048 2048 2048 1
To load a dataset into NMRView choose the "Open Dataset" item from the Datasets menu. From the dialog that appears you can choose one or more datasets to open. Remember, NMRView has no arbitrary limits on the number of datasets open at once, so go ahead and open all the datasets you need. As a convenience, you can also choose "Open and Draw Dataset" from the same menu. This will automatically create a spectrum display window and draw the selected dataset in it. You can also type the "nv_dataset open datasetName" command in the console or add one or more of these commands to a Tcl script file to automate opening datasets.
NMRView uses a conservative approach in changing the reference information of a data file. The original data file is never modified; instead, changes to the referencing are made persistent by creating the above-mentioned parameter file. A dialog panel (Figure 6) exists for adjusting all the reference information and then creating the parameter file. It is important to remember that if a data file is copied from one disk location to another the parameter file needs to be copied to the new location as well
The datasets used by NMRView must have been previously transformed to the Frequency Domain and converted to a file format compatible with NMRView. NMRView can, in theory, read many different block structured file formats, though it has only been tested extensively with those created by FELIX (Accelerys, Inc.) and our own file converters. When NMRView opens a dataset it attempts to determine the file type automatically. It does this by checking the consistency of various parameters in the file header. First it tests for the NMRView format, next for the FELIX format and finally for the VNMR (Varian Inc.) format. If it succeeds in determining the filetype it opens attempts to open a parameter fileand interpret any commands therein that set parameters such as sweepwidth or spectrometer frequency. These will override any values specified in the file header. If NMRView fails to interpret the file type it then attempts to open the parameter file. If the appropriate parameters are present describing the number of dimensions, dimension sizes and block sizes NMRView will be able to read most any block structured file.
VNMR (Varian, Inc.) phasefiles can be read directly, however, the VNMR format is not optimal for use in NMRView. It is better to convert them to a block structured format that is preferred by NMRView. Select the menu item under the Dataset Menu on the Control panel to convert files to NMRView format.
If you are using FELIX to generate the matrix you can reference the dataset and set the axis mode to ppm. Also give meaningful names to the label used for each axis as these labels determine cursor tracking and peak display. Alternatively, you can leave the matrix unreferenced and enter the referencing information in a parameter file.
If you are are using the program nmrPipe to process datasets you can use the program pipe2xyz (with the -nvflag) to convert them to an NMRView compatible format. As with FELIX datasets, NMRView will recognize the reference information in the nmrPipe files.