# run Knit on R studio or 

# Load MetaboAnalystR
library(MetaboAnalystR)
## MetaboAnalystR 4.0.0 initialized Successfully !
## https://github.com/xia-lab/MetaboAnalystR
# Load OptiLCMS
library(OptiLCMS)
## Loading required package: Biobase
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
##     table, tapply, union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## Loading required package: BiocParallel
## Loading required package: MSnbase
## Loading required package: mzR
## Loading required package: Rcpp
## Loading required package: S4Vectors
## Loading required package: stats4
## 
## Attaching package: 'S4Vectors'
## The following object is masked from 'package:utils':
## 
##     findMatches
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## Loading required package: ProtGenerics
## 
## Attaching package: 'ProtGenerics'
## The following object is masked from 'package:stats':
## 
##     smooth
## 
## This is MSnbase version 2.28.0 
##   Visit https://lgatto.github.io/MSnbase/ to get started.
## 
## Attaching package: 'MSnbase'
## The following object is masked from 'package:base':
## 
##     trimws
## OptiLCMS 1.1.0 initialized Successfully !
## 
## Attaching package: 'OptiLCMS'
## The following objects are masked from 'package:MetaboAnalystR':
## 
##     CentroidCheck, InitDataObjects, InitializaPlan, PerformDataInspect,
##     PerformDataTrimming, PerformParamsOptimization,
##     PerformPeakProfiling, PerformROIExtraction, plotMSfeature,
##     plotSingleTIC, PlotXIC, SetPeakParam
download.file("https://www.xialab.ca/api/download/metaboanalyst/malaria_r_example.zip",
              destfile = "malaria_raw.zip",
              method = "wget")
unzip("malaria_raw.zip", exdir = "upload")


# Load MetaboAnalystR and OptiLCMS
library(MetaboAnalystR)
library(OptiLCMS)

# Here, we extract ROIs from 3 QC samples.
DataFiles <- list.files("upload/QC/", full.names = TRUE)
mSet <- PerformROIExtraction(datapath = DataFiles, rt.idx = 0.9, rmConts = TRUE);
## Step 0/6: Scanning ROIs for parameters optimization...
## QC_001.mzML
## QC_003.mzML
## QC_005.mzML
## Data Loading...
## Raw file import begin...
## 
Reading [=>-------------------------------------------]   4% Time left:  5s
Reading [=>-------------------------------------------]   4% Time left:  6s
Reading [=>-------------------------------------------]   5% Time left:  6s
Reading [=>-------------------------------------------]   5% Time left:  5s
Reading [=>-------------------------------------------]   6% Time left:  5s
Reading [==>------------------------------------------]   6% Time left:  5s
Reading [==>------------------------------------------]   7% Time left:  5s
Reading [==>------------------------------------------]   8% Time left:  5s
Reading [===>-----------------------------------------]   8% Time left:  5s
Reading [===>-----------------------------------------]   9% Time left:  5s
Reading [===>-----------------------------------------]  10% Time left:  5s
Reading [====>----------------------------------------]  10% Time left:  5s
Reading [====>----------------------------------------]  11% Time left:  5s
Reading [====>----------------------------------------]  12% Time left:  5s
Reading [=====>---------------------------------------]  12% Time left:  5s
Reading [=====>---------------------------------------]  13% Time left:  5s
Reading [=====>---------------------------------------]  14% Time left:  5s
Reading [======>--------------------------------------]  15% Time left:  5s
Reading [======>--------------------------------------]  16% Time left:  5s
Reading [======>--------------------------------------]  17% Time left:  5s
Reading [=======>-------------------------------------]  17% Time left:  5s
Reading [=======>-------------------------------------]  18% Time left:  5s
Reading [=======>-------------------------------------]  19% Time left:  5s
Reading [========>------------------------------------]  19% Time left:  5s
Reading [========>------------------------------------]  20% Time left:  5s
Reading [========>------------------------------------]  20% Time left:  4s
Reading [========>------------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  22% Time left:  4s
Reading [=========>-----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  24% Time left:  4s
Reading [==========>----------------------------------]  25% Time left:  4s
Reading [==========>----------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  27% Time left:  4s
Reading [===========>---------------------------------]  28% Time left:  4s
Reading [============>--------------------------------]  28% Time left:  4s
Reading [============>--------------------------------]  29% Time left:  4s
Reading [============>--------------------------------]  30% Time left:  4s
Reading [=============>-------------------------------]  30% Time left:  4s
Reading [=============>-------------------------------]  31% Time left:  4s
Reading [=============>-------------------------------]  32% Time left:  4s
Reading [==============>------------------------------]  32% Time left:  4s
Reading [==============>------------------------------]  33% Time left:  4s
Reading [==============>------------------------------]  33% Time left:  5s
Reading [==============>------------------------------]  34% Time left:  5s
Reading [===============>-----------------------------]  35% Time left:  5s
Reading [===============>-----------------------------]  36% Time left:  5s
Reading [===============>-----------------------------]  37% Time left:  5s
Reading [================>----------------------------]  37% Time left:  4s
Reading [================>----------------------------]  38% Time left:  4s
Reading [================>----------------------------]  39% Time left:  4s
Reading [=================>---------------------------]  39% Time left:  4s
Reading [=================>---------------------------]  40% Time left:  4s
Reading [=================>---------------------------]  41% Time left:  4s
Reading [==================>--------------------------]  41% Time left:  4s
Reading [==================>--------------------------]  42% Time left:  4s
Reading [==================>--------------------------]  43% Time left:  4s
Reading [===================>-------------------------]  43% Time left:  4s
Reading [===================>-------------------------]  44% Time left:  4s
Reading [===================>-------------------------]  45% Time left:  4s
Reading [===================>-------------------------]  46% Time left:  4s
Reading [====================>------------------------]  46% Time left:  4s
Reading [====================>------------------------]  47% Time left:  4s
Reading [====================>------------------------]  48% Time left:  4s
Reading [=====================>-----------------------]  48% Time left:  4s
Reading [=====================>-----------------------]  49% Time left:  4s
Reading [=====================>-----------------------]  49% Time left:  3s
Reading [=====================>-----------------------]  50% Time left:  3s
Reading [======================>----------------------]  50% Time left:  3s
Reading [======================>----------------------]  51% Time left:  3s
Reading [======================>----------------------]  52% Time left:  3s
Reading [=======================>---------------------]  52% Time left:  3s
Reading [=======================>---------------------]  53% Time left:  3s
Reading [=======================>---------------------]  54% Time left:  3s
Reading [========================>--------------------]  54% Time left:  3s
Reading [========================>--------------------]  55% Time left:  3s
Reading [========================>--------------------]  56% Time left:  3s
Reading [========================>--------------------]  57% Time left:  3s
Reading [=========================>-------------------]  57% Time left:  3s
Reading [=========================>-------------------]  58% Time left:  3s
Reading [=========================>-------------------]  59% Time left:  3s
Reading [==========================>------------------]  59% Time left:  3s
Reading [==========================>------------------]  60% Time left:  3s
Reading [==========================>------------------]  61% Time left:  3s
Reading [==========================>------------------]  61% Time left:  2s
Reading [===========================>-----------------]  61% Time left:  2s
Reading [===========================>-----------------]  62% Time left:  2s
Reading [===========================>-----------------]  63% Time left:  2s
Reading [============================>----------------]  63% Time left:  2s
Reading [============================>----------------]  64% Time left:  2s
Reading [============================>----------------]  65% Time left:  2s
Reading [=============================>---------------]  66% Time left:  2s
Reading [=============================>---------------]  67% Time left:  2s
Reading [=============================>---------------]  68% Time left:  2s
Reading [==============================>--------------]  68% Time left:  2s
Reading [==============================>--------------]  69% Time left:  2s
Reading [==============================>--------------]  70% Time left:  2s
Reading [===============================>-------------]  70% Time left:  2s
Reading [===============================>-------------]  71% Time left:  2s
Reading [===============================>-------------]  72% Time left:  2s
Reading [================================>------------]  72% Time left:  2s
Reading [================================>------------]  73% Time left:  2s
Reading [================================>------------]  74% Time left:  2s
Reading [=================================>-----------]  74% Time left:  2s
Reading [=================================>-----------]  75% Time left:  2s
Reading [=================================>-----------]  76% Time left:  2s
Reading [=================================>-----------]  76% Time left:  1s
Reading [=================================>-----------]  77% Time left:  1s
Reading [==================================>----------]  77% Time left:  1s
Reading [==================================>----------]  78% Time left:  1s
Reading [==================================>----------]  79% Time left:  1s
Reading [===================================>---------]  79% Time left:  1s
Reading [===================================>---------]  80% Time left:  1s
Reading [===================================>---------]  81% Time left:  1s
Reading [====================================>--------]  81% Time left:  1s
Reading [====================================>--------]  82% Time left:  1s
Reading [====================================>--------]  83% Time left:  1s
Reading [=====================================>-------]  83% Time left:  1s
Reading [=====================================>-------]  84% Time left:  1s
Reading [=====================================>-------]  85% Time left:  1s
Reading [======================================>------]  86% Time left:  1s
Reading [======================================>------]  87% Time left:  1s
Reading [======================================>------]  88% Time left:  1s
Reading [=======================================>-----]  88% Time left:  1s
Reading [=======================================>-----]  89% Time left:  1s
Reading [=======================================>-----]  90% Time left:  1s
Reading [========================================>----]  90% Time left:  1s
Reading [========================================>----]  91% Time left:  1s
Reading [========================================>----]  92% Time left:  1s
Reading [========================================>----]  92% Time left:  0s
Reading [=========================================>---]  92% Time left:  0s
Reading [=========================================>---]  93% Time left:  0s
Reading [=========================================>---]  94% Time left:  0s
Reading [==========================================>--]  94% Time left:  0s
Reading [==========================================>--]  95% Time left:  0s
Reading [==========================================>--]  96% Time left:  0s
Reading [==========================================>--]  97% Time left:  0s
Reading [===========================================>-]  97% Time left:  0s
Reading [===========================================>-]  98% Time left:  0s
Reading [===========================================>-]  99% Time left:  0s
Reading [============================================>]  99% Time left:  0s
Reading [============================================>] 100% Time left:  0s
Reading [=============================================] 100% Time left:  0s
                                                                           
Import data: QC_001.mzML finished!
## 
Reading [=>-------------------------------------------]   4% Time left:  5s
Reading [=>-------------------------------------------]   5% Time left:  5s
Reading [=>-------------------------------------------]   6% Time left:  5s
Reading [==>------------------------------------------]   6% Time left:  5s
Reading [==>------------------------------------------]   7% Time left:  5s
Reading [==>------------------------------------------]   7% Time left:  4s
Reading [==>------------------------------------------]   8% Time left:  4s
Reading [===>-----------------------------------------]   8% Time left:  4s
Reading [===>-----------------------------------------]   9% Time left:  4s
Reading [===>-----------------------------------------]  10% Time left:  4s
Reading [====>----------------------------------------]  10% Time left:  4s
Reading [====>----------------------------------------]  11% Time left:  4s
Reading [====>----------------------------------------]  12% Time left:  4s
Reading [=====>---------------------------------------]  12% Time left:  4s
Reading [=====>---------------------------------------]  13% Time left:  4s
Reading [=====>---------------------------------------]  14% Time left:  4s
Reading [======>--------------------------------------]  15% Time left:  4s
Reading [======>--------------------------------------]  16% Time left:  4s
Reading [======>--------------------------------------]  17% Time left:  4s
Reading [=======>-------------------------------------]  17% Time left:  4s
Reading [=======>-------------------------------------]  18% Time left:  4s
Reading [=======>-------------------------------------]  19% Time left:  4s
Reading [========>------------------------------------]  19% Time left:  4s
Reading [========>------------------------------------]  20% Time left:  4s
Reading [========>------------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  22% Time left:  4s
Reading [=========>-----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  24% Time left:  4s
Reading [==========>----------------------------------]  25% Time left:  4s
Reading [==========>----------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  27% Time left:  4s
Reading [===========>---------------------------------]  28% Time left:  4s
Reading [============>--------------------------------]  28% Time left:  4s
Reading [============>--------------------------------]  29% Time left:  4s
Reading [============>--------------------------------]  30% Time left:  4s
Reading [=============>-------------------------------]  30% Time left:  4s
Reading [=============>-------------------------------]  30% Time left:  3s
Reading [=============>-------------------------------]  31% Time left:  3s
Reading [=============>-------------------------------]  32% Time left:  3s
Reading [==============>------------------------------]  32% Time left:  3s
Reading [==============>------------------------------]  33% Time left:  3s
Reading [==============>------------------------------]  34% Time left:  3s
Reading [===============>-----------------------------]  35% Time left:  3s
Reading [===============>-----------------------------]  36% Time left:  3s
Reading [===============>-----------------------------]  37% Time left:  3s
Reading [================>----------------------------]  37% Time left:  3s
Reading [================>----------------------------]  38% Time left:  3s
Reading [================>----------------------------]  39% Time left:  3s
Reading [=================>---------------------------]  39% Time left:  3s
Reading [=================>---------------------------]  40% Time left:  3s
Reading [=================>---------------------------]  41% Time left:  3s
Reading [==================>--------------------------]  41% Time left:  3s
Reading [==================>--------------------------]  42% Time left:  3s
Reading [==================>--------------------------]  43% Time left:  3s
Reading [===================>-------------------------]  43% Time left:  3s
Reading [===================>-------------------------]  44% Time left:  3s
Reading [===================>-------------------------]  45% Time left:  3s
Reading [===================>-------------------------]  46% Time left:  3s
Reading [====================>------------------------]  46% Time left:  3s
Reading [====================>------------------------]  47% Time left:  3s
Reading [====================>------------------------]  48% Time left:  3s
Reading [=====================>-----------------------]  48% Time left:  3s
Reading [=====================>-----------------------]  49% Time left:  3s
Reading [=====================>-----------------------]  50% Time left:  3s
Reading [======================>----------------------]  50% Time left:  3s
Reading [======================>----------------------]  51% Time left:  3s
Reading [======================>----------------------]  51% Time left:  2s
Reading [======================>----------------------]  52% Time left:  2s
Reading [=======================>---------------------]  52% Time left:  2s
Reading [=======================>---------------------]  53% Time left:  2s
Reading [=======================>---------------------]  54% Time left:  2s
Reading [========================>--------------------]  54% Time left:  2s
Reading [========================>--------------------]  55% Time left:  2s
Reading [========================>--------------------]  56% Time left:  2s
Reading [========================>--------------------]  57% Time left:  2s
Reading [=========================>-------------------]  57% Time left:  2s
Reading [=========================>-------------------]  58% Time left:  2s
Reading [=========================>-------------------]  59% Time left:  2s
Reading [==========================>------------------]  59% Time left:  2s
Reading [==========================>------------------]  60% Time left:  2s
Reading [==========================>------------------]  61% Time left:  2s
Reading [===========================>-----------------]  61% Time left:  2s
Reading [===========================>-----------------]  62% Time left:  2s
Reading [===========================>-----------------]  63% Time left:  2s
Reading [============================>----------------]  63% Time left:  2s
Reading [============================>----------------]  64% Time left:  2s
Reading [============================>----------------]  65% Time left:  2s
Reading [=============================>---------------]  66% Time left:  2s
Reading [=============================>---------------]  67% Time left:  2s
Reading [=============================>---------------]  68% Time left:  2s
Reading [==============================>--------------]  68% Time left:  2s
Reading [==============================>--------------]  69% Time left:  2s
Reading [==============================>--------------]  70% Time left:  2s
Reading [===============================>-------------]  70% Time left:  2s
Reading [===============================>-------------]  70% Time left:  1s
Reading [===============================>-------------]  71% Time left:  1s
Reading [===============================>-------------]  72% Time left:  1s
Reading [================================>------------]  72% Time left:  1s
Reading [================================>------------]  73% Time left:  1s
Reading [================================>------------]  74% Time left:  1s
Reading [=================================>-----------]  74% Time left:  1s
Reading [=================================>-----------]  75% Time left:  1s
Reading [=================================>-----------]  76% Time left:  1s
Reading [=================================>-----------]  77% Time left:  1s
Reading [==================================>----------]  77% Time left:  1s
Reading [==================================>----------]  78% Time left:  1s
Reading [==================================>----------]  79% Time left:  1s
Reading [===================================>---------]  79% Time left:  1s
Reading [===================================>---------]  80% Time left:  1s
Reading [===================================>---------]  81% Time left:  1s
Reading [====================================>--------]  81% Time left:  1s
Reading [====================================>--------]  82% Time left:  1s
Reading [====================================>--------]  83% Time left:  1s
Reading [=====================================>-------]  83% Time left:  1s
Reading [=====================================>-------]  84% Time left:  1s
Reading [=====================================>-------]  85% Time left:  1s
Reading [======================================>------]  86% Time left:  1s
Reading [======================================>------]  87% Time left:  1s
Reading [======================================>------]  88% Time left:  1s
Reading [=======================================>-----]  88% Time left:  1s
Reading [=======================================>-----]  89% Time left:  1s
Reading [=======================================>-----]  90% Time left:  1s
Reading [========================================>----]  90% Time left:  1s
Reading [========================================>----]  90% Time left:  0s
Reading [========================================>----]  91% Time left:  0s
Reading [========================================>----]  92% Time left:  0s
Reading [=========================================>---]  92% Time left:  0s
Reading [=========================================>---]  93% Time left:  0s
Reading [=========================================>---]  94% Time left:  0s
Reading [==========================================>--]  94% Time left:  0s
Reading [==========================================>--]  95% Time left:  0s
Reading [==========================================>--]  96% Time left:  0s
Reading [==========================================>--]  97% Time left:  0s
Reading [===========================================>-]  97% Time left:  0s
Reading [===========================================>-]  98% Time left:  0s
Reading [===========================================>-]  99% Time left:  0s
Reading [============================================>]  99% Time left:  0s
Reading [============================================>] 100% Time left:  0s
Reading [=============================================] 100% Time left:  0s
                                                                           
Import data: QC_003.mzML finished!
## 
Reading [==>------------------------------------------]   6% Time left:  3s
Reading [==>------------------------------------------]   6% Time left:  4s
Reading [==>------------------------------------------]   7% Time left:  4s
Reading [==>------------------------------------------]   8% Time left:  4s
Reading [===>-----------------------------------------]   8% Time left:  4s
Reading [===>-----------------------------------------]   9% Time left:  4s
Reading [===>-----------------------------------------]  10% Time left:  4s
Reading [====>----------------------------------------]  10% Time left:  4s
Reading [====>----------------------------------------]  11% Time left:  4s
Reading [====>----------------------------------------]  11% Time left:  5s
Reading [====>----------------------------------------]  11% Time left:  4s
Reading [====>----------------------------------------]  11% Time left:  5s
Reading [====>----------------------------------------]  12% Time left:  4s
Reading [====>----------------------------------------]  12% Time left:  5s
Reading [====>----------------------------------------]  12% Time left:  4s
Reading [=====>---------------------------------------]  12% Time left:  4s
Reading [=====>---------------------------------------]  13% Time left:  4s
Reading [=====>---------------------------------------]  14% Time left:  4s
Reading [======>--------------------------------------]  15% Time left:  4s
Reading [======>--------------------------------------]  16% Time left:  4s
Reading [======>--------------------------------------]  17% Time left:  4s
Reading [=======>-------------------------------------]  17% Time left:  4s
Reading [=======>-------------------------------------]  18% Time left:  4s
Reading [=======>-------------------------------------]  19% Time left:  4s
Reading [========>------------------------------------]  19% Time left:  4s
Reading [========>------------------------------------]  20% Time left:  4s
Reading [========>------------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  21% Time left:  4s
Reading [=========>-----------------------------------]  22% Time left:  4s
Reading [=========>-----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  23% Time left:  4s
Reading [==========>----------------------------------]  24% Time left:  4s
Reading [==========>----------------------------------]  25% Time left:  4s
Reading [==========>----------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  26% Time left:  4s
Reading [===========>---------------------------------]  27% Time left:  4s
Reading [===========>---------------------------------]  27% Time left:  3s
Reading [===========>---------------------------------]  28% Time left:  3s
Reading [============>--------------------------------]  28% Time left:  3s
Reading [============>--------------------------------]  29% Time left:  3s
Reading [============>--------------------------------]  30% Time left:  3s
Reading [=============>-------------------------------]  30% Time left:  3s
Reading [=============>-------------------------------]  31% Time left:  3s
Reading [=============>-------------------------------]  32% Time left:  3s
Reading [==============>------------------------------]  32% Time left:  3s
Reading [==============>------------------------------]  33% Time left:  3s
Reading [==============>------------------------------]  34% Time left:  3s
Reading [===============>-----------------------------]  35% Time left:  3s
Reading [===============>-----------------------------]  36% Time left:  3s
Reading [===============>-----------------------------]  37% Time left:  3s
Reading [================>----------------------------]  37% Time left:  3s
Reading [================>----------------------------]  38% Time left:  3s
Reading [================>----------------------------]  39% Time left:  3s
Reading [=================>---------------------------]  39% Time left:  3s
Reading [=================>---------------------------]  40% Time left:  3s
Reading [=================>---------------------------]  41% Time left:  3s
Reading [==================>--------------------------]  41% Time left:  3s
Reading [==================>--------------------------]  42% Time left:  3s
Reading [==================>--------------------------]  43% Time left:  3s
Reading [===================>-------------------------]  43% Time left:  3s
Reading [===================>-------------------------]  44% Time left:  3s
Reading [===================>-------------------------]  45% Time left:  3s
Reading [===================>-------------------------]  46% Time left:  3s
Reading [====================>------------------------]  46% Time left:  3s
Reading [====================>------------------------]  47% Time left:  3s
Reading [====================>------------------------]  48% Time left:  3s
Reading [=====================>-----------------------]  48% Time left:  3s
Reading [=====================>-----------------------]  49% Time left:  3s
Reading [=====================>-----------------------]  49% Time left:  2s
Reading [=====================>-----------------------]  50% Time left:  2s
Reading [======================>----------------------]  50% Time left:  2s
Reading [======================>----------------------]  51% Time left:  2s
Reading [======================>----------------------]  52% Time left:  2s
Reading [=======================>---------------------]  52% Time left:  2s
Reading [=======================>---------------------]  53% Time left:  2s
Reading [=======================>---------------------]  54% Time left:  2s
Reading [========================>--------------------]  54% Time left:  2s
Reading [========================>--------------------]  55% Time left:  2s
Reading [========================>--------------------]  56% Time left:  2s
Reading [========================>--------------------]  57% Time left:  2s
Reading [=========================>-------------------]  57% Time left:  2s
Reading [=========================>-------------------]  58% Time left:  2s
Reading [=========================>-------------------]  59% Time left:  2s
Reading [==========================>------------------]  59% Time left:  2s
Reading [==========================>------------------]  60% Time left:  2s
Reading [==========================>------------------]  61% Time left:  2s
Reading [===========================>-----------------]  61% Time left:  2s
Reading [===========================>-----------------]  62% Time left:  2s
Reading [===========================>-----------------]  63% Time left:  2s
Reading [============================>----------------]  63% Time left:  2s
Reading [============================>----------------]  64% Time left:  2s
Reading [============================>----------------]  65% Time left:  2s
Reading [=============================>---------------]  66% Time left:  2s
Reading [=============================>---------------]  67% Time left:  2s
Reading [=============================>---------------]  68% Time left:  2s
Reading [==============================>--------------]  68% Time left:  2s
Reading [==============================>--------------]  69% Time left:  2s
Reading [==============================>--------------]  70% Time left:  2s
Reading [==============================>--------------]  70% Time left:  1s
Reading [===============================>-------------]  70% Time left:  1s
Reading [===============================>-------------]  71% Time left:  1s
Reading [===============================>-------------]  72% Time left:  1s
Reading [================================>------------]  72% Time left:  1s
Reading [================================>------------]  73% Time left:  1s
Reading [================================>------------]  74% Time left:  1s
Reading [=================================>-----------]  74% Time left:  1s
Reading [=================================>-----------]  75% Time left:  1s
Reading [=================================>-----------]  76% Time left:  1s
Reading [=================================>-----------]  77% Time left:  1s
Reading [==================================>----------]  77% Time left:  1s
Reading [==================================>----------]  78% Time left:  1s
Reading [==================================>----------]  79% Time left:  1s
Reading [===================================>---------]  79% Time left:  1s
Reading [===================================>---------]  80% Time left:  1s
Reading [===================================>---------]  81% Time left:  1s
Reading [====================================>--------]  81% Time left:  1s
Reading [====================================>--------]  82% Time left:  1s
Reading [====================================>--------]  83% Time left:  1s
Reading [=====================================>-------]  83% Time left:  1s
Reading [=====================================>-------]  84% Time left:  1s
Reading [=====================================>-------]  85% Time left:  1s
Reading [======================================>------]  86% Time left:  1s
Reading [======================================>------]  87% Time left:  1s
Reading [======================================>------]  88% Time left:  1s
Reading [=======================================>-----]  88% Time left:  1s
Reading [=======================================>-----]  89% Time left:  1s
Reading [=======================================>-----]  90% Time left:  1s
Reading [========================================>----]  90% Time left:  0s
Reading [========================================>----]  91% Time left:  0s
Reading [========================================>----]  92% Time left:  0s
Reading [=========================================>---]  92% Time left:  0s
Reading [=========================================>---]  93% Time left:  0s
Reading [=========================================>---]  94% Time left:  0s
Reading [==========================================>--]  94% Time left:  0s
Reading [==========================================>--]  95% Time left:  0s
Reading [==========================================>--]  96% Time left:  0s
Reading [==========================================>--]  97% Time left:  0s
Reading [===========================================>-]  97% Time left:  0s
Reading [===========================================>-]  98% Time left:  0s
Reading [===========================================>-]  99% Time left:  0s
Reading [============================================>]  99% Time left:  0s
Reading [============================================>] 100% Time left:  0s
Reading [=============================================] 100% Time left:  0s
                                                                           
Import data: QC_005.mzML finished!
## Data Loaded !
## Empty Scan detecting...
## No Empty scan found !
## Identifying regions of interest (ROI)...
## Identifying regions of potential contaminants........Done!
## 
Data Trimming_removing [=>-------------]  10% Time left:  2s
Data Trimming_removing [=>-------------]  11% Time left:  2s
Data Trimming_removing [=>-------------]  12% Time left:  2s
Data Trimming_removing [=>-------------]  13% Time left:  2s
Data Trimming_removing [=>-------------]  14% Time left:  2s
Data Trimming_removing [=>-------------]  15% Time left:  2s
Data Trimming_removing [=>-------------]  16% Time left:  2s
Data Trimming_removing [=>-------------]  17% Time left:  2s
Data Trimming_removing [==>------------]  17% Time left:  2s
Data Trimming_removing [==>------------]  18% Time left:  2s
Data Trimming_removing [==>------------]  19% Time left:  2s
Data Trimming_removing [==>------------]  20% Time left:  2s
Data Trimming_removing [==>------------]  21% Time left:  2s
Data Trimming_removing [==>------------]  22% Time left:  2s
Data Trimming_removing [==>------------]  23% Time left:  2s
Data Trimming_removing [===>-----------]  23% Time left:  2s
Data Trimming_removing [===>-----------]  24% Time left:  2s
Data Trimming_removing [===>-----------]  25% Time left:  2s
Data Trimming_removing [===>-----------]  26% Time left:  2s
Data Trimming_removing [===>-----------]  27% Time left:  2s
Data Trimming_removing [===>-----------]  28% Time left:  2s
Data Trimming_removing [===>-----------]  29% Time left:  2s
Data Trimming_removing [===>-----------]  30% Time left:  2s
Data Trimming_removing [====>----------]  30% Time left:  2s
Data Trimming_removing [====>----------]  31% Time left:  2s
Data Trimming_removing [====>----------]  32% Time left:  2s
Data Trimming_removing [====>----------]  33% Time left:  2s
Data Trimming_removing [====>----------]  34% Time left:  2s
Data Trimming_removing [====>----------]  35% Time left:  2s
Data Trimming_removing [====>----------]  36% Time left:  2s
Data Trimming_removing [====>----------]  37% Time left:  2s
Data Trimming_removing [=====>---------]  37% Time left:  2s
Data Trimming_removing [=====>---------]  38% Time left:  2s
Data Trimming_removing [=====>---------]  39% Time left:  2s
Data Trimming_removing [=====>---------]  40% Time left:  2s
Data Trimming_removing [=====>---------]  41% Time left:  2s
Data Trimming_removing [=====>---------]  42% Time left:  2s
Data Trimming_removing [=====>---------]  43% Time left:  2s
Data Trimming_removing [======>--------]  43% Time left:  2s
Data Trimming_removing [======>--------]  44% Time left:  2s
Data Trimming_removing [======>--------]  45% Time left:  2s
Data Trimming_removing [======>--------]  46% Time left:  2s
Data Trimming_removing [======>--------]  47% Time left:  2s
Data Trimming_removing [======>--------]  48% Time left:  2s
Data Trimming_removing [======>--------]  48% Time left:  1s
Data Trimming_removing [======>--------]  49% Time left:  1s
Data Trimming_removing [======>--------]  50% Time left:  1s
Data Trimming_removing [=======>-------]  50% Time left:  1s
Data Trimming_removing [=======>-------]  51% Time left:  1s
Data Trimming_removing [=======>-------]  52% Time left:  1s
Data Trimming_removing [=======>-------]  53% Time left:  1s
Data Trimming_removing [=======>-------]  54% Time left:  1s
Data Trimming_removing [=======>-------]  55% Time left:  1s
Data Trimming_removing [=======>-------]  56% Time left:  1s
Data Trimming_removing [=======>-------]  57% Time left:  1s
Data Trimming_removing [========>------]  57% Time left:  1s
Data Trimming_removing [========>------]  58% Time left:  1s
Data Trimming_removing [========>------]  59% Time left:  1s
Data Trimming_removing [========>------]  60% Time left:  1s
Data Trimming_removing [========>------]  61% Time left:  1s
Data Trimming_removing [========>------]  62% Time left:  1s
Data Trimming_removing [========>------]  63% Time left:  1s
Data Trimming_removing [=========>-----]  63% Time left:  1s
Data Trimming_removing [=========>-----]  64% Time left:  1s
Data Trimming_removing [=========>-----]  65% Time left:  1s
Data Trimming_removing [=========>-----]  66% Time left:  1s
Data Trimming_removing [=========>-----]  67% Time left:  1s
Data Trimming_removing [=========>-----]  68% Time left:  1s
Data Trimming_removing [=========>-----]  69% Time left:  1s
Data Trimming_removing [=========>-----]  70% Time left:  1s
Data Trimming_removing [==========>----]  70% Time left:  1s
Data Trimming_removing [==========>----]  71% Time left:  1s
Data Trimming_removing [==========>----]  72% Time left:  1s
Data Trimming_removing [==========>----]  73% Time left:  1s
Data Trimming_removing [==========>----]  74% Time left:  1s
Data Trimming_removing [==========>----]  75% Time left:  1s
Data Trimming_removing [==========>----]  76% Time left:  1s
Data Trimming_removing [==========>----]  77% Time left:  1s
Data Trimming_removing [===========>---]  77% Time left:  1s
Data Trimming_removing [===========>---]  78% Time left:  1s
Data Trimming_removing [===========>---]  79% Time left:  1s
Data Trimming_removing [===========>---]  80% Time left:  1s
Data Trimming_removing [===========>---]  81% Time left:  1s
Data Trimming_removing [===========>---]  82% Time left:  1s
Data Trimming_removing [===========>---]  83% Time left:  1s
Data Trimming_removing [============>--]  83% Time left:  1s
Data Trimming_removing [============>--]  84% Time left:  1s
Data Trimming_removing [============>--]  84% Time left:  0s
Data Trimming_removing [============>--]  85% Time left:  0s
Data Trimming_removing [============>--]  86% Time left:  0s
Data Trimming_removing [============>--]  87% Time left:  0s
Data Trimming_removing [============>--]  88% Time left:  0s
Data Trimming_removing [============>--]  89% Time left:  0s
Data Trimming_removing [============>--]  90% Time left:  0s
Data Trimming_removing [=============>-]  90% Time left:  0s
Data Trimming_removing [=============>-]  91% Time left:  0s
Data Trimming_removing [=============>-]  92% Time left:  0s
Data Trimming_removing [=============>-]  93% Time left:  0s
Data Trimming_removing [=============>-]  94% Time left:  0s
Data Trimming_removing [=============>-]  95% Time left:  0s
Data Trimming_removing [=============>-]  96% Time left:  0s
Data Trimming_removing [=============>-]  97% Time left:  0s
Data Trimming_removing [==============>]  97% Time left:  0s
Data Trimming_removing [==============>]  98% Time left:  0s
Data Trimming_removing [==============>]  99% Time left:  0s
Data Trimming_removing [==============>] 100% Time left:  0s
Data Trimming_removing [===============] 100% Time left:  0s
                                                            
70 potential contaminamts will not be used for parameters optimization !
## Going to the next step...
## MS data Preparing...
## MS Data ready !
## Identifying ROIs in m/z dimensions...
## 
ROIs Identification in MZ Dimension [=>--------------------]   9% Time left:  2s
ROIs Identification in MZ Dimension [=>--------------------]  10% Time left:  2s
ROIs Identification in MZ Dimension [=>--------------------]  11% Time left:  2s
ROIs Identification in MZ Dimension [==>-------------------]  11% Time left:  2s
ROIs Identification in MZ Dimension [==>-------------------]  12% Time left:  2s
ROIs Identification in MZ Dimension [==>-------------------]  12% Time left:  3s
ROIs Identification in MZ Dimension [==>-------------------]  13% Time left:  3s
ROIs Identification in MZ Dimension [==>-------------------]  14% Time left:  3s
ROIs Identification in MZ Dimension [==>-------------------]  15% Time left:  3s
ROIs Identification in MZ Dimension [==>-------------------]  16% Time left:  3s
ROIs Identification in MZ Dimension [===>------------------]  16% Time left:  3s
ROIs Identification in MZ Dimension [===>------------------]  17% Time left:  3s
ROIs Identification in MZ Dimension [===>------------------]  18% Time left:  3s
ROIs Identification in MZ Dimension [===>------------------]  19% Time left:  3s
ROIs Identification in MZ Dimension [===>------------------]  20% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  20% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  21% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  22% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  23% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  24% Time left:  3s
ROIs Identification in MZ Dimension [====>-----------------]  25% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  25% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  26% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  27% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  28% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  29% Time left:  3s
ROIs Identification in MZ Dimension [=====>----------------]  30% Time left:  3s
ROIs Identification in MZ Dimension [======>---------------]  30% Time left:  3s
ROIs Identification in MZ Dimension [======>---------------]  31% Time left:  3s
ROIs Identification in MZ Dimension [======>---------------]  32% Time left:  3s
ROIs Identification in MZ Dimension [======>---------------]  33% Time left:  3s
ROIs Identification in MZ Dimension [======>---------------]  34% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  34% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  35% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  36% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  37% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  38% Time left:  3s
ROIs Identification in MZ Dimension [=======>--------------]  39% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  39% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  40% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  41% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  42% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  43% Time left:  3s
ROIs Identification in MZ Dimension [========>-------------]  43% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  43% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  44% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  45% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  46% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  47% Time left:  2s
ROIs Identification in MZ Dimension [=========>------------]  48% Time left:  2s
ROIs Identification in MZ Dimension [==========>-----------]  48% Time left:  2s
ROIs Identification in MZ Dimension [==========>-----------]  49% Time left:  2s
ROIs Identification in MZ Dimension [==========>-----------]  50% Time left:  2s
ROIs Identification in MZ Dimension [==========>-----------]  51% Time left:  2s
ROIs Identification in MZ Dimension [==========>-----------]  52% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  52% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  53% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  54% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  55% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  56% Time left:  2s
ROIs Identification in MZ Dimension [===========>----------]  57% Time left:  2s
ROIs Identification in MZ Dimension [============>---------]  57% Time left:  2s
ROIs Identification in MZ Dimension [============>---------]  58% Time left:  2s
ROIs Identification in MZ Dimension [============>---------]  59% Time left:  2s
ROIs Identification in MZ Dimension [============>---------]  60% Time left:  2s
ROIs Identification in MZ Dimension [============>---------]  61% Time left:  2s
ROIs Identification in MZ Dimension [=============>--------]  61% Time left:  2s
ROIs Identification in MZ Dimension [=============>--------]  62% Time left:  2s
ROIs Identification in MZ Dimension [=============>--------]  63% Time left:  2s
ROIs Identification in MZ Dimension [=============>--------]  64% Time left:  2s
ROIs Identification in MZ Dimension [=============>--------]  64% Time left:  1s
ROIs Identification in MZ Dimension [=============>--------]  65% Time left:  1s
ROIs Identification in MZ Dimension [=============>--------]  66% Time left:  1s
ROIs Identification in MZ Dimension [==============>-------]  66% Time left:  1s
ROIs Identification in MZ Dimension [==============>-------]  67% Time left:  1s
ROIs Identification in MZ Dimension [==============>-------]  68% Time left:  1s
ROIs Identification in MZ Dimension [==============>-------]  69% Time left:  1s
ROIs Identification in MZ Dimension [==============>-------]  70% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  70% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  71% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  72% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  73% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  74% Time left:  1s
ROIs Identification in MZ Dimension [===============>------]  75% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  75% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  76% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  77% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  78% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  79% Time left:  1s
ROIs Identification in MZ Dimension [================>-----]  80% Time left:  1s
ROIs Identification in MZ Dimension [=================>----]  80% Time left:  1s
ROIs Identification in MZ Dimension [=================>----]  81% Time left:  1s
ROIs Identification in MZ Dimension [=================>----]  82% Time left:  1s
ROIs Identification in MZ Dimension [=================>----]  83% Time left:  1s
ROIs Identification in MZ Dimension [=================>----]  84% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  84% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  85% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  86% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  87% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  88% Time left:  1s
ROIs Identification in MZ Dimension [==================>---]  88% Time left:  0s
ROIs Identification in MZ Dimension [==================>---]  89% Time left:  0s
ROIs Identification in MZ Dimension [===================>--]  89% Time left:  0s
ROIs Identification in MZ Dimension [===================>--]  90% Time left:  0s
ROIs Identification in MZ Dimension [===================>--]  91% Time left:  0s
ROIs Identification in MZ Dimension [===================>--]  92% Time left:  0s
ROIs Identification in MZ Dimension [===================>--]  93% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  93% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  94% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  95% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  96% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  97% Time left:  0s
ROIs Identification in MZ Dimension [====================>-]  98% Time left:  0s
ROIs Identification in MZ Dimension [=====================>]  98% Time left:  0s
ROIs Identification in MZ Dimension [=====================>]  99% Time left:  0s
ROIs Identification in MZ Dimension [=====================>] 100% Time left:  0s
ROIs Identification in MZ Dimension [======================] 100% Time left:  0s
                                                                                
Identifying ROIs in m/z dimensions Done !
## Identifying ROIs in RT dimensions...
## Chromatogram Plotting Begin...
## Identification on ROIs Finished!

# Here we use PerformParamsOptimization to optimize parameters based on 
# the extracted ROI (stored in 'mSet') before process the entire dataset

best_params <- PerformParamsOptimization(mSet, param = SetPeakParam(platform = "UPLC-Q/E"), ncore = 4);
## 
## Step 1/6: Start to optimize parameters! 
##                 
## This step may take a long time...
## DoE Optimization Starting Now... (2023-10-31 10:00:13.887121)
## Evaluating Noise level...
## 
Evaluating [===========================>--------------]  67% Time left:  3s
Evaluating [==========================================] 100% Time left:  0s
                                                                           
ppm is estimated as : 4.3
## Done!
## Preparing Parameters for optimization finished !
## Data Spliting Finished !
## Peak Preparing Begin...
## Peak Preparing Done !
## Round:1
## DoE Running Begin...
## 
DoE Running [====>------------------------------------]  13% Time left:  9m
DoE Running [=======>---------------------------------]  20% Time left:  9m
DoE Running [==========>------------------------------]  27% Time left:  9m
DoE Running [=============>---------------------------]  33% Time left:  9m
DoE Running [===============>-------------------------]  40% Time left:  8m
DoE Running [==================>----------------------]  47% Time left:  7m
DoE Running [=====================>-------------------]  53% Time left:  6m
DoE Running [========================>----------------]  60% Time left:  6m
DoE Running [==========================>--------------]  67% Time left:  5m
DoE Running [=============================>-----------]  73% Time left:  4m
DoE Running [================================>--------]  80% Time left:  3m
DoE Running [===================================>-----]  87% Time left:  2m
DoE Running [=====================================>---]  93% Time left:  1m
DoE Running [=========================================] 100% Time left:  0s
                                                                           
100% |
## Round 1 Finished !
## Model Parsing...
## Gaussian peak ratio (%): 39.3
## Model Parsing Done !
## 
## Round:2
## DoE Running Begin...
## 
DoE Running [====>------------------------------------]  13% Time left:  6m
DoE Running [=======>---------------------------------]  20% Time left:  7m
DoE Running [==========>------------------------------]  27% Time left:  7m
DoE Running [=============>---------------------------]  33% Time left:  7m
DoE Running [===============>-------------------------]  40% Time left:  6m
DoE Running [==================>----------------------]  47% Time left:  6m
DoE Running [=====================>-------------------]  53% Time left:  5m
DoE Running [========================>----------------]  60% Time left:  4m
DoE Running [==========================>--------------]  67% Time left:  4m
DoE Running [=============================>-----------]  73% Time left:  3m
DoE Running [================================>--------]  80% Time left:  2m
DoE Running [===================================>-----]  87% Time left:  2m
DoE Running [=====================================>---]  93% Time left: 47s
DoE Running [=========================================] 100% Time left:  0s
                                                                           
100% |
## Round 2 Finished !
## Model Parsing...
## Gaussian peak ratio (%): 42.6
## Model Parsing Done !
## 
## Round:3
## DoE Running Begin...
## 
DoE Running [====>------------------------------------]  13% Time left: 13m
DoE Running [=======>---------------------------------]  20% Time left: 15m
DoE Running [==========>------------------------------]  27% Time left: 15m
DoE Running [=============>---------------------------]  33% Time left: 15m
DoE Running [===============>-------------------------]  40% Time left: 13m
DoE Running [==================>----------------------]  47% Time left: 12m
DoE Running [=====================>-------------------]  53% Time left: 10m
DoE Running [========================>----------------]  60% Time left:  8m
DoE Running [==========================>--------------]  67% Time left:  7m
DoE Running [=============================>-----------]  73% Time left:  5m
DoE Running [================================>--------]  80% Time left:  4m
DoE Running [===================================>-----]  87% Time left:  2m
DoE Running [=====================================>---]  93% Time left:  1m
DoE Running [=========================================] 100% Time left:  0s
                                                                           
100% |
## Round 3 Finished !
## Model Parsing...
## Gaussian peak ratio (%): 34.3
## Model Parsing Done !
## 
## No Increase Stopping !
## best parameter settings:
## min_peakwidth:  5
##  max_peakwidth:  15.75
##  mzdiff:  0.036
##  snthresh:  7.1
##  bw:  2
##  Peak_method:  centWave
##  RT_method:  loess
##  ppm:  4.3
##  noise:  6772
##  prefilter:  2
##  value_of_prefilter:  11556.95
##  minFraction:  0.8
##  minSamples:  1
##  maxFeatures:  100
##  fitgauss:  FALSE
##  mzCenterFun:  wMean
##  integrate:  1
##  extra:  1
##  span:  0.4
##  smooth:  loess
##  family:  gaussian
##  verbose.columns:  FALSE
##  polarity:  negative
##  perc_fwhm:  0.6
##  mz_abs_iso:  0.005
##  max_charge:  2
##  max_iso:  2
##  corr_eic_th:  0.85
##  mz_abs_add:  0.001
##  rmConts:  TRUE
##  BlankSub:  TRUE
## Step 1/6: Parameters Optimization Finished ! (2023-10-31 10:49:33.587386)
## Time Spent In Total:49.3mins
# "path" is used to specify the path to the folder containing the raw MS spectra to be processed.
# BPI and TIC plotting can be enabled with parameter, 
# "plotSettings = SetPlotParam(Plot = T)", or disabled by changing "T" into "F";

mSet <- ImportRawMSData(path = c("upload"), plotSettings = SetPlotParam(Plot = T))
## No initialized mSet found, will initialize one automatically !
## Warning in ImportRawMSData(path = c("upload"), plotSettings = SetPlotParam(Plot
## = T)): No metadata provided, all files in one sub-folder will be considered a
## group!
## 
## Step 2/6: Start to import the spectrum! 
## This step will take a short time...
## Raw file import begin...
## To reduce memory usage BPIS and TICS plots will be created using only 10 samples per group.
## Plotting BPIS and TICS.

## Step 2/6: Successfully imported raw MS data! (2023-10-31 10:49:51.927451) 
## Going to the next step...

# "mSet" include complete raw MS spectra to be processed.
# "params" is using the "best_params" generated above
# Plotting functions can be enabled with parameter, 
# "plotSettings = SetPlotParam(Plot = T)", or disabled by changing "T" into "F";
mSet <- PerformPeakProfiling(mSet, Params = best_params, plotSettings = SetPlotParam(Plot=TRUE))
## 11 CPU Threads will be used for peak profiling !
## 
## Step 3/6: Started peak picking! This step will take some time...
## Step 3/6: Peak picking finished ! (2023-10-31 10:50:32.786173)
## 
## Step 4/6: Started peak alignment! This step is running...
## Total of 9517 slices detected for processing... Done ! 
## Going to the next step...
## No blank sample included based on grouping info. Skipped!
## PeakGroup -- loess is used for retention time correction.....
## Performing retention time correction using 1321 peak groups.
## Applying retention time adjustment to the identified chromatographic peaks ... Done !
## Total of 9517 slices detected for processing... Done ! 
## Going to the next step...
## Step 4/6: Peak alignment finished ! (2023-10-31 10:51:04.625043)
## 
## Step 5/6: Started peak filling! This step may take some time...
## Starting peak filling!
## Defining peak areas for filling-in....OK
## Start integrating peak areas from original files...
## Step 5/6: Peak filing finished ! (2023-10-31 10:51:28.303494)
## Peak Profiling finished successfully !
## Begin to plotting figures...

## Done !

# We firstly define the parameters for feature annotation

# 'polarity' is required, can be either 'negative' or 'positive';
# 'perc_fwhm' is used to set the percentage of the width of the FWHM for peak grouping. 
#              Default is set to 0.6;
# 'mz_abs_iso' is used to set the allowed variance for the search (for isotope annotation). 
#              The default is set to 0.005;
# 'max_charge' is set the maximum number of the isotope charge. 
#              For example, the default is 2, therefore the max isotope charge is 2+/-;
# 'max_iso' is used to set the maximum number of isotope peaks.
#              For example, the default is 2, therefore the max number of isotopes per peaks is 2;
# 'corr_eic_th' is used to set the threshold for intensity correlations across samples. 
#              Default is set to 0.85.
# 'mz_abs_add' is used to set the allowed variance for the search (for adduct annotation). 
#              Default is set to 0.001.
# 'adducts' is used to specify the adducts based on your instrument settings.

annParams <- SetAnnotationParam(polarity = 'positive', mz_abs_add = 0.015);
 
# "mSet" include processed raw MS spectra to be processed.
# "annParams" is the parameters used for annotation

mSet <- PerformPeakAnnotation(mSet, annParams)
## 
## Step 6/6: Starting Peak Annotation...
## Start grouping after retention time.
## Created 109 pseudospectra.
## Generating peak matrix...
## Run isotope peak annotation..
## 
Isotope [=>-------------------------------------------]   6% Time left:  4s
Isotope [==>------------------------------------------]   6% Time left:  4s
Isotope [==>------------------------------------------]   7% Time left:  4s
Isotope [===>-----------------------------------------]   8% Time left:  4s
Isotope [===>-----------------------------------------]   9% Time left:  4s
Isotope [====>----------------------------------------]  10% Time left:  4s
Isotope [====>----------------------------------------]  11% Time left:  4s
Isotope [====>----------------------------------------]  12% Time left:  3s
Isotope [=====>---------------------------------------]  13% Time left:  3s
Isotope [=====>---------------------------------------]  14% Time left:  3s
Isotope [======>--------------------------------------]  15% Time left:  3s
Isotope [======>--------------------------------------]  16% Time left:  3s
Isotope [======>--------------------------------------]  17% Time left:  3s
Isotope [=======>-------------------------------------]  17% Time left:  3s
Isotope [=======>-------------------------------------]  18% Time left:  3s
Isotope [========>------------------------------------]  19% Time left:  3s
Isotope [========>------------------------------------]  20% Time left:  3s
Isotope [========>------------------------------------]  21% Time left:  3s
Isotope [=========>-----------------------------------]  22% Time left:  3s
Isotope [=========>-----------------------------------]  23% Time left:  3s
Isotope [==========>----------------------------------]  24% Time left:  3s
Isotope [==========>----------------------------------]  25% Time left:  3s
Isotope [===========>---------------------------------]  26% Time left:  3s
Isotope [===========>---------------------------------]  27% Time left:  3s
Isotope [===========>---------------------------------]  28% Time left:  2s
Isotope [============>--------------------------------]  28% Time left:  2s
Isotope [============>--------------------------------]  29% Time left:  2s
Isotope [=============>-------------------------------]  30% Time left:  2s
Isotope [=============>-------------------------------]  31% Time left:  2s
Isotope [=============>-------------------------------]  32% Time left:  2s
Isotope [==============>------------------------------]  33% Time left:  2s
Isotope [==============>------------------------------]  34% Time left:  2s
Isotope [===============>-----------------------------]  35% Time left:  2s
Isotope [===============>-----------------------------]  36% Time left:  2s
Isotope [================>----------------------------]  37% Time left:  2s
Isotope [================>----------------------------]  38% Time left:  2s
Isotope [================>----------------------------]  39% Time left:  2s
Isotope [=================>---------------------------]  39% Time left:  2s
Isotope [=================>---------------------------]  40% Time left:  2s
Isotope [==================>--------------------------]  41% Time left:  2s
Isotope [==================>--------------------------]  42% Time left:  2s
Isotope [==================>--------------------------]  43% Time left:  2s
Isotope [===================>-------------------------]  44% Time left:  2s
Isotope [===================>-------------------------]  45% Time left:  2s
Isotope [====================>------------------------]  46% Time left:  2s
Isotope [====================>------------------------]  47% Time left:  2s
Isotope [====================>------------------------]  48% Time left:  2s
Isotope [=====================>-----------------------]  49% Time left:  2s
Isotope [=====================>-----------------------]  50% Time left:  2s
Isotope [======================>----------------------]  50% Time left:  1s
Isotope [======================>----------------------]  51% Time left:  1s
Isotope [=======================>---------------------]  52% Time left:  1s
Isotope [=======================>---------------------]  53% Time left:  1s
Isotope [=======================>---------------------]  54% Time left:  1s
Isotope [========================>--------------------]  55% Time left:  1s
Isotope [========================>--------------------]  56% Time left:  1s
Isotope [=========================>-------------------]  57% Time left:  1s
Isotope [=========================>-------------------]  58% Time left:  1s
Isotope [=========================>-------------------]  59% Time left:  1s
Isotope [==========================>------------------]  60% Time left:  1s
Isotope [==========================>------------------]  61% Time left:  1s
Isotope [===========================>-----------------]  61% Time left:  1s
Isotope [===========================>-----------------]  62% Time left:  1s
Isotope [===========================>-----------------]  63% Time left:  1s
Isotope [============================>----------------]  64% Time left:  1s
Isotope [============================>----------------]  65% Time left:  1s
Isotope [=============================>---------------]  66% Time left:  1s
Isotope [=============================>---------------]  67% Time left:  1s
Isotope [==============================>--------------]  68% Time left:  1s
Isotope [==============================>--------------]  69% Time left:  1s
Isotope [==============================>--------------]  70% Time left:  1s
Isotope [===============================>-------------]  71% Time left:  1s
Isotope [===============================>-------------]  72% Time left:  1s
Isotope [================================>------------]  72% Time left:  1s
Isotope [================================>------------]  73% Time left:  1s
Isotope [================================>------------]  74% Time left:  1s
Isotope [=================================>-----------]  75% Time left:  1s
Isotope [=================================>-----------]  76% Time left:  0s
Isotope [==================================>----------]  77% Time left:  0s
Isotope [==================================>----------]  78% Time left:  0s
Isotope [===================================>---------]  79% Time left:  0s
Isotope [===================================>---------]  80% Time left:  0s
Isotope [===================================>---------]  81% Time left:  0s
Isotope [====================================>--------]  82% Time left:  0s
Isotope [====================================>--------]  83% Time left:  0s
Isotope [=====================================>-------]  83% Time left:  0s
Isotope [=====================================>-------]  84% Time left:  0s
Isotope [=====================================>-------]  85% Time left:  0s
Isotope [======================================>------]  86% Time left:  0s
Isotope [======================================>------]  87% Time left:  0s
Isotope [=======================================>-----]  88% Time left:  0s
Isotope [=======================================>-----]  89% Time left:  0s
Isotope [=======================================>-----]  90% Time left:  0s
Isotope [========================================>----]  91% Time left:  0s
Isotope [========================================>----]  92% Time left:  0s
Isotope [=========================================>---]  93% Time left:  0s
Isotope [=========================================>---]  94% Time left:  0s
Isotope [==========================================>--]  94% Time left:  0s
Isotope [==========================================>--]  95% Time left:  0s
Isotope [==========================================>--]  96% Time left:  0s
Isotope [===========================================>-]  97% Time left:  0s
Isotope [===========================================>-]  98% Time left:  0s
Isotope [============================================>]  99% Time left:  0s
Isotope [=============================================] 100% Time left:  0s
                                                                           
Found isotopes:716
## Start grouping after correlation...
## Generating EIC's....
## Detecting  Naive_007.mzML  ... 477 peaks found!
## Detecting  Naive_027.mzML  ... 24 peaks found!
## Detecting  Naive_071.mzML  ... 50 peaks found!
## Detecting  Naive_109.mzML  ... 60 peaks found!
## Detecting  Naive_127.mzML  ... 159 peaks found!
## Detecting  Naive_139.mzML  ... 0 peaks found!
## Detecting  QC_001.mzML  ... 1299 peaks found!
## Detecting  QC_003.mzML  ... 2 peaks found!
## Detecting  QC_005.mzML  ... 25 peaks found!
## Detecting  Semi_025.mzML  ... 651 peaks found!
## Detecting  Semi_045.mzML  ... 404 peaks found!
## Detecting  Semi_061.mzML  ... 708 peaks found!
## Detecting  Semi_091.mzML  ... 553 peaks found!
## Detecting  Semi_143.mzML  ... 687 peaks found!
## Detecting  Semi_157.mzML  ... 88 peaks found!
## Warning: Found NA peaks in selected sample.
## Calculating peak correlations in 109 Groups... 
## 
Generating [=======>----------------------------------]  19% Time left:  1s
Generating [=======>----------------------------------]  20% Time left:  1s
Generating [========>---------------------------------]  21% Time left:  1s
Generating [========>---------------------------------]  22% Time left:  1s
Generating [=========>--------------------------------]  23% Time left:  1s
Generating [=========>--------------------------------]  24% Time left:  1s
Generating [=========>--------------------------------]  25% Time left:  1s
Generating [==========>-------------------------------]  26% Time left:  1s
Generating [==========>-------------------------------]  27% Time left:  1s
Generating [===========>------------------------------]  28% Time left:  1s
Generating [===========>------------------------------]  29% Time left:  1s
Generating [============>-----------------------------]  30% Time left:  1s
Generating [============>-----------------------------]  31% Time left:  1s
Generating [============>-----------------------------]  32% Time left:  1s
Generating [=============>----------------------------]  33% Time left:  1s
Generating [=============>----------------------------]  34% Time left:  1s
Generating [==============>---------------------------]  35% Time left:  1s
Generating [==============>---------------------------]  36% Time left:  1s
Generating [==============>---------------------------]  37% Time left:  1s
Generating [===============>--------------------------]  38% Time left:  1s
Generating [===============>--------------------------]  39% Time left:  1s
Generating [================>-------------------------]  39% Time left:  1s
Generating [================>-------------------------]  40% Time left:  1s
Generating [================>-------------------------]  41% Time left:  1s
Generating [=================>------------------------]  42% Time left:  1s
Generating [=================>------------------------]  43% Time left:  1s
Generating [=================>------------------------]  44% Time left:  1s
Generating [==================>-----------------------]  45% Time left:  1s
Generating [==================>-----------------------]  46% Time left:  1s
Generating [===================>----------------------]  47% Time left:  1s
Generating [===================>----------------------]  48% Time left:  1s
Generating [===================>----------------------]  49% Time left:  1s
Generating [====================>---------------------]  50% Time left:  1s
Generating [=====================>--------------------]  51% Time left:  1s
Generating [=====================>--------------------]  52% Time left:  0s
Generating [=====================>--------------------]  53% Time left:  0s
Generating [======================>-------------------]  54% Time left:  0s
Generating [======================>-------------------]  55% Time left:  0s
Generating [=======================>------------------]  56% Time left:  0s
Generating [=======================>------------------]  57% Time left:  0s
Generating [=======================>------------------]  58% Time left:  0s
Generating [========================>-----------------]  59% Time left:  0s
Generating [========================>-----------------]  60% Time left:  0s
Generating [========================>-----------------]  61% Time left:  0s
Generating [=========================>----------------]  61% Time left:  0s
Generating [=========================>----------------]  62% Time left:  0s
Generating [==========================>---------------]  63% Time left:  0s
Generating [==========================>---------------]  64% Time left:  0s
Generating [==========================>---------------]  65% Time left:  0s
Generating [===========================>--------------]  66% Time left:  0s
Generating [===========================>--------------]  67% Time left:  0s
Generating [============================>-------------]  68% Time left:  0s
Generating [============================>-------------]  69% Time left:  0s
Generating [============================>-------------]  70% Time left:  0s
Generating [=============================>------------]  71% Time left:  0s
Generating [=============================>------------]  72% Time left:  0s
Generating [==============================>-----------]  73% Time left:  0s
Generating [==============================>-----------]  74% Time left:  0s
Generating [===============================>----------]  75% Time left:  0s
Generating [===============================>----------]  76% Time left:  0s
Generating [===============================>----------]  77% Time left:  0s
Generating [================================>---------]  78% Time left:  0s
Generating [================================>---------]  79% Time left:  0s
Generating [=================================>--------]  80% Time left:  0s
Generating [=================================>--------]  81% Time left:  0s
Generating [=================================>--------]  82% Time left:  0s
Generating [==================================>-------]  83% Time left:  0s
Generating [==================================>-------]  84% Time left:  0s
Generating [===================================>------]  85% Time left:  0s
Generating [===================================>------]  86% Time left:  0s
Generating [====================================>-----]  87% Time left:  0s
Generating [====================================>-----]  88% Time left:  0s
Generating [====================================>-----]  89% Time left:  0s
Generating [=====================================>----]  90% Time left:  0s
Generating [=====================================>----]  91% Time left:  0s
Generating [======================================>---]  92% Time left:  0s
Generating [======================================>---]  93% Time left:  0s
Generating [======================================>---]  94% Time left:  0s
Generating [=======================================>--]  94% Time left:  0s
Generating [=======================================>--]  95% Time left:  0s
Generating [=======================================>--]  96% Time left:  0s
Generating [========================================>-]  97% Time left:  0s
Generating [========================================>-]  98% Time left:  0s
Generating [=========================================>]  99% Time left:  0s
Generating [==========================================] 100% Time left:  0s
                                                                           
Calculating graph cross linking in 109 Groups...
## 
Calculating [=>---------------------------------------]   5% Time left:  5s
Calculating [=>---------------------------------------]   6% Time left:  4s
Calculating [==>--------------------------------------]   6% Time left:  5s
Calculating [==>--------------------------------------]   7% Time left:  4s
Calculating [==>--------------------------------------]   8% Time left:  5s
Calculating [===>-------------------------------------]   9% Time left:  4s
Calculating [===>-------------------------------------]  10% Time left:  4s
Calculating [====>------------------------------------]  11% Time left:  4s
Calculating [====>------------------------------------]  12% Time left:  4s
Calculating [====>------------------------------------]  13% Time left:  3s
Calculating [=====>-----------------------------------]  14% Time left:  3s
Calculating [=====>-----------------------------------]  15% Time left:  3s
Calculating [=====>-----------------------------------]  16% Time left:  3s
Calculating [======>----------------------------------]  17% Time left:  3s
Calculating [======>----------------------------------]  17% Time left:  5s
Calculating [=======>---------------------------------]  18% Time left:  5s
Calculating [=======>---------------------------------]  19% Time left: 11s
Calculating [=======>---------------------------------]  20% Time left: 10s
Calculating [========>--------------------------------]  21% Time left: 10s
Calculating [========>--------------------------------]  22% Time left:  9s
Calculating [========>--------------------------------]  23% Time left:  9s
Calculating [=========>-------------------------------]  24% Time left:  8s
Calculating [=========>-------------------------------]  25% Time left:  8s
Calculating [==========>------------------------------]  26% Time left:  8s
Calculating [==========>------------------------------]  27% Time left:  8s
Calculating [==========>------------------------------]  28% Time left:  7s
Calculating [===========>-----------------------------]  28% Time left:  7s
Calculating [===========>-----------------------------]  29% Time left:  7s
Calculating [===========>-----------------------------]  30% Time left:  6s
Calculating [============>----------------------------]  31% Time left: 14s
Calculating [============>----------------------------]  32% Time left: 13s
Calculating [=============>---------------------------]  33% Time left: 13s
Calculating [=============>---------------------------]  34% Time left: 12s
Calculating [=============>---------------------------]  35% Time left: 12s
Calculating [==============>--------------------------]  36% Time left: 11s
Calculating [==============>--------------------------]  37% Time left: 11s
Calculating [==============>--------------------------]  38% Time left: 11s
Calculating [===============>-------------------------]  39% Time left: 10s
Calculating [================>------------------------]  40% Time left: 10s
Calculating [================>------------------------]  41% Time left:  9s
Calculating [================>------------------------]  42% Time left:  9s
Calculating [=================>-----------------------]  43% Time left:  9s
Calculating [=================>-----------------------]  44% Time left:  9s
Calculating [=================>-----------------------]  45% Time left:  8s
Calculating [==================>----------------------]  46% Time left:  8s
Calculating [==================>----------------------]  47% Time left:  8s
Calculating [===================>---------------------]  48% Time left:  8s
Calculating [===================>---------------------]  49% Time left:  7s
Calculating [===================>---------------------]  50% Time left:  7s
Calculating [====================>--------------------]  50% Time left:  7s
Calculating [====================>--------------------]  51% Time left:  7s
Calculating [====================>--------------------]  52% Time left:  6s
Calculating [=====================>-------------------]  53% Time left:  6s
Calculating [=====================>-------------------]  54% Time left:  6s
Calculating [======================>------------------]  55% Time left:  6s
Calculating [======================>------------------]  56% Time left:  5s
Calculating [======================>------------------]  57% Time left:  5s
Calculating [=======================>-----------------]  58% Time left:  5s
Calculating [=======================>-----------------]  59% Time left:  5s
Calculating [=======================>-----------------]  60% Time left:  5s
Calculating [========================>----------------]  61% Time left:  4s
Calculating [=========================>---------------]  62% Time left:  4s
Calculating [=========================>---------------]  63% Time left:  4s
Calculating [=========================>---------------]  64% Time left:  4s
Calculating [==========================>--------------]  65% Time left:  4s
Calculating [==========================>--------------]  66% Time left:  4s
Calculating [==========================>--------------]  67% Time left:  4s
Calculating [===========================>-------------]  68% Time left:  3s
Calculating [===========================>-------------]  69% Time left:  3s
Calculating [============================>------------]  70% Time left:  3s
Calculating [============================>------------]  71% Time left:  3s
Calculating [============================>------------]  72% Time left:  3s
Calculating [=============================>-----------]  72% Time left:  3s
Calculating [=============================>-----------]  73% Time left:  3s
Calculating [=============================>-----------]  74% Time left:  2s
Calculating [==============================>----------]  75% Time left:  2s
Calculating [==============================>----------]  76% Time left:  2s
Calculating [===============================>---------]  77% Time left:  2s
Calculating [===============================>---------]  78% Time left:  2s
Calculating [===============================>---------]  79% Time left:  2s
Calculating [================================>--------]  80% Time left:  2s
Calculating [================================>--------]  81% Time left:  2s
Calculating [================================>--------]  82% Time left:  2s
Calculating [=================================>-------]  83% Time left:  2s
Calculating [=================================>-------]  83% Time left:  1s
Calculating [==================================>------]  84% Time left:  1s
Calculating [==================================>------]  85% Time left:  1s
Calculating [==================================>------]  86% Time left:  1s
Calculating [===================================>-----]  87% Time left:  1s
Calculating [===================================>-----]  88% Time left:  1s
Calculating [===================================>-----]  89% Time left:  1s
Calculating [====================================>----]  90% Time left:  1s
Calculating [====================================>----]  91% Time left:  1s
Calculating [=====================================>---]  92% Time left:  1s
Calculating [=====================================>---]  93% Time left:  1s
Calculating [=====================================>---]  94% Time left:  0s
Calculating [======================================>--]  94% Time left:  0s
Calculating [======================================>--]  95% Time left:  0s
Calculating [======================================>--]  96% Time left:  0s
Calculating [=======================================>-]  97% Time left:  0s
Calculating [=======================================>-]  98% Time left:  0s
Calculating [========================================>]  99% Time left:  0s
Calculating [=========================================] 100% Time left:  0s
                                                                           
New number of ps-groups:  2589
## mSet has now 2589 groups, instead of 109 !
## Generating peak matrix for peak annotation!
## Polarity is set in annotaParam: positive
## Ruleset could not read from object! Recalculating...
## Calculating possible adducts in 2589 Groups... 
## 
Calculating [-----------------------------------------]   0% Time left: 14m
Calculating [-----------------------------------------]   0% Time left: 11m
Calculating [-----------------------------------------]   0% Time left: 12m
Calculating [-----------------------------------------]   0% Time left: 14m
Calculating [-----------------------------------------]   0% Time left: 12m
Calculating [-----------------------------------------]   0% Time left: 15m
Calculating [-----------------------------------------]   0% Time left: 13m
Calculating [-----------------------------------------]   0% Time left: 15m
Calculating [-----------------------------------------]   0% Time left: 14m
Calculating [-----------------------------------------]   0% Time left: 13m
Calculating [-----------------------------------------]   0% Time left: 12m
Calculating [-----------------------------------------]   1% Time left: 11m
Calculating [-----------------------------------------]   1% Time left: 10m
Calculating [-----------------------------------------]   1% Time left: 12m
Calculating [-----------------------------------------]   1% Time left: 27m
Calculating [-----------------------------------------]   1% Time left: 26m
Calculating [-----------------------------------------]   1% Time left: 25m
Calculating [-----------------------------------------]   1% Time left: 24m
Calculating [-----------------------------------------]   1% Time left: 23m
Calculating [-----------------------------------------]   1% Time left: 22m
Calculating [-----------------------------------------]   1% Time left: 23m
Calculating [-----------------------------------------]   1% Time left: 22m
Calculating [-----------------------------------------]   1% Time left: 21m
Calculating [-----------------------------------------]   1% Time left: 20m
Calculating [>----------------------------------------]   1% Time left: 20m
Calculating [>----------------------------------------]   1% Time left: 19m
Calculating [>----------------------------------------]   1% Time left: 28m
Calculating [>----------------------------------------]   1% Time left: 27m
Calculating [>----------------------------------------]   1% Time left: 26m
Calculating [>----------------------------------------]   2% Time left: 26m
Calculating [>----------------------------------------]   2% Time left: 25m
Calculating [>----------------------------------------]   2% Time left: 24m
Calculating [>----------------------------------------]   2% Time left: 23m
Calculating [>----------------------------------------]   2% Time left: 22m
Calculating [>----------------------------------------]   2% Time left: 23m
Calculating [>----------------------------------------]   2% Time left: 22m
Calculating [>----------------------------------------]   2% Time left: 21m
Calculating [>----------------------------------------]   2% Time left: 20m
Calculating [>----------------------------------------]   2% Time left: 19m
Calculating [>----------------------------------------]   2% Time left: 18m
Calculating [>----------------------------------------]   3% Time left: 17m
Calculating [>----------------------------------------]   3% Time left: 16m
Calculating [>----------------------------------------]   3% Time left: 15m
Calculating [>----------------------------------------]   3% Time left: 14m
Calculating [>----------------------------------------]   3% Time left: 13m
Calculating [>----------------------------------------]   4% Time left: 13m
Calculating [=>---------------------------------------]   4% Time left: 13m
Calculating [=>---------------------------------------]   4% Time left: 12m
Calculating [=>---------------------------------------]   4% Time left: 11m
Calculating [=>---------------------------------------]   4% Time left: 10m
Calculating [=>---------------------------------------]   5% Time left: 10m
Calculating [=>---------------------------------------]   5% Time left:  9m
Calculating [=>---------------------------------------]   5% Time left:  8m
Calculating [=>---------------------------------------]   6% Time left:  8m
Calculating [=>---------------------------------------]   6% Time left:  7m
Calculating [==>--------------------------------------]   6% Time left:  7m
Calculating [==>--------------------------------------]   7% Time left:  7m
Calculating [==>--------------------------------------]   7% Time left:  6m
Calculating [==>--------------------------------------]   8% Time left:  6m
Calculating [==>--------------------------------------]   8% Time left:  5m
Calculating [==>--------------------------------------]   9% Time left:  5m
Calculating [===>-------------------------------------]   9% Time left:  5m
Calculating [===>-------------------------------------]  10% Time left:  5m
Calculating [===>-------------------------------------]  10% Time left:  4m
Calculating [===>-------------------------------------]  11% Time left:  4m
Calculating [====>------------------------------------]  11% Time left:  4m
Calculating [====>------------------------------------]  12% Time left:  4m
Calculating [====>------------------------------------]  12% Time left:  3m
Calculating [====>------------------------------------]  13% Time left:  3m
Calculating [=====>-----------------------------------]  13% Time left:  3m
Calculating [=====>-----------------------------------]  14% Time left:  3m
Calculating [=====>-----------------------------------]  15% Time left:  3m
Calculating [=====>-----------------------------------]  16% Time left:  3m
Calculating [======>----------------------------------]  16% Time left:  3m
Calculating [======>----------------------------------]  16% Time left:  2m
Calculating [======>----------------------------------]  17% Time left:  2m
Calculating [======>----------------------------------]  18% Time left:  2m
Calculating [=======>---------------------------------]  18% Time left:  2m
Calculating [=======>---------------------------------]  19% Time left:  2m
Calculating [=======>---------------------------------]  20% Time left:  2m
Calculating [=======>---------------------------------]  21% Time left:  2m
Calculating [========>--------------------------------]  21% Time left:  2m
Calculating [========>--------------------------------]  22% Time left:  2m
Calculating [========>--------------------------------]  23% Time left:  2m
Calculating [=========>-------------------------------]  23% Time left:  2m
Calculating [=========>-------------------------------]  24% Time left:  2m
Calculating [=========>-------------------------------]  25% Time left:  2m
Calculating [=========>-------------------------------]  25% Time left:  1m
Calculating [=========>-------------------------------]  26% Time left:  1m
Calculating [==========>------------------------------]  26% Time left:  1m
Calculating [==========>------------------------------]  27% Time left:  1m
Calculating [==========>------------------------------]  28% Time left:  1m
Calculating [===========>-----------------------------]  28% Time left:  1m
Calculating [===========>-----------------------------]  29% Time left:  1m
Calculating [===========>-----------------------------]  30% Time left:  1m
Calculating [============>----------------------------]  31% Time left:  1m
Calculating [============>----------------------------]  32% Time left:  1m
Calculating [============>----------------------------]  33% Time left:  1m
Calculating [=============>---------------------------]  33% Time left:  1m
Calculating [=============>---------------------------]  34% Time left:  1m
Calculating [=============>---------------------------]  35% Time left:  1m
Calculating [==============>--------------------------]  35% Time left:  1m
Calculating [==============>--------------------------]  36% Time left:  1m
Calculating [==============>--------------------------]  37% Time left:  1m
Calculating [==============>--------------------------]  37% Time left: 50s
Calculating [==============>--------------------------]  37% Time left: 49s
Calculating [==============>--------------------------]  38% Time left: 49s
Calculating [===============>-------------------------]  38% Time left: 49s
Calculating [===============>-------------------------]  38% Time left: 48s
Calculating [===============>-------------------------]  38% Time left: 47s
Calculating [===============>-------------------------]  39% Time left: 47s
Calculating [===============>-------------------------]  39% Time left: 46s
Calculating [===============>-------------------------]  39% Time left: 45s
Calculating [===============>-------------------------]  40% Time left: 45s
Calculating [===============>-------------------------]  40% Time left: 44s
Calculating [================>------------------------]  40% Time left: 44s
Calculating [================>------------------------]  41% Time left: 44s
Calculating [================>------------------------]  41% Time left: 43s
Calculating [================>------------------------]  41% Time left: 42s
Calculating [================>------------------------]  42% Time left: 42s
Calculating [================>------------------------]  42% Time left: 41s
Calculating [================>------------------------]  42% Time left: 40s
Calculating [================>------------------------]  43% Time left: 40s
Calculating [=================>-----------------------]  43% Time left: 40s
Calculating [=================>-----------------------]  43% Time left: 39s
Calculating [=================>-----------------------]  44% Time left: 38s
Calculating [=================>-----------------------]  44% Time left: 37s
Calculating [=================>-----------------------]  45% Time left: 37s
Calculating [=================>-----------------------]  45% Time left: 36s
Calculating [==================>----------------------]  45% Time left: 36s
Calculating [==================>----------------------]  46% Time left: 36s
Calculating [==================>----------------------]  46% Time left: 35s
Calculating [==================>----------------------]  46% Time left: 34s
Calculating [==================>----------------------]  47% Time left: 34s
Calculating [==================>----------------------]  47% Time left: 33s
Calculating [==================>----------------------]  48% Time left: 33s
Calculating [===================>---------------------]  48% Time left: 33s
Calculating [===================>---------------------]  48% Time left: 32s
Calculating [===================>---------------------]  49% Time left: 32s
Calculating [===================>---------------------]  49% Time left: 31s
Calculating [===================>---------------------]  49% Time left: 30s
Calculating [===================>---------------------]  50% Time left: 30s
Calculating [====================>--------------------]  50% Time left: 30s
Calculating [====================>--------------------]  50% Time left: 29s
Calculating [====================>--------------------]  51% Time left: 29s
Calculating [====================>--------------------]  51% Time left: 28s
Calculating [====================>--------------------]  52% Time left: 28s
Calculating [====================>--------------------]  52% Time left: 27s
Calculating [=====================>-------------------]  52% Time left: 27s
Calculating [=====================>-------------------]  53% Time left: 27s
Calculating [=====================>-------------------]  53% Time left: 26s
Calculating [=====================>-------------------]  54% Time left: 26s
Calculating [=====================>-------------------]  54% Time left: 25s
Calculating [=====================>-------------------]  55% Time left: 25s
Calculating [======================>------------------]  55% Time left: 25s
Calculating [======================>------------------]  55% Time left: 24s
Calculating [======================>------------------]  56% Time left: 24s
Calculating [======================>------------------]  56% Time left: 23s
Calculating [======================>------------------]  57% Time left: 23s
Calculating [======================>------------------]  57% Time left: 22s
Calculating [=======================>-----------------]  57% Time left: 22s
Calculating [=======================>-----------------]  58% Time left: 22s
Calculating [=======================>-----------------]  58% Time left: 21s
Calculating [=======================>-----------------]  59% Time left: 21s
Calculating [=======================>-----------------]  59% Time left: 20s
Calculating [=======================>-----------------]  60% Time left: 20s
Calculating [========================>----------------]  60% Time left: 20s
Calculating [========================>----------------]  61% Time left: 20s
Calculating [========================>----------------]  61% Time left: 19s
Calculating [========================>----------------]  62% Time left: 19s
Calculating [========================>----------------]  62% Time left: 18s
Calculating [=========================>---------------]  62% Time left: 18s
Calculating [=========================>---------------]  63% Time left: 18s
Calculating [=========================>---------------]  63% Time left: 17s
Calculating [=========================>---------------]  64% Time left: 17s
Calculating [=========================>---------------]  65% Time left: 17s
Calculating [==========================>--------------]  65% Time left: 17s
Calculating [==========================>--------------]  65% Time left: 16s
Calculating [==========================>--------------]  66% Time left: 16s
Calculating [==========================>--------------]  66% Time left: 15s
Calculating [==========================>--------------]  67% Time left: 15s
Calculating [===========================>-------------]  67% Time left: 15s
Calculating [===========================>-------------]  68% Time left: 15s
Calculating [===========================>-------------]  68% Time left: 14s
Calculating [===========================>-------------]  69% Time left: 14s
Calculating [===========================>-------------]  69% Time left: 13s
Calculating [============================>------------]  70% Time left: 13s
Calculating [============================>------------]  71% Time left: 13s
Calculating [============================>------------]  71% Time left: 12s
Calculating [============================>------------]  72% Time left: 12s
Calculating [=============================>-----------]  72% Time left: 12s
Calculating [=============================>-----------]  73% Time left: 12s
Calculating [=============================>-----------]  73% Time left: 11s
Calculating [=============================>-----------]  74% Time left: 11s
Calculating [==============================>----------]  74% Time left: 11s
Calculating [==============================>----------]  74% Time left: 10s
Calculating [==============================>----------]  75% Time left: 10s
Calculating [==============================>----------]  76% Time left: 10s
Calculating [==============================>----------]  76% Time left:  9s
Calculating [==============================>----------]  77% Time left:  9s
Calculating [===============================>---------]  77% Time left:  9s
Calculating [===============================>---------]  78% Time left:  9s
Calculating [===============================>---------]  78% Time left:  8s
Calculating [===============================>---------]  79% Time left:  8s
Calculating [================================>--------]  79% Time left:  8s
Calculating [================================>--------]  80% Time left:  8s
Calculating [================================>--------]  80% Time left:  7s
Calculating [================================>--------]  81% Time left:  7s
Calculating [================================>--------]  82% Time left:  7s
Calculating [=================================>-------]  82% Time left:  7s
Calculating [=================================>-------]  83% Time left:  7s
Calculating [=================================>-------]  83% Time left:  6s
Calculating [=================================>-------]  84% Time left:  6s
Calculating [==================================>------]  84% Time left:  6s
Calculating [==================================>------]  85% Time left:  6s
Calculating [==================================>------]  85% Time left:  5s
Calculating [==================================>------]  86% Time left:  5s
Calculating [==================================>------]  87% Time left:  5s
Calculating [===================================>-----]  87% Time left:  5s
Calculating [===================================>-----]  87% Time left:  4s
Calculating [===================================>-----]  88% Time left:  4s
Calculating [===================================>-----]  89% Time left:  4s
Calculating [====================================>----]  89% Time left:  4s
Calculating [====================================>----]  90% Time left:  4s
Calculating [====================================>----]  90% Time left:  3s
Calculating [====================================>----]  91% Time left:  3s
Calculating [=====================================>---]  91% Time left:  3s
Calculating [=====================================>---]  92% Time left:  3s
Calculating [=====================================>---]  93% Time left:  2s
Calculating [=====================================>---]  94% Time left:  2s
Calculating [======================================>--]  94% Time left:  2s
Calculating [======================================>--]  95% Time left:  2s
Calculating [======================================>--]  95% Time left:  1s
Calculating [======================================>--]  96% Time left:  1s
Calculating [=======================================>-]  96% Time left:  1s
Calculating [=======================================>-]  97% Time left:  1s
Calculating [=======================================>-]  98% Time left:  1s
Calculating [=======================================>-]  98% Time left:  0s
Calculating [=======================================>-]  99% Time left:  0s
Calculating [========================================>]  99% Time left:  0s
Calculating [========================================>] 100% Time left:  0s
Calculating [=========================================] 100% Time left:  0s
                                                                           
Step 6/6: Successfully performed peak annotation! (2023-10-31 10:52:31.809792) 
## Going to the final step...
# Here we format and filter the peak list for following analysis with MetaboAnalystR

# Parameters are explained as below,
# annParams, is the object created using the SetAnnotationParam function above;
# filtIso, is used to decide to filter out all isotopes (TRUE) or not (FALSE);
# filtAdducts, is used to decide to filter out all adducts (TRUE) or not (FALSE);
# missPercent, specify the threshold to remove features missing in a certain percentage
#              of all samples in a group.

mSet <- FormatPeakList(mSet, annParams, filtIso = FALSE, filtAdducts = FALSE, missPercent = 1);

data_folder_Output <- "."

# Export annotation results, the annotation will be save as "annotated_peaklist.csv";
Export.Annotation(mSet,  path = data_folder_Output);

# Export complete feature table. It will be saved as "metaboanalyst_input.csv";
# This table can be used for statistic analysis, functional analysis, biomarker analysis module directly.
Export.PeakTable(mSet, path = data_folder_Output);
## Done!
## 
## Everything has been finished Successfully ! (2023-10-31 10:52:32.459335)
# Export a summary table (peak_result_summary.txt) to summarize the information of all peaks in
# different samples. The columns are sample names, groups, retention time range, m/z range of all peaks,
# number of all peaks and percentage of missing features.
Export.PeakSummary(mSet,  path = data_folder_Output)