View source: R/Resume_functions.R
ExecutePlan | R Documentation |
ExecutePlan
ExecutePlan(plan = NULL)
plan |
ResummingPlan object. The object is generated by running.plan() function. |
will return a result based on the plan input
Zhiqiang Pang zhiqiang.pang@mail.mcgill.ca Jeff Xia jeff.xia@mcgill.ca Mcgill University License: GNU GPL (>= 2)
##' Download the raw spectra data
DataFiles <- dir(system.file("mzData", package = "mtbls2"), full.names = TRUE,
recursive = TRUE)[c(10:12, 14:16)]
##' Create a phenodata data.frame
pd <- data.frame(sample_name = sub(basename(DataFiles), pattern = ".mzData",
replacement = "", fixed = TRUE),
sample_group = c(rep("col0", 3), rep("cyp79", 3)),
stringsAsFactors = FALSE)
##' Initialize your plan
plan <- InitializaPlan("raw_opt")
##' Define your plan
plan <- running.plan(plan,
mSet <- PerformROIExtraction(datapath = DataFiles[c(1:2)], rt.idx = 0.025,
plot = FALSE, rmConts = FALSE,
running.controller = rc),
param_initial <- SetPeakParam(),
best_parameters <- PerformParamsOptimization(mSet = mSet, param_initial,
ncore = 1,
running.controller = rc),
param <- best_parameters,
plotSettings1 <- SetPlotParam(Plot=TRUE),
plotSettings2 <- SetPlotParam(Plot=TRUE),
mSet <- ImportRawMSData(mSet = mSet, path = DataFiles,
metadata = pd,
plotSettings = plotSettings1,
running.controller = rc),
mSet <- PerformPeakProfiling(mSet = mSet, Params = param,
plotSettings = plotSettings2, ncore = 1,
running.controller = rc),
annParams <- SetAnnotationParam(polarity = 'negative',
mz_abs_add = 0.025),
mSet <- PerformPeakAnnotation(mSet = mSet,
annotaParam = annParams, ncore =1,
running.controller = rc),
mSet <- FormatPeakList(mSet = mSet, annParams,
filtIso =FALSE, filtAdducts = FALSE,
missPercent = 1));
##' Run it!
# result <- ExecutePlan(plan);
##' Re-define your plan with a change on mz_abs_add from 0.025 to 0.035
plan <- running.plan(plan,
mSet <- PerformROIExtraction(datapath = DataFiles[c(1:2)], rt.idx = 0.025,
plot = FALSE, rmConts = FALSE,
running.controller = rc),
param_initial <- SetPeakParam(),
best_parameters <- PerformParamsOptimization(mSet = mSet, param_initial,
ncore = 1,
running.controller = rc),
param <- best_parameters,
plotSettings1 <- SetPlotParam(Plot=TRUE),
plotSettings2 <- SetPlotParam(Plot=TRUE),
mSet <- ImportRawMSData(mSet = mSet,
path = DataFiles,
metadata = pd,
plotSettings = plotSettings1,
running.controller = rc),
mSet <- PerformPeakProfiling(mSet = mSet, Params = param,
plotSettings = plotSettings2, ncore = 1,
running.controller = rc),
annParams <- SetAnnotationParam(polarity = 'negative',
mz_abs_add = 0.035),
mSet <- PerformPeakAnnotation(mSet = mSet,
annotaParam = annParams, ncore =1,
running.controller = rc),
mSet <- FormatPeakList(mSet = mSet, annParams,
filtIso =FALSE, filtAdducts = FALSE,
missPercent = 1));
##' Re-run it! Most steps will be resumed from cache and save your time!
# result <- ExecutePlan(plan);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.