MMV-Lab / MSI-Explorer

BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Normalization #73

Closed nmmtsaw closed 1 year ago

nmmtsaw commented 1 year ago

Normalization should be done by (with the option of) this following methods. TIC – total ion current normalization RMS – root mean square normalization and Reference – normalize all spectra to a reference feature. TIC normalization is one of the most common normalization methods for mass spectrometry imaging. For comparison between datasets, TIC normalization requires that all spectra are the same length. RMS normalization is more appropriate when spectra are of different lengths. Normalization to a reference is the most reliable form of normalization, but is only possible when the experiment contains a known reference peak with a constant abundance throughout the dataset. This is often not possible in unsupervised and exploratory experiments. For the R functions and codes from Cardinal R package, please have a look on this one. https://github.com/kuwisdelu/Cardinal

lennartkowitz commented 1 year ago

I translated the functions from https://github.com/kuwisdelu/Cardinal/blob/master/R/process2-normalize.R#L56 onward into python (see Branch Iss73). Do you know what gets passed into each function, i.e. the whole set of spectra or are the calculations run for each spectrum individually?

nmmtsaw commented 1 year ago

I think the calculations run for each spectrum individually as they mentioned x is a numeric vector of intensities, and it should return a numeric vector of the same length.

lennartkowitz commented 1 year ago

Normalization should work now, how should the user be able to call it? We only have one button currently, should that run all the preprocessing steps at the same time?

nmmtsaw commented 1 year ago

Re-calibration and filtering can be optional to the user.