lgatto / MSnbase

Base Classes and Functions for Mass Spectrometry and Proteomics
http://lgatto.github.io/MSnbase/
123 stars 50 forks source link

Coerce Spectra to MSnExp #526

Closed lgatto closed 3 years ago

lgatto commented 3 years ago

This seem not to be possible with the new Spectra from the Spectra package.

> as(spectras, "MSnExp")

Fejl i as(spectras, "MSnExp") : 
  no method or default for coercing "Spectra" to "MSnExp"

Originally posted by @stanstrup in https://github.com/lgatto/MSnbase/issues/508#issuecomment-701261318

lgatto commented 3 years ago

I think I understand what is happening here. The Spectra mentioned in that post isn't the class defined in the new Spectra package, but a first iteration thereof in the MSnbase package (that eventually triggered the development of new packages and the R for Mass Spectrometry initiative.

That class in MSnbase has been renamed MSpectra (see this commit). Sorry for the confusion.

lgatto commented 3 years ago

Closing now, but @stanstrup feel free to follow up.

stanstrup commented 3 years ago

Isn't it still relevant? Or should there be another route to be able to make an mgf from a Spectra object?

lgatto commented 3 years ago

Another question is whether we want to be able to coerce MSnbase::MSnExp to Spectra::Spectra. Possible, but probably not a priority.

stanstrup commented 3 years ago

Ah, yes, right. Then we are back to whether or not that is currently working as intended https://github.com/rformassspectrometry/MsBackendMgf/issues/4

lgatto commented 3 years ago

ok, thanks.