This function reads 1D-4D spectra stored in the NMRPipe format.

read_nmrpipe(inFormat, dim_order = NULL, complex_data = FALSE)

Arguments

inFormat

character with file name or format for multiple files

dim_order

integer vector used to reorder dimensions or character specifying

complex_data

logical value indicating whether complex data should be read

Value

a named list with four elements:

int

multidimensional array with spectrum intensities (ppm values are given in the dimnames)

ppm

list of numeric vectors giving the ppm values associated with each int array dimension

fheader

matrix with dimension-specific header information

header

numeric vector with the complete header contents

The fheader row definitions are as follows (taken from NMRPipe fdatp.h):

Row NameDescription
SIZENumber of points in dimension
APODCurrent valid time-domain size
SWSweep Width, Hz
ORIGAxis Origin (Last Point), Hz
OBSObs Freq, MHz
FTFLAG1=Freq Domain 0=Time Domain
QUADFLAGData Type Code (See Below)
UNITSAxis Units Code (See Below)
P0Zero Order Phase, Degrees
P1First Order Phase, Degrees
CARCarrier Position, PPM
CENTERPoint Location of Zero Freq
AQSIGNSign adjustment needed for FT
APODCODEWindow function used
APODQ1Window parameter 1
APODQ2Window parameter 2
APODQ3Window parameter 3
C1Add 1.0 to get First Point Scale
ZFNegative of Zero Fill Size
X1Extract region origin, if any, pts
XNExtract region endpoint, if any, pts
OFFPPMAdditional PPM offset (for alignment)
FTSIZESize of data when FT performed
TDSIZEOriginal valid time-domain size
LBExtra Exponential Broadening, Hz
GBExtra Gaussian Broadening, Hz
GOFFOffset for Gaussian Broadening, 0 to 1
OBSMIDOriginal Obs Freq before 0.0ppm adjust

In addition several rows contain information inferred from the header data:

Row NameDescription
aq_sAcquisition time, seconds
sw_ppmOriginal Sweep Width, PPM
directDirect (1) or indirect (0) dimension
aliasAliasing (0/1) with inversion (-1)

Details

For three and four dimensional datasets, the spectral data is often spread across multiple files. To read those, inFormat should be a sprintf-style string that describes how the files are named. For instance, if the files are named 001.ft3, 002.ft3, etc., then inFormat should be "%03i.ft3". If there is no zero-padding, as in this case, 0 should be omitted from the format. If there are fewer digits, then the first 3 should be changed accordingly.

The default 2D NMRPipe scripts only have a single transpose ("TP") command, leaving the the indirect dimension as the first dimension in the resulting array. The 2D plotting functions in fitnmr usually plot this first dimension along the x-axis, which will make for generally non-standard contour plots. Furthermore, when peak fitting is employed, this will also be the first dimension. To fix this, you can change the spectral order with the dim_order parameter. The order of the dimensions should be specified in the same way that would be done for aperm. Alternatively, you can specify a character argument to have fitnmr attempt to automatically detect and correct the array order. The only currently supported type is "hx", which will put the dimension with the greatest observe frequency first.

This function is partly based on the pipe2rnmr function from rNMR.