plotEICs: Plot EICs from mz and RT List

Description Usage Arguments Value Author(s) See Also Examples

View source: R/EICandMSMS.R

Description

This plots EICs of given mz and from the mzML (or mzXML), with various options. Additional wrapper functions provide different ways of generating mz.

Usage

1
2
3
4
plotEICs(mzML_filePath, mz, rt, rt_in_sec=TRUE, names=NULL, smiles="", plot_title=NULL,
rt_window=NULL, mz_limit=0.001, ppm=10, isPos=TRUE, isLog=FALSE, isSwitching=FALSE,
greyscale=FALSE, colours = NULL, cpdID=NULL, ymin_log=3, switchShift=0,
kekulise=TRUE, addMSMS=TRUE, newRMB=TRUE, takePPM=TRUE)

Arguments

mzML_filePath

Path to the mzML (or mzXML) file to extract the EICs.

mz

Vector of mz values to process.

rt

Vector of retention times to process. Set the unit with rt_in_sec.

rt_in_sec

Default TRUE indicates that rt is in seconds. If FALSE, rt is converted to seconds internally.

names

Optional names to belong to each mz. If NULL, mz is used.

smiles

SMILES code of the compound of interest.

plot_title

If NULL, title is autogenerated using isPos, smiles and cpdID if given.

rt_window

The retention time window (in seconds) for EIC extraction. This is added to rt to form the extraction window. Should not be zero! If NULL, the whole EIC is extracted.

mz_limit

Default 0.001. This controls the limits for EIC extraction. Choose between using mz_limit and ppm with takePPM.

ppm

Default 10 ppm is an alternative to mz_limit for EIC extraction.

isPos

TRUE indicates positive mode; FALSE negative mode. Only relevant for switching data.

isLog

If TRUE, EICs are plotted with a log scale; FALSE with absolute intensities. Zero intensities are lost with TRUE.

isSwitching

If TRUE, will split switching files assuming that the first scan is positive and that positive and negative alternate, unless switchShift is set. USE WITH CAUTION.

greyscale

If TRUE, greyscale plot will be produced. If FALSE, rainbow colours are assigned automatically.

colours

Used to define EIC colours. If NULL, rainbow or greyscale colours are used, depending on greyscale.

cpdID

If given, this is used in the output. Otherwise a value of 1 is assigned.

ymin_log

This defines the y axis intercept for log plots, for aesthetic reasons. Should be just under the log(noise_intensity) threshold. 3 is appropriate for Orbitraps.

switchShift

If isSwitching is TRUE, this can be used to shift the start scan between positive and negative mode. A "quick fix", USE WITH CAUTION.

kekulise

Controls aromaticity detection in SMILES for plotting.

addMSMS

Indicates whether MSMS scans should be added to plot with default settings TRUE. FALSE does not attempt to add MSMS scans.

newRMB

Indicates whether new RMassBank version is used for MS/MS retrieval (TRUE). Set to FALSE for older versions (< 2.0.0) or if error is observed.

takePPM

Indicates whether ppm or mz_limit value should be used to extract EICs.

Value

Returns a plot in the active device and a summary output.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>, Michael Stravs, Benedikt Lauper

See Also

findEIC.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(RMassBank)
library(RMassBankData)
RmbDefaultSettings()
mzML_files <- list.files(system.file("spectra", package="RMassBankData"), ".mzML", full.names = TRUE)
mzML_file <- mzML_files[1]
cmpd_id <- "2818"
loadList(system.file("list/NarcoticsDataset.csv",package="RMassBankData"))
smiles <- findSmiles(cmpd_id)
mz <- as.numeric(findMz(cmpd_id, mode="pH")[3])
rt <- as.numeric(findRt(cmpd_id))
plotEICs(mzML_file, mz, rt, rt_in_sec=FALSE, smiles = smiles)
plotEICs(mzML_file, mz, rt, rt_in_sec=FALSE, smiles = smiles, addMSMS=TRUE)

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