This function extracts MS1-related data from a `mass_dataset` object, including MS2 spectrum ID, m/z, retention time (RT), file ID, and variable ID.

extract_ms1_info(object)

Arguments

object

A `mass_dataset` object containing MS2 data.

Value

A data frame containing the following columns:

ms2_spectrum_id

A combined ID made up of the MS2 data ID and spectrum ID.

mz

The m/z values for the corresponding MS2 spectra.

rt

The retention time (RT) values for the corresponding MS2 spectra.

ms2_files_id

The file ID associated with each MS2 spectrum.

variable_id

The variable ID for each MS2 spectrum.

Details

The function extracts MS1-related information from the MS2 data stored within a `mass_dataset` object. It combines the MS2 data ID and spectrum ID to create a unique `ms2_spectrum_id`, and returns the corresponding m/z, RT, file ID, and variable ID in a data frame.

Examples

if (FALSE) { # \dontrun{
# Load a sample mass dataset
my_dataset <- load_mass_dataset("path/to/dataset")

# Extract MS1 information
ms1_info <- extract_ms1_info(my_dataset)
head(ms1_info)
} # }