check_mass_dataset: Validate the mass_dataset Object for Metabolite Annotation

View source: R/52_check_parameters_functions.R

check_mass_datasetR Documentation

Validate the mass_dataset Object for Metabolite Annotation

Description

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.

Usage

check_mass_dataset(object, based_on = c("ms1", "rt", "ms2"))

Arguments

object

A 'mass_dataset' object containing MS1, RT, and/or MS2 data.

based_on

Character vector. Specifies the criteria to base the validation on. Can include '"ms1"', '"rt"', and '"ms2"'. Default is 'c("ms1", "rt", "ms2")'.

Details

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.

Value

The function does not return a value but throws an error if any validation checks fail.

Examples

## Not run: 
# 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"))

## End(Not run)



tidymass/metid documentation built on Oct. 8, 2024, 10:32 p.m.