R/52_check_parameters_functions.R
check_mass_dataset.Rd
This function checks if the provided `mass_dataset` object is valid for metabolite annotation based on the specified criteria (`ms1`, `rt`, and/or `ms2`). It ensures that the object contains the necessary data for the chosen annotation method.
check_mass_dataset(object, based_on = c("ms1", "rt", "ms2"))
The function does not return a value but throws an error if any validation checks fail.
The function checks the following: * Ensures that `object` is a valid `mass_dataset` object. * If `"ms2"` is included in `based_on`, it checks that the `mass_dataset` object contains MS2 data (`object@ms2_data`). If no MS2 data is present, the function throws an error.
If any of these conditions are not met, the function will stop with an appropriate error message.
if (FALSE) { # \dontrun{
# Load a sample mass dataset
my_data <- load_mass_dataset("path/to/dataset")
# Validate the dataset for MS1 and MS2 information
check_mass_dataset(object = my_data, based_on = c("ms1", "ms2"))
} # }