writeUcsf {rNMR}R Documentation

Save a spectrum in UCSF format

Description

Write a spectrum out to file in UCSF (Sparky) format.

Usage

writeUcsf(outPath, np, nuc, sf, sw, center, upShift, downShift, noiseEst, data, 
	inFolder, cor = FALSE, writeShifts = FALSE, writeNoise = FALSE)

Arguments

outPath

character string; full file path for the output spectrum.

np

numeric; the number of points in each dimension. For 2D spectra, the format should be c(indirect dimension, direct dimension). This format applies to all other dimension-specific arguments passed to writeUcsf as well.

nuc

character string; the nucleus names for each dimension.

sf

numeric; the spectrometer frequency (MHz) for each dimension.

sw

numeric; the sweep width (Hz) in each dimension (only required if writeShifts is set to FALSE, or for compatibility with Sparky).

center

numeric; the center (PPM) of the spectrum in each dimension (only required if writeShifts is set to FALSE).

upShift

numeric; the upfield chemical shifts (PPM) for the spectrum in each dimension (only required if writeShifts or cor are set to FALSE).

downShift

numeric; the downfield chemical shift (PPM) for the spectrum in each dimension (only required if writeShifts or cor are set to FALSE).

noiseEst

numeric; the noise estimate for the spectrum.

data

numeric vector or matrix; the data for the spectrum as it would be returned by ucsf2D. The first data point corresponds to the downfield-most point for the spectrum and the last data point in the matrix corresponds to the upfield-most point for the spectrum. In other words, if the matrix is traversed by rows, data points in the matrix start at the bottom- left of the spectrum and move up and to the right (as the spectrum would normally be viewed).

inFolder

list; data and file parameters for input spectrum. This should match the output format of ucsf2D. If provided, fields from this list will be used as values for any other arguments that are not provided.

cor

logical; if TRUE, the correction factor applied to the upfield chemical shift, center chemical shift, and sweep width when the UCSF file was originally read by rNMR will be negated when the new UCSF file is output. In this case, the up and downfield chemical shifts must be provided. This adjustment will not be applied to the upfield and downfield shifts themselves, but will be used in calculating the sweep width and center shift.

writeShifts

logical; if TRUE, the upfield and downfield chemical shifts will be included in the header for the output file.

writeNoise

logical; if TRUE, the noise estimate for the spectrum will be included in the header for the output file.

Value

The output path for the newly created UCSF file.

Author(s)

Ian A. Lewis ialewis@nmrfam.wisc.edu, Seth C. Schommer schommer@nmrfam.wisc.edu

References

Sparky user manual (http://www.cgl.ucsf.edu/home/sparky/manual/files.html#UCSFFormat)

See Also

toolkit for other rNMR utility functions.


[Package rNMR version 1.1.9 Index]