knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = TRUE, out.width = "100%" )
metflow2
also provide some useful tools for MS raw data processing.
You can use metflow2
to extract peaks from the mzXML format data and then draw them.
Put you mzXML data and the feature_table
(xlsx format) in a folder and then set this folder as the working directory.
![](../man/figures/Screen Shot 2020-04-01 at 1.38.19 PM.png)
The feature_table
should be xlsx format and like the below figure shows:
![](../man/figures/Screen Shot 2020-04-01 at 1.41.04 PM.png)
Note: The rt must in seconds.
We use the demo data from demoData
package.
First we load the demo data from demoData
package and then place them in a example
folder.
library(demoData) library(metflow2) library(tidyverse)
##create a folder named as example path <- file.path(".", "example") dir.create(path = path, showWarnings = FALSE)
##get demo data mzxml_data <- system.file("mzxml/POS/QC", package = "demoData") file.copy(from = file.path(mzxml_data, dir(mzxml_data)), to = path, overwrite = TRUE, recursive = TRUE) is_table <- system.file("mzxml/POS/", package = "demoData") file.copy(from = file.path(is_table, "is.xlsx"), to = path, overwrite = TRUE, recursive = TRUE)
Now the demo mzXML data and feature table (is.xlsx
)is in the ./example/
folder.
Next, we use the extractPeaks()
function for peak detection and alignment.
peak_data <- extractPeaks( path = path, ppm = 15, threads = 4, is.table = "is.xlsx", mz = NULL, rt = NULL, rt.tolerance = 40 )
Some important arguments:
ppm
: Peak detection ppm.
rt.tolerance
: Peak detection ppm.
is.table
: If you add internal standards in your samples, you can provide the the is.table
in the folder which your mzXML format data in. It must be xlsx
format like the below figure shows:
![](../man/figures/Screen Shot 2020-04-01 at 10.11.33 AM.png)
Other parameters you can find here: processData()
.
After get the peak_data
using extractPeaks()
function, we can use show_peak()
function to draw plot.
show_peak(object = peak_data, peak.index = 1)
If you don't want to get the interactive plot, you can just set interactive
as FALSE
.
show_peak(object = peak_data, peak.index = 1, interactive = FALSE)
You can also set alpha
as 0 to avoid the area color.
show_peak(object = peak_data, peak.index = 5, alpha = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.