# Original mass spectra of chlorine and methane
msp_objs <- list(
list(name = "Chlorine",
mz = c(34.96885, 36.96590, 69.93771, 71.93476, 73.93181),
intst = c(0.83 * c(100, 32), c(100, 63.99, 10.24))),
list(name = "Methane",
mz = c(10, 11, 12, 13, 14, 15, 16, 17, 18, 19),
intst = c(0, 0, 25, 75, 155, 830, 999, 10, 0, 0))
)
matrix(c(msp_objs[[1]]$mz, msp_objs[[1]]$intst), ncol = 2) # Chlorine
matrix(c(msp_objs[[2]]$mz, msp_objs[[2]]$intst), ncol = 2) # Methane
# Pre-processed mass spectra of chlorine and methane
pp_msp_objs <- PreprocessMassSpectra(msp_objs, remove_zeros = TRUE)
matrix(c(pp_msp_objs[[1]]$mz, pp_msp_objs[[1]]$intst), ncol = 2) # Chlorine
matrix(c(pp_msp_objs[[2]]$mz, pp_msp_objs[[2]]$intst), ncol = 2) # Methane
Run the code above in your browser using DataLab