This function extracts MS1 data (m/z and retention time) from a `databaseClass` object and returns it as a filtered data frame. It ensures that the m/z values are numeric and removes rows where the m/z values are missing (`NA`).

extract_ms1_database(database)

Arguments

database

A `databaseClass` object containing MS1 information in the `spectra.info` slot.

Value

A data frame with MS1 information, where the `mz` and `RT` columns are numeric and rows with missing (`NA`) m/z values are removed. If the input is not a `databaseClass` object, the function returns `NULL`.

Details

The function extracts the `spectra.info` slot from the `databaseClass` object, converts the `mz` and `RT` columns to numeric, and filters out rows with missing m/z values. This ensures that only valid MS1 data is returned.

Examples

if (FALSE) { # \dontrun{
# Load a sample database
my_database <- load_database("path/to/database")

# Extract MS1 data from the database
ms1_data <- extract_ms1_database(my_database)
head(ms1_data)
} # }