lgatto / MSnbase

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

possibility to use filterRt for multiple regions #540

Closed stanstrup closed 9 months ago

stanstrup commented 3 years ago

I am trying to speed up peak-picking parameter optimization of certain peaks by sub-setting the RT to where peaks have already been found. Right now I can only subset to one region (or further restrict that region).

Would it be possible to supply filterRt with a matrix of regions or alternatively have a "negative" removal filter where you select the regions to remove so that you can chop up the file to only interesting regions?

Or any other way to achieve it...

stanstrup commented 3 years ago

I guess filterAcquisitionNum can do it.

filterAcquisitionNum(OnDiskMSnExp, c(800L:820L , 880L:900L), 1)
lgatto commented 3 years ago

Yes, I think this is a sensible request. I am however not keen to do this in MSnbase right away, and would rather add this to Spectra and possibly port it to MSnbase. @jorainer, what do you think?

jorainer commented 3 years ago

Yes, that makes sense. @stanstrup , please open an issue in Spectra. Note also that the chromatogram function also has mz and rt parameters and in that we support passing two-column matrices with multiple ranges.