rformassspectrometry / Spectra

Low level infrastructure to handle MS spectra
https://rformassspectrometry.github.io/Spectra/
34 stars 24 forks source link

Warning issue of setBackend #217

Closed plantton closed 2 years ago

plantton commented 2 years ago

Example:

fls <- dir(system.file("sciex", package = "msdata"), full.names = TRUE)

sps <- Spectra(fls, backend = MsBackendDataFrame())
sps <- setBackend(sps, MsBackendMzR())
#> Error in .local(object, backend, ...): MsBackendDataFrame is read-only. Changing backend to a read-only backend is not supported.

It's more appropriate to say "MsBackendMzR is read-only". Just replace:
stop(backend_class, " is read-only. Changing backend to a ",

With

stop(class(backend), " is read-only. Changing backend to a ",
jorainer commented 2 years ago

Thanks for reporting! I've fixed this now in the devel and release branch.