Introduction to nmrPipe


Notes on using NMRPipe


1. Manual pages are available for the following commands. Type “man nmrPipe” in a unix terminal to view pages.
  • nmrPipe
  • xyz2pipe
  • var2pipe (included in bruk2pipe discussion)
  • LP (linear prediction)
  • FT (Fourier transform)
  • HT (Hilbert transform)
  • ZF (zero filling)
  • SP (apodization)
  • EXT (extract)
  • nmrDraw

2. Processing of NMR data by NMRPipe is accomplished with scripts. These are text files that contain the appropriate commands and parameters for conversion of the data to NMRPipe format and then transformation (including zero filling, linear prediction, apodization, Fourier transformation, etc). The scripts can be left in the directory containing the data (and spectra) as a record of how the processing was performed. The scripts contain a ".com" suffix and must be made executable. Execution is initiated by typing the script name (e.g. fid.com) in a terminal window. You must be in the directory containing the data to be processed.

Viewing Spectra:
NMRPipe does not provide any means to view the spectra. NMRDraw is a simple graphics program provided with NMRPipe that can be used for this purpose. It is especially useful for determining the appropriate phasing parameters to include in NMRPipe.

3. Data conversion to NMRPipe format:
This is accomplished with a script commonly called fid.com. It is easy to create the script with a Tcl/Tk script generator window that results from typing "varian" in a terminal window. Select the fid file to input using the "Spectrometer Input" scroll down input window. Click the "Read Parameters" button at the bottom to input the parameters from the Varian file header.

Any boxes that are highlighted in yellow may contain parameters that need to be modified. Select the appropriate frequency for the second and third dimensions using the pull tabs adjacent to each entry box. The y-axis Acquisition Mode should be set to States-TPPI and the z-axis Acquisition Mode should be set to Rance-Kay for Gradient Selected Sensitivity Enhanced data in the N15 dimension (usually the third dimension in 3D data). The resulting script can be used immediately or saved to be run later.

The saved script may need to be made executable by typing chmod a+x "script name".

Run the script by typing its name in a terminal window.

A sample script for converting a 3D Varian data file is shown below. All scripts should begin with the line #!/bin/csh to function properly. The conversion routine var2pipe converts the data. It and all the options are one statement, and continuation of the statement from one text line to the next is indicated with a "\" symbol. No spaces can follow the \. The var2pipe routine converts the data, with the options (indicated with keywords preceded with a "-" sign, e.g. -in) following the command specifying the parameters required for proper processing. The NMRPipe manual should be consulted for details on the options. Briefly, this script reads in the Varian data file (fid) which contains 256 real points in the first dimension (H1), 128 in the second (C13) dimension, and 32 in the third (N15). Spectral widths, carrier frequencies for the three dimensions, chemical shifts of the center frequencies are given. Data is output as a series of 2D planes in the directory "data", and are numbered 1-64 (test001.fid, test002.fid ... test064.fid). The -ov option indicates that previous contents in this directory will be overwritten. The -verb option provides some output during processing to indicate progress.

#!/bin/csh

var2pipe -in fid -aqORD 1 \
-xN 512 -yN 256 -zN 64 \
-xT 256 -yT 128 -zT 32 \
-xMODE Complex -yMODE States-TPPI -zMODE Rance-Kay \
-xSW 6000.150 -ySW 3017.072 -zSW 2199.978 \
-xOBS 499.879 -yOBS 125.716 -zOBS 50.658 \
-xCAR 4.725 -yCAR 176.036 -zCAR 119.596 \
-xLAB H1 -yLAB C13 -zLAB N15 \
-ndim 3 -aq2D States \
-out data/test%03d.fid -verb -ov


Note that it may be necessary to create a data directory prior to running this script (e.g. mkdir data).

3. Scripts for processing 2D and 3D data can be found in the NMRPipe manual. There are good discussions of linear prediction and zero filling. Representative working scripts are given here for common Varian data files.

Processing N15 HSQC spectra:

The first script (called, e.g., fid.com) could be:
#!/bin/csh

var2pipe -in ./fid \
-xN 2048 -yN 512 \
-xT 1024 -yT 256 \
-xMODE Complex -yMODE Rance-Kay \
-xSW 10000.000 -ySW 3242.017 \
-xOBS 799.771 -yOBS 81.049 \
-xCAR 4.725 -yCAR 119.382 \
-xLAB H1 -yLAB N15 \
-ndim 2 -aq2D States \
-out ./test.fid -verb -ov

sleep 5

The following script (called, e.g., ft2d.com) uses the POLY function to remove residual solvent (works well!) followed by sine bell apodization (SP), zero filling (ZF), Fourier transformation (FT), and phasing (PS) and extraction of the left half of the spectrum (EXT). Transposition is required to move to the second dimension (TP), followed by sine bell apozidation, zero filling, Fourier transformation, and phasing.

#!/bin/csh

nmrPipe -in test.fid \
| nmrPipe -fn POLY -time \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 1 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT -auto \
| nmrPipe -fn PS -p0 -0.0 -p1 0.0 -di -verb \
| nmrPipe -fn EXT -left -sw \
| nmrPipe -fn TP \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 1 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT -auto \
| nmrPipe -fn PS -p0 0.0 -p1 0.0 -di -verb \
-ov -out hsqc.ft2

The following routine includes linear prediction in the N15 dimension (included in the linear prediction as written here is a doubling of the number of points which means the zero filling is not done explicitly). Note that linear prediction increases the processing time considerably. Therefore it is advisable to process the data without linear prediction and with all phasing parameters set to zero. The resulting spectrum can be phased using NMRDraw (see below). Only the H1 dimension should require phasing and only the p0 parameter should need to be adjusted. The phasing parameters are then entered into the script with linear prediction for final processing.

#!/bin/csh

nmrPipe -in test.fid \
| nmrPipe -fn POLY -time \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 1 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT -auto \
| nmrPipe -fn PS -p0 -216 -p1 0.0 -di -verb \
| nmrPipe -fn EXT -left -sw \
| nmrPipe -fn TP \
| nmrPipe -fn LP \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 1 \
| nmrPipe -fn FT -auto \
| nmrPipe -fn PS -p0 0.0 -p1 0.0 -di -verb \
-ov -out hsqc.ft2

The following script is an example of how a 3D transformation might be performed. This script uses the SOL option to remove solvent in the 1H dimension (also works well). Note that after each dimension is transformed the data is written to a directory called lp. Note that LP is only performed in a given dimension if the other two dimensions have been transformed. In this script, the H and then the N dimensions are transformed. The C dimension is then linearly predicted and transformed. Then the N dimension is inverse transformed (after a Hilber Transform (HT) is used to reconstruct the imaginary components) to recreate the fids, linear predicted, and then Fourier transformed again.

#!/bin/csh

xyz2pipe -in data/test%03d.fid -x -verb \
| nmrPipe -fn SOL \
| nmrPipe -fn SP -off 0.5 -end 0.98 -pow 2 -c 0.5 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 43 -p1 0.0 -di \
| nmrPipe -fn EXT -left -sw \
| pipe2xyz -out lp/test%03d.ft3 -x

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 0.5 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 0.0 -p1 0.0 -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace

xyz2pipe -in lp/test%03d.ft3 -y -verb \
| nmrPipe -fn LP -ord 10 \
| nmrPipe -fn SP -off 0.5 -end 0.98 -pow 1 -c 1.0 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 0 -p1 0 -di \
| pipe2xyz -out lp/test%03d.ft3 -y -inPlace

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn HT -auto \
| nmrPipe -fn PS -inv -hdr \
| nmrPipe -fn FT -inv \
| nmrPipe -fn ZF -inv \
| nmrPipe -fn SP -inv -hdr \
| nmrPipe -fn LP -ps0-0 \
| nmrPipe -fn SP -hdr \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -hdr -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace

4. Phasing:
Open a transformed spectrum using NMRDraw and hit "H" to obtain a horizontal trace. Adjust the p0 phase slide bar at the top of the window to phase (p1, i.e. second order corrections should not be needed). Note the final value and write this into the processing script; if there was already a p0 value, add the new value to obtain the correct value). Reprocess the data.

5. Writing from NMRPipe to a FELIX file type
At the end of the processing script, finish the processing with a pipe2xyz statement to write to transformed data to a directory,

| pipe2xyz -out ft/test%03d.ft3 -verb \

then reopen and write to a matrix file as follows:

xyz2pipe -in ft/test%03d.ft3 -x -verb \
| pipe2flx -out test.mat -ov

The pipe2flx routine is not part of NMRPipe and must be downloaded from the Madison NMR site. Note that this matrix file does not have the correct format to be read properly into NMRView.

6. Writing from NMRPipe to an NMRView file type
At the end of the processing script, finish the processing with a pipe2xyz statement to write the transformed data to a directory, then reopen and write to an nv file as follows:

| pipe2xyz -out ft/test%03d.ft3 -verb \

xyz2pipe -in ft/test%03d.ft3 -x -verb \
| pipe2xyz -nv -ov -out test.nv



7. When to use PS -p0 -90 -p1 180 (From Ranjith Muhandiram)
Search the code for if(f1180)='y' tau1 += (1/2*sw1) (i.e. nothing is subtracted from half the dwell time), then you know if f1180 ='n', tau1 is exactly zero for ni=1. In this case you can set f1180='n' and get 0/0 phasing. (This is asuming there are no other zero order phase correction due to phase shifted pulses).
If you see 'if f1180='y' tau1 += (1/2*sw1-2?PI*pw-4.0e-6 - ....etc)
else
tau1 = tau1 = 2/PI*pw-4.0e-6 - ... etc
then you know if f1180='n' for ni=1, the chemical shift evolution time is not exactly zero (it is 2/Pi*pw + 4.0e-6+...etc in my example written here). So if you set f1180='n' in such a situation you will get a frequency dependent phase correction. In this case if you set f1180='y' then you force the first time point to be half a dwell and get a frequency dependent phase correction 180 degrees across the spectrum. Since the middle of the spectrum (i.e. on resonance should not have any evolution, you have to apply a -90 degree zero phase correction): so you get p0=-90/p1=180.
********************************************************************
EXAMPLES:
********************************************************************

HNCO Processing:

#!/bin/csh

xyz2pipe -in data/test%03d.fid -x -verb \
| nmrPipe -fn SOL \
| nmrPipe -fn SP -off 0.5 -end 0.98 -pow 2 -c 0.5 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 43 -p1 0.0 -di \
| nmrPipe -fn EXT -left -sw \
| pipe2xyz -out lp/test%03d.ft3 -x

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn SP -off 0.5 -end 0.95 -pow 1 -c 0.5 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 0.0 -p1 0.0 -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace

xyz2pipe -in lp/test%03d.ft3 -y -verb \
| nmrPipe -fn LP -ord 10 \
| nmrPipe -fn SP -off 0.5 -end 0.98 -pow 1 -c 1.0 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 0 -p1 0 -di \
| pipe2xyz -out lp/test%03d.ft3 -y -inPlace

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn HT -auto \
| nmrPipe -fn PS -inv -hdr \
| nmrPipe -fn FT -inv \
| nmrPipe -fn ZF -inv \
| nmrPipe -fn SP -inv -hdr \
| nmrPipe -fn LP -ps0-0 \
| nmrPipe -fn SP -hdr \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -hdr -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace


********************************************************************
********************************************************************
HNCACB

#!/bin/csh

xyz2pipe -in data/test%03d.fid -x -verb \
| nmrPipe -fn SOL \
| nmrPipe -fn SP -off 0.45 -end 1.00 -pow 2 -c 1 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 -32.8 -p1 0.0 \
| nmrPipe -fn EXT -left -di -sw \
| pipe2xyz -out lp/test%03d.ft3 -x

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn SP -off 0.45 -end 0.95 -pow 1 -c 1 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -p0 0.0 -p1 0.0 -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace

xyz2pipe -in lp/test%03d.ft3 -y -verb \
| nmrPipe -fn LP -ps0-0 \
| nmrPipe -fn SP -off 0.45 -end 0.95 -pow 1 -c 1.0 \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn REV \
| nmrPipe -fn PS -p0 0 -p1 0 -di \
| pipe2xyz -out lp/test%03d.ft3 -y -inPlace

xyz2pipe -in lp/test%03d.ft3 -z -verb \
| nmrPipe -fn HT -auto \
| nmrPipe -fn PS -inv -hdr \
| nmrPipe -fn FT -inv \
| nmrPipe -fn ZF -inv \
| nmrPipe -fn SP -inv -hdr \
| nmrPipe -fn LP -ps0-0 \
| nmrPipe -fn SP -hdr \
| nmrPipe -fn ZF -auto \
| nmrPipe -fn FT \
| nmrPipe -fn PS -hdr -di \
| pipe2xyz -out lp/test%03d.ft3 -z -inPlace