Learn R Programming

maldipickr (version 1.3.1)

get_spectra_names: Extract spectra names and check for uniqueness

Description

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.

Usage

get_spectra_names(spectra_list)

Value

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

Arguments

spectra_list

A list of MALDIquant::MassSpectrum objects.

Examples

Run this code
# 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)])

Run the code above in your browser using DataLab