check_spectra {maldipickr} | R Documentation |
Evaluate the spectra regularities
Description
Assess whether all the spectra in the list are not empty, of the same length and correspond to profile data.
Usage
check_spectra(spectra_list, tolerance = sqrt(.Machine$double.eps))
Arguments
spectra_list |
A list of MALDIquant::MassSpectrum objects |
tolerance |
A numeric indicating the accepted tolerance to the spectra length. The default value is the machine numerical precision and is close to 1.5e-8. |
Value
A list of logical vectors of length spectra_list
indicating if the spectra are empty (is_empty
), of an odd length (is_outlier_length
) or not a profile spectra (is_not_regular
).
See Also
Examples
# 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)
# Display the list of checks, with FALSE where no anomaly is detected
check_spectra(spectra_list)
# The overall sanity can be checked with Reduce
Reduce(any, check_spectra(spectra_list)) # Should be FALSE
[Package maldipickr version 1.3.0 Index]