extract_ms1_database | R Documentation |
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)
database |
A 'databaseClass' object containing MS1 information in the 'spectra.info' slot. |
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.
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'.
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.