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.
A mass_dataset object.
A character vector specifying the column types. Default is c("rp", "hilic").
A character vector specifying the polarity. Default is c("positive", "negative").
Numeric, the m/z tolerance for matching MS1 and MS2. Default is 15.
Numeric, the retention time tolerance for matching MS1 and MS2. Default is 30.
Character, the directory path where MS2 files are located. Default is the current directory.
A modified mass_dataset object with added MS2 data.
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,
)
object
dir.create("demo_data")
system.file("ms2_data", package = "metid")
file.copy(
file.path(
system.file("ms2_data", package = "massdataset"),
"QC_MS2_NCE25_1.mgf"
),
to = "demo_data",
overwrite = TRUE
)
object =
mutate_ms2(object = object,
column = "rp",
polarity = "positive")
object@ms2_data
} # }