lgatto / MSnbase

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

recalibration #552

Open ricoderks opened 3 years ago

ricoderks commented 3 years ago

Hi,

I would like to modify the m/z values in an OnDiskMSnExp for recalibration purposes, but I can not figure out how to modify the m/z values. Do I need to use ProcessingStep for this? Can you push me into the right direction?

Cheers, Rico

lgatto commented 3 years ago

The on-disk back-end is write only. You thus either load/convert the data into an in-memory object, or indeed, add the processing step to the processing queue and (I think) the processing will be applied after reading and before writing. But @jorainer would need to confirm.

More generally, I would suggest you move to the new Spectra infrastructure. You should be able to do everything you can do with MSnbase, as well as more.

ricoderks commented 3 years ago

Ok, thanks. I'll have a look at Spectra.

jorainer commented 3 years ago

So, basically to read mzML files you would do:

sps <- Spectra(<mzML files>, MsBackendMzR())
## Then do something with the spectra data

## Export the data again to mzML files
export(MsBackendMzR(), sps, file = <new file name>)

Feel free to open issues in Spectra if something is not working or if you need help/new features.

ricoderks commented 3 years ago

I just installed and will try it immediately :+1: