Closed Gronnesby closed 5 years ago
Nope, xcms
does not do any baseline correction (apart from the baseline estimation in centWave). It would also make more sense to have such a function/method in a lower level package (such as MSnbase
).
Unfortunately there is no such function available there (yet) - I've however spotted a baseline correction function in the MALDIquant
package, so eventually @sgibb could chime in here?
MALDIquant
offers 4 different baseline estimation/correction algorithms (but of course they were written/selected with MALDI in mind):
https://github.com/sgibb/MALDIquant/blob/99fe5a3f269881f7aac76acc70a6a17b4e767a98/R/estimateBaseline-functions.R#L13-L31
We could simply offer this functionality through MSnbase
as we have done with smoothing and peak detection. If you think it is useful I could do this.
BTW: there is also a baseline package on CRAN (but all its methods are written in R and most of them require a matrix with fixed mz values (= same mz for all spectra, which was useless in our MALDI experiments) and intensities). If there is a special algorithm of interest in this package we may need to reimplement it in C/Rcpp.
I don't really have a pressing need for a baseline correction method, I have been using AirPLS (https://github.com/zmzhang/airPLS) so far, which works quite well. It was more out of curiosity if XCMS implemented their own baseline correction method that I could compare to. Thanks for the clarification.
I can't seem to find any mention of baseline correction in the XCMS documentation.
I saw some mention of
centWave
performing baseline correction as part of peak detection (paper), but is there any way to explicitly calculate a baseline for a given spectra?