View source: R/peakPantheR_ROIStatistics.R
peakPantheR_ROIStatistics | R Documentation |
Using reference samples (referenceSpectraFiles
), save
(to saveFolder
) each ROI EIC (ROI
) and reports the mean apex RT
for all IS (IS_ROI
) across samples
peakPantheR_ROIStatistics(
referenceSpectraFiles,
saveFolder,
ROI = NULL,
IS_ROI = NULL,
sampleColour = NULL,
ncores = 0,
saveISPlots = TRUE,
verbose = TRUE
)
referenceSpectraFiles |
(str) A character vector of paths to the reference spectra files |
saveFolder |
(str) Path to the folder where EICs and IS mean RT
( |
ROI |
(data.frame) NULL or a data.frame of Regions Of Interest (ROI)
with compounds as row and ROI parameters as columns: |
IS_ROI |
(data.frame) NULL or a data.frame of IS ROI with IS as row and
ROI parameters as columns: |
sampleColour |
(str) NULL or vector colour for each sample |
ncores |
(int) Number of cores to use to integrate IS in parallel |
saveISPlots |
(bool) If TRUE save a diagnostic plot for each IS to
|
verbose |
(bool) If TRUE message progress |
None
if(requireNamespace('faahKO')){
## Initialise a peakPantheRAnnotation object with 2 samples and 1 targeted
## compound
# Paths to spectra files
library(faahKO)
spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
system.file('cdf/KO/ko16.CDF', package = 'faahKO'))
# targetFeatTable
targetFeatTable <- data.frame(matrix(vector(), 1, 8, dimnames=list(c(),
c('cpdID','cpdName','rtMin','rt','rtMax','mzMin','mz',
'mzMax'))), stringsAsFactors=FALSE)
targetFeatTable[1,] <- c('ID-1', 'Cpd 1', 3310., 3344.888, 3390., 522.194778,
522.2, 522.205222)
targetFeatTable[,c(3:8)] <- vapply(targetFeatTable[,c(3:8)], as.numeric,
FUN.VALUE=numeric(1))
# input
refSpecFiles <- spectraPaths
input_ROI <- targetFeatTable
input_IS_ROI <- targetFeatTable
sampleColour <- c('blue', 'red')
# temporary saveFolder
saveFolder1 <- tempdir()
# Calculate ROI statiscs
peakPantheR_ROIStatistics(refSpecFiles, saveFolder1, ROI=input_ROI,
IS_ROI=input_IS_ROI, sampleColour=sampleColour,
ncores=0, saveISPlots=TRUE, verbose=TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.