ExecutePlan: ExecutePlan

Description Usage Arguments Value Author(s) Examples

View source: R/Resume_functions.R

Description

ExecutePlan

Usage

1
ExecutePlan(plan = NULL)

Arguments

plan

ResummingPlan object. The object is generated by running.plan() function.

Value

will return a result based on the plan input

Author(s)

Zhiqiang Pang zhiqiang.pang@mail.mcgill.ca Jeff Xia jeff.xia@mcgill.ca Mcgill University License: GNU GPL (>= 2)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
##' 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);

xia-lab/OptiLCMS documentation built on Sept. 6, 2021, 12:36 a.m.