get_spectra_names {maldipickr} | R Documentation |
Given the list of raw spectra, get_spectra_names()
extracts the spectra names
using the file metadata, and warns if the associated sanitized names are not unique.
get_spectra_names(spectra_list)
spectra_list |
A list of MALDIquant::MassSpectrum objects. |
A tibble with four columns
sanitized_name
: spectra names based on fullName
where dots and dashes are converted to underscores
name
: spectra name using the name
label in the spectra metadata
fullName
: spectra full name using the fullName
label in the spectra metadata
file
: the path to the raw spectra data
# Get an example directory of six Bruker MALDI Biotyper spectra
directory_biotyper_spectra <- system.file(
"toy-species-spectra",
package = "maldipickr"
)
# Import the six spectra
spectra_list <- import_biotyper_spectra(directory_biotyper_spectra)
# Extract the names
get_spectra_names(spectra_list)
# Artificially create duplicated entries to show the warning
get_spectra_names(spectra_list[c(1,1)])