lgatto / MSnbase

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

Merging Individual Specta #570

Closed BadAtComputerGuy closed 2 years ago

BadAtComputerGuy commented 2 years ago

Hi all,

Sorry if this has been asked before, but I didn't find this question in the back log or bioconductor forums..

I am running a script in R which is meant to look for several individual spectra across a few result files which are of particular interest. So far I am able to find the spectra I want, load the mgf using your software, and pick out the individual spectra as a Spectrum2 object. I can also convert to an MSspectra object, which I understand to be the basic list data type for spectra.

However, I have struggled to find a way to compile many spectra into one object (list) as I loop over them. Is there a command for this I am missing? My goal is to have an object I can easily write out into a cumulative mgf.

Thanks for your time

jorainer commented 2 years ago

I would suggest to switch to the newer Spectra package. Support for import/export of mgf files is provided with the MsBackendMgf package. In particular, the vignette of the MsBackendMgf might be interesting for you as it should describe all the commands you would need for import and export of MGF files.

BadAtComputerGuy commented 2 years ago

Hi jorainer,

This was exactly what I needed, thanks so much for your work on these packages!

Best wishes