plotSpectrum: Plot Single MS/MS 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.

Usage

1
2
plotSpectrum(mz, int, main, smiles="", labels=NULL, formatFormula=TRUE,
absInt=FALSE,ylim_factor=2.5,max_xlim=0,kekulise=TRUE,color="black")

Arguments

mz

Vector containing mz values (x) to plot.

int

Vector containing intensity values (y) to plot.

main

Title for the plot.

smiles

SMILES code of the structure to plot. Leave empty for no structure.

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.

max_xlim

Option to control the maximum value on the x axis. Passed to xlim in plotSpectra as c(0,max_xlim)

kekulise

Controls aromaticity detection of smiles. Default TRUE should work best with rcdk>3.4.1. Try FALSE if rings and double bonds appear together in aromatic rings.

color

Optional vector to re-define default line colour. Passed to line_colour 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
mz_1 <- c(58.0287, 111.0441, 168.0655, 210.1125)
int_1 <- c(23.0000, 999.0000, 843.5855, 999.0000)
labels_1 <- c("C2H4NO", "C6H7O2", "C8H10NO3", "C11H16NO3")
smiles_1 <- "O=C(Oc1ccccc1OC(C)C)NC"
plotSpectrum(mz_1, int_1, main="test spec",labels=labels_1, smiles=smiles_1)

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