sgibb / MALDIquant

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

binPeaks tolerance documentation #56

Closed chasemc closed 6 years ago

chasemc commented 6 years ago

I think it would be helpful to explain that the tolerance in binPeaks() is ppm/10^6.

https://github.com/sgibb/MALDIquant/blob/0182f3e5a925ef8b633f14102571cdfd16024c40/man/binPeaks-functions.Rd#L21

chasemc commented 6 years ago

It might also be worth putting in a "ppm" parameter to binPeaks() that allows a user to input ppm as the tolerance value.

https://github.com/sgibb/MALDIquant/blob/ad7065e8601177033778e63b80e9a578369413ab/R/grouper-functions.R#L27

eg:

if(type="ppm"){
     any(abs(mass - meanMass) / meanMass * 10^6 > tolerance))
 }else{
     any(abs(mass - meanMass) / meanMass > tolerance))
}
sgibb commented 6 years ago

Ok, I can add something like:

  \item{tolerance}{
    \code{double}, maximal relative deviation of a peak position (mass) to be
    considered as identical. Must be multiplied by 10^-6 for ppm, e.g. use \code{tolerance=5e-6} for 5 ppm.
}

I am against an additional argument to binPeaks just for multiplying the tolerance by 10^-6. IMHO it will confuse more than it would help. We could argue about a ppm.tolerance argument that (if given) overwrites the tolerance argument but I don't think that this really improves the usability.

chasemc commented 6 years ago

That sounds great. I agree with you about not adding an additional argument, I think modifying the help file as you did will allow users to figure it out what tolerance is without digging into the source code. Thanks!