mrplot: A function for plotting NMR spectra.

View source: R/mrbin.R

mrplotR Documentation

A function for plotting NMR spectra.

Description

This function plots NMR spectra. A menu of commands is displayed to edit the plot view and add spectra. Multiple spectra will be overlaid, and if both 1D and 2D spectra are selected, they are shown in two plots with matched ranges.

Usage

mrplot(
  hideMenu = FALSE,
  folders = NULL,
  dimensions = NULL,
  intensity1D = NULL,
  zoom = NULL,
  color = NULL,
  background = NULL,
  lwd = 1,
  plotTitle = "",
  showNames = "Spectrum titles",
  graphics = TRUE,
  highlight = NULL,
  binlist = NULL,
  annotate = NULL,
  metaboliteIdentities = NULL,
  ...
)

Arguments

hideMenu

Do not show the menu. Defaults to FALSE

folders

Optional vector of folder names of spectra to load. Defaults to NULL

dimensions

Optional vector dimensions of spectra to load. Defaults to NULL

intensity1D

Optional value of initial 1D intensity. Defaults to NULL

zoom

Optional vector of initial zoom area. Defaults to NULL

color

Defines the color of the spectrum plot. If NULL, a rainbow theme is used for 2D NMR

background

Background color, defaults to NULL (no background fill, usually results in a white background)

lwd

Line width, defaults to 1

plotTitle

Plot title, defaults to "" (empty)

showNames

Display list of spectrum titles in plot, defaults to "Spectrum titles". Other options are "" and "Folder names"

graphics

Controls whether pop-up windows are shown for selections. Defaults to TRUE.

highlight

A vector of up to 2 frequencies that will be highlighted in the plot. If 2 values are provided the distance in Hz is shown as well. Defaults to NULL.

binlist

Optional: A vector containing bin names as they are generated by mrbin. These bins will be marked by rectangles in the plot. This could be useful for metabolite identification when having a list of significantly changing signals. Default is NULL.

annotate

Should peak annotation regions be shown?

metaboliteIdentities

Optional: A file path or 4-column matrix where each row belongs to one unique metabolite signal (left, right, top, bottom borders). Row names are metabolite names. For a file, this needs to be the file path for a .csv file containing such a matrix, the first columns containing metabolite names and the first row being a header. Each row belongs to one unique metabolite signal (left, right, top, bottom borders). Row names are metabolite names.

...

Additional graphical parameters that will be passed to the functions plot, lines, and/or contour

Value

None

Examples

resetEnv()
metaboliteIdentities=matrix(c(1.346,1.324,21,23,
                              4.12,4.1,70.8578,71.653,
                              3.052,3.043,30.5,33.5,
                              4.066,4.059,57,59.5,
                              2.582,2.479,46,49,
                              2.737,2.634,46,49),
                   ncol=4,byrow=TRUE)
rownames(metaboliteIdentities)=c("Lactate","Lactate","Creatinine","Creatinine","Citrate","Citrate")
mrplot(folders=c(system.file("extdata/1/12/pdata/10",package="mrbin"),
                 system.file("extdata/1/10/pdata/10",package="mrbin"),
                 system.file("extdata/2/10/pdata/10",package="mrbin"),
                 system.file("extdata/3/10/pdata/10",package="mrbin")),
       dimensions=c("2D","1D","1D","1D"),zoom=c(2.8,2.4,20,60),
       highlight=c(2.564,2.537),
       binlist=c("2.725,2.675","2.575,2.525"),
       annotate=TRUE,metaboliteIdentities=metaboliteIdentities,
       plotTitle="Significant Bins",intensity1D=24,hideMenu=TRUE)

mrbin documentation built on April 4, 2025, 5:24 a.m.