plotAdductEICs: Plot EICs from Adduct List

Description Usage Arguments Value Author(s) See Also Examples

View source: R/EICandMSMS.R

Description

This plots EICs of adducts in adduct_list from the mzML (or mzXML) and smiles given, with various options. Adduct masses are calculated from the smiles using getSuspectMasses via rcdk. Labelling will not be processed correctly. Adducts that cannot be calculated (especially in negative mode) are automatically skipped. Uses plotEICs behind the scenes.

Usage

1
2
3
plotAdductEICs(mzML_filePath, smiles, adduct_list, rt=0, rt_in_sec=TRUE, plot_title=NULL,
rt_window=NULL, mz_limit=0.001, isPos=TRUE, isLog=FALSE, isSwitching=FALSE, greyscale=FALSE,
colours=NULL, cpdID=NULL, ymin_log=3, switchShift=0, kekulise=TRUE,addMSMS=FALSE,newRMB=TRUE)

Arguments

mzML_filePath

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

smiles

SMILES code of the compound of interest.

adduct_list

Vector of adducts to process, matching entries in the adducts table in enviPat. Used to fill mz and names in plotEICs.

rt

The retention time (in seconds) to centre EIC extraction. If unknown, set rt_window to NULL.

rt_in_sec

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

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.

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. Acting strangely.

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.

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

getSuspectMasses, findEIC, plotEICs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
pos_add <- c("M+H", "M+", "M+Na", "M+K", "M+NH4")
neg_add <- c("M-H", "M-", "M+FA-H", "M+Cl", "M-H2O-H")
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"
mzML_file <- mzML_files[5]
cmpd_id <- "2822"
loadList(system.file("list/NarcoticsDataset.csv",package="RMassBankData"))
smiles <- findSmiles(cmpd_id)
rt <- as.numeric(findRt(cmpd_id))
plotAdductEICs(mzML_file, pos_add, rt, rt_in_sec=FALSE, smiles = smiles)
plotAdductEICs(mzML_file, pos_add, rt, rt_in_sec=FALSE, smiles = smiles, addMSMS=TRUE)
# at this stage, log plots are not working properly...
plotAdductEICs(mzML_file, pos_add, rt, rt_in_sec=FALSE, smiles = smiles, isLog=TRUE)

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