knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
if (getRversion() >= "3.6") { knitr::opts_chunk$set(eval = FALSE) } required <- c("faahKO") if (!all(unlist(lapply(required, function(pkg) requireNamespace(pkg, quietly = TRUE))))) { knitr::opts_chunk$set(eval = FALSE) }
The peakPantheR
package is designed for the detection, integration and reporting of pre-defined features in MS files.
The Real Time Annotation is set to detect and integrate multiple compounds in one file at a time.
Using an example dataset, this vignette will:
Real time compound integration is set to:
We can target two features in a MS spectra file from the faahKO
package with peakPantheR_singleFileSearch()
:
setRepositories(ind=1:4) install.packages('faahKO')
An input spectra is selected:
# hide package load message library(faahKO)
library(faahKO) ## file paths input_spectraPath <- c(system.file('cdf/KO/ko15.CDF', package = "faahKO")) input_spectraPath
Two targeed features are defined and stored in a table with as columns:
cpdID
(numeric)cpdName
(character)rtMin
(sec)rtMax
(sec)rt
(sec, optional / NA
)mzMin
(m/z)mzMax
(m/z)mz
(m/z, optional / NA
)# targetFeatTable input_targetFeatTable <- data.frame(matrix(vector(), 2, 8, dimnames=list(c(), c("cpdID", "cpdName", "rtMin", "rt", "rtMax", "mzMin", "mz", "mzMax"))), stringsAsFactors=F) input_targetFeatTable[1,] <- c("ID-1", "Cpd 1", 3310., 3344.888, 3390., 522.194778, 522.2, 522.205222) input_targetFeatTable[2,] <- c("ID-2", "Cpd 2", 3280., 3385.577, 3440., 496.195038, 496.2, 496.204962) input_targetFeatTable[,c(3:8)] <- sapply(input_targetFeatTable[,c(3:8)], as.numeric)
input_targetFeatTable <- data.frame(matrix(vector(), 2, 8, dimnames=list(c(), c("cpdID", "cpdName", "rtMin", "rt", "rtMax", "mzMin", "mz", "mzMax"))), stringsAsFactors=F) input_targetFeatTable[1,] <- c("ID-1", "Cpd 1", 3310., 3344.888, 3390., 522.194778, 522.2, 522.205222) input_targetFeatTable[2,] <- c("ID-2", "Cpd 2", 3280., 3385.577, 3440., 496.195038, 496.2, 496.204962) input_targetFeatTable[,c(3:8)] <- sapply(input_targetFeatTable[,c(3:8)], as.numeric) rownames(input_targetFeatTable) <- NULL pander::pandoc.table(input_targetFeatTable, digits = 9)
peakPantheR_singleFileSearch()
takes as input a singleSpectraDataPath
pointing to the file to process and targetFeatTable
defining the compounds to integrate:
library(peakPantheR) annotation <- peakPantheR_singleFileSearch(singleSpectraDataPath = input_spectraPath, targetFeatTable = input_targetFeatTable, peakStatistic = TRUE, verbose = TRUE)
annotation$TIC
annotation$acquTime
annotation$peakTable
pander::pandoc.table(annotation$peakTable, digits = 7)
annotation$curveFit
annotation$ROIsDataPoint
Multiple parameters control the file annotation:
peakStatistic
controls the calculation of additional peak statistics: 'ppm_error', 'rt_dev_sec', 'tailing factor' and 'asymmetry factor'plotEICsPath
if not NA
will save a .png
of all ROI EICs at the path provided (expects 'filepath/filename.png'
for example). If NA
no plot is savedgetAcquTime
controls if sample acquisition date-time must be extracted from the mzML
metadata. Acquisition time cannot be extracted from other file formats. The additional file access will impact run timeFIR
if not NULL
, defines the Fallback Integration Regions (FIR) to integrate when a feature is not found.verbose
controls if messages detailing calculation progress, time taken and number of features found (total and matched to targets) must be returned...
passes arguments to findTargetFeatures
to alter peak-picking parameters (e.g. the curveModel, the sampling or fitting params)The summary plot generated by plotEICsPath
, corresponding to the EICs of each integrated regions of interest is as follow:
knitr::include_graphics("../man/figures/singleFileSearch_EICsPlot.png")
EICs plot: Each panel correspond to a targeted feature, with the EIC extracted on the
mzMin
,mzMax
range found. The red dot marks the RT peak apex, and the red line highlights the RT peakwidth range found (rtMin
,rtMax
)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.