plotUtils {rNMR}R Documentation

rNMR Plotting utilities

Description

Utilities for plotting one and two-dimensional spectra in rNMR.

Usage

draw2D(in.folder = fileFolder[[wc()]], 
	w1Range = in.folder$graphics.par$usr[3:4], 
	w2Range = in.folder$graphics.par$usr[1:2], 
	pos.zlim = c(in.folder$file.par$noise_est * in.folder$graphics.par$clevel, 
	in.folder$file.par$noise_est * in.folder$graphics.par$clevel * 
	in.folder$graphics.par$nlevels), neg.zlim = -(rev(pos.zlim)), 
	type = in.folder$graphics.par$type, 
	pos.color = in.folder$graphics.par$pos.color, 
	neg.color = in.folder$graphics.par$neg.color, 
	nlevels = in.folder$graphics.par$nlevels, 
	conDisp = in.folder$graphics.par$conDisp, 
	xlab = paste(in.folder$file.par$nucleus[2], "PPM", sep = " "), 
	ylab = paste(in.folder$file.par$nucleus[1], "PPM", sep = " "), 
	main = in.folder$file.par$user_title, roiMax = globalSettings$roiMax, 
	add = FALSE, axes = TRUE, ...)
drawNMR(in.folder = fileFolder[[wc()]], w1Range, w2Range, pos.zlim, neg.zlim, 
	type, pos.color, neg.color, nlevels, conDisp, bg, fg, col.axis, col.lab, 
	col.main, col.sub, col, xlab = NULL, ylab = NULL, 
	main = in.folder$file.par$user_title, add = FALSE, p.window = "main", 
	axes = TRUE, offset = 0, ...)
plot1D(in.folder = fileFolder[[wc()]], 
	w1Range = in.folder$graphics.par$usr[3:4], 
	w2Range = in.folder$graphics.par$usr[1:2], 
	col = in.folder$graphics.par$proj.color, 
	type = in.folder$graphics.par$type, xlab = NULL, ylab = NULL, 
	main = in.folder$file.par$user_title, 
	roiMax = globalSettings$roiMax, add = FALSE, axes = TRUE, offset = 0, ...)
plot2D(in.folder = fileFolder[[wc()]], 
	w1Range = in.folder$graphics.par$usr[3:4], 
	w2Range = in.folder$graphics.par$usr[1:2], 
	pos.zlim = c(in.folder$file.par$noise_est * in.folder$graphics.par$clevel, 
	in.folder$file.par$noise_est * in.folder$graphics.par$clevel * 
	in.folder$graphics.par$nlevels), neg.zlim = -(rev(pos.zlim)), 
	type = in.folder$graphics.par$type, 
	pos.color = in.folder$graphics.par$pos.color, 
	neg.color = in.folder$graphics.par$neg.color, 
	nlevels = in.folder$graphics.par$nlevels, 
	conDisp = in.folder$graphics.par$conDisp, 
	xlab = paste(in.folder$file.par$nucleus[2]), 
	ylab = paste(in.folder$file.par$nucleus[1]), 
	main = in.folder$file.par$user_title, add = FALSE, axes = TRUE, ...)	
proj1D(in.folder = fileFolder[[wc()]], 
	w1Range = in.folder$graphics.par$usr[3:4],
	w2Range = in.folder$graphics.par$usr[1:2],
	col = in.folder$graphics.par$proj.color, filter = globalSettings$filter,
	proj.direct = globalSettings$proj.direct, type = globalSettings$proj.type,
	xy = NULL, ...)
ucsf1D(file.name = NULL, w2Range = NULL, file.par = NULL)
ucsf2D(file.name = NULL, w1Range = NULL, w2Range = NULL, file.par = NULL)
ucsfHead(file.name = NULL, print.info = TRUE)

Arguments

in.folder

list; file and graphics parameters for the file to be plotted as listed in fileFolder.

w1Range

numeric vector; chemical shift range in the indirect dimension, default is the most recent setting used with the file, the format is c(lower,upper).

w2Range

numeric vector; chemical shift range in the direct dimension, default is the most recent setting used with the file. The format is c(lower,upper).

pos.zlim

numeric vector; min and max positive intensities to be displayed, default is the most recent setting used with the file. The format is c(lower,upper).

neg.zlim

numeric vector; min and max negative intensities to be displayed, default is the most recent setting used with the file. The format is c(lower,upper).

type

see plot.

pos.color

character string; color for positive contours, default is the most recent setting for the file, see colors for the many color options.

neg.color

character string; color for negative contours, default is the most recent setting for the file, see colors for the many color options.

nlevels

numeric; the number of contour intervals to be drawn, the default is the most recent setting used for the file.

conDisp

logical vector; c(TRUE, TRUE) plots positive and negative contours, c(TRUE, FALSE) plots only positive, c(FALSE, TRUE) plots only the negative contours, c(FALSE, FALSE) does not plot any contours.

xlab

see plot.

ylab

see plot.

main

see plot.

roiMax

logical; if TRUE, plots a point on the maximum visible signal in the window.

add

logical; if TRUE, adds new data to an existing plot, if FALSE generates a new plot.

axes

logical; if TRUE, makes pretty labels.

bg

see par.

fg

see par.

col.axis

see par.

col.lab

see par.

col.main

see par.

col.sub

see par.

col

see par.

p.window

character string; the window to be used for the plot, can be "main", "sub", "multi", or "stats".

offset

numeric; the percentage of the total z range with which to displace a spectrum. This is used to create stacked 1D spectra.

filter

function; a vector capable function (e.g. min, max, sd) used to filter 2D data into a 1D projection, non function arguments prompt users to select a slice.

proj.direct

numeric; 1 projects data across the direct axis, 2 across the indirect.

xy

numeric; x and y coordinates indicating the slice to display. The optional argument may be supplied as an alternative to interactive slice selection.

file.name

character string; full path for the file to be read, NULL will open a file selection window.

file.par

list; file parameters as found in the header of the ucsf file designated by the file.name parameter. This argument is optional and is used to speed up graphics by foregoing noise estimation.

...

additional graphics parameters can be passed to par.

print.info

logical; prints header information if TRUE.

Details

draw2D

Draws a 2D NMR spectrum from a binary connection. This function replaces plot2D when creating ROI subplot and multiple file windows, as it is more efficient for batch operations.

drawNMR

Wrapper and routing function for lower level plotting functions in rNMR.

plot1D and plot2D

Draw sparky (ucsf) format spectra from a binary connection.

proj1D

Projects a 2D spectrum into a single dimension.

ucsf1D and ucsf2D

Read sparky (ucsf) format spectra and return data within the specified range. The "data" section

ucsfHead

Read header information from a sparky (ucsf) format spectrum and return data used to populate "file.par" section of fileFolder.

Value

ucsf1D() and ucsf2D() return a list containing:

file.par - Header information for the spectrum including file name, nuclei, number of dimensions, spectrum width, etc.

w1 - Chemical shifts in the indirect dimension.

w2 - Chemical shifts in the direct dimension.

data - The data from the spectrum, as a matrix of intensities for 2D spectra or a vector for 1D slices and plots. The first data point in a matrix of 2D intensities, [1, 1], corresponds to the downfield-most point, in both dimensions, for the spectrum. The last data point in the matrix corresponds to the upfield-most point, in both dimensions, for the spectrum. In other words, if you traverse the matrix 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). See import for details on the contents of the ROI table, ROI summary, and peak list objects.

ucsfHead() returns a list containing the same fields present in the "file.par" section of fileFolder.

Author(s)

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

See Also

toolkit for other rNMR utility functions.


[Package rNMR version 1.1.9 Index]