This function adds MS2 data to a mass_dataset object. It reads MS2 files from a specified path, matches them with MS1 data in the object, and stores the matched MS2 data in the object.
Arguments
- object
A mass_dataset object.
- column
A character vector specifying the column types. Default is c("rp", "hilic").
- polarity
A character vector specifying the polarity. Default is c("positive", "negative").
- ms1.ms2.match.mz.tol
Numeric, the m/z tolerance for matching MS1 and MS2. Default is 15.
- ms1.ms2.match.rt.tol
Numeric, the retention time tolerance for matching MS1 and MS2. Default is 30.
- path
Character, the directory path where MS2 files are located. Default is the current directory.
Author
Xiaotao Shen xiaotao.shen@outlook.com
Examples
if (FALSE) { # \dontrun{
data("expression_data")
data("sample_info")
data("variable_info")
object <- create_mass_dataset(
expression_data = expression_data,
sample_info = sample_info,
variable_info = variable_info
)
ms2_dir <- system.file("ms2_data", package = "massdataset")
object2 <- mutate_ms2(
object = object,
column = "rp",
polarity = "positive",
path = ms2_dir
)
names(extract_ms2_data(object2))
} # }
