knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = TRUE, out.width = "100%" )
Some times if you have more than two batch peak tables, and they are processed at different times, so you need to align them together before other analysis. In metflow2
, we use the align_batch()
function to do that.
The peak table (csv format) can be from any software. We recomment that you use the Peak_table_for_cleaning.csv
from processData()
function from metflow2
.
If you use other software, please make sure that the top 3 columns are name
(peak name), mz
and rt
(retention time, second). And the left column are sample intensity.

We need the sample information (csv format) to define the detailed information of samples. Column 1 is sample.name
, column 2 is injection.order
, column 3 is class
(such as Subject, QC, Blank), column 4 is batch
and column 5 is group
(such as control and case).

Then place the peak table and sample information in a folder. We use the demo data from demoData
package.
library(metflow2) library(demoData) library(tidyverse)
##create a folder named as example path <- file.path(".", "example") dir.create(path = path, showWarnings = FALSE)
##get demo data demo_data <- system.file("metflow2", package = "demoData") file.copy(from = file.path(demo_data, dir(demo_data)), to = path, overwrite = TRUE, recursive = TRUE)
Here, we have two peak tables, batch1.data.csv
and batch2.data.csv
, and sample_info.csv
are in your ./example
folder.
metflowClass
objectobject <- create_metflow_object( ms1.data = c("batch1.data.csv", "batch2.data.csv"), sample.information = "sample_info.csv", path = path )
object
is a metflowClass
object, so you can print it in the console.
object
align_batch()
functionobject2 <- align_batch(object = object, combine.mz.tol = 15, combine.rt.tol = 30, use.int.tol = FALSE)
object2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.