plotMS: Plot MS1 Spectrum

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotMSMS.R

Description

This is a wrapper function for plotSpectra for backwards compatability with previous workflows/scripts. plotSpectra offers much more functionality. xlim and ylim are fixed suited to MS1 spectra.

Usage

1
2
plotMS(mz, int, main, labels=NULL, formatFormula=TRUE, absInt=FALSE,ylim_factor=2,
smiles="")

Arguments

mz

Vector containing mz values (x) to plot.

int

Vector containing intensity values (y) to plot.

main

Title for the plot.

labels

Vector containing labels for selected peaks. If NULL, no labels are plotted.

formatFormula

If TRUE, uses chemistry2expression to create subscript numbers. Any + or - are removed to avoid errors. If FALSE, labels are printed as is. This is passed to chem2express in plotSpectra.

absInt

If TRUE, absolute intensity values are used. If FALSE, relative intensities are calculated on individual spectra, scaled to 1000.

ylim_factor

Scaling factor for y-axis. Default 2.5 leaves ample space for structure, annotations and legend. Reduce for peaks only. Passed to yfactor in plotSpectra.

Value

Returns a plot in the current plotting device.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

plotSpectra, renderSMILES.rcdk, chemistry2expression, trimAnnotation.

Examples

1
2
3
4
5
6
7
8
ms1_mz <- c(210.1125, 211.1154, 212.1187)
ms1_int <- c(420889280, 52790856, 2265951.5)
ms1_labels <- c("[M+H]+", "13C-M+1", "13C-M+2")
smiles_1 <- "O=C(Oc1ccccc1OC(C)C)NC"
plotMS(ms1_mz, ms1_int, main="test MS1 spec",labels=ms1_labels, formatFormula=FALSE,
absInt=TRUE)
plotMS(ms1_mz, ms1_int, main="test MS1 spec",labels=ms1_labels, formatFormula=FALSE,
absInt=FALSE, smiles=smiles_1)

schymane/ReSOLUTION documentation built on May 22, 2021, 3:41 a.m.