sgibb / MALDIquant

Quantitative Analysis of Mass Spectrometry Data
https://strimmerlab.github.io/software/maldiquant/
60 stars 25 forks source link

One more thought on the average smoothing #55

Closed SiggiSmara closed 6 years ago

SiggiSmara commented 6 years ago

I'm not entirely sure if this is something worth pursuing so I put it forth as an idea for discussion. I can see if I can free up some time to implement it and make a pull request if this is deemed worth the effort it takes. Theoretically it shouldn't take long to do.

So the thought is that both the equal weight averaging and the weighted average I implemented are both special cases of 1/n^i weighting where n is either 1 (equal weight) or 2 (current weighted average) and i is as implemented in the weighted average, i.e. the array distance from the center.

There is nothing that says that these have to be the only two cases and a more general case can be implemented with a default value of n = 1 and then users can can give it other values to have weighted averaging instead of having a true/false value of weighted average.

One argument for having higher n as an option would be that n = 2 gives a pseudo lorentzian averaging with wider tails compared to a gaussian with the same assumed fwhm and in some cases a better fit would be n=3 or higher, depending on the data at hand, in theory n doesn't have to be an integer either.

And an argument against would be that this just complicates things and makes the function less understandable for the average user.

Any thoughts?

sgibb commented 6 years ago

In principle I like that idea but I am afraid that "this just complicates things and makes the function less understandable for the average user". If you find a good way to offer this flexibility to the user I am happy to accept a PR.

SiggiSmara commented 6 years ago

I'll think on it some more, but I fear that it is not going to be so simple to explain the functionality to the users. Thanks for the input @sgibb. I close it for now. If I come up with something I'll mention this issue in the pull request.