rformassspectrometry / MetaboCoreUtils

Core utilities for metabolomics.
https://rformassspectrometry.github.io/MetaboCoreUtils/index.html
7 stars 6 forks source link

Add the matchSimilar function #6

Closed jorainer closed 4 years ago

jorainer commented 4 years ago

Add the package skeleton and the matchSimilar function along with documentation and unit tests.

michaelwitting commented 4 years ago

Only ppm matches or also allow absolute errors in Da?

jorainer commented 4 years ago

Also absolute errors. There is the parameter ppm for relative errors and the parameter tolerance for absolute errors.

michaelwitting commented 4 years ago

Okay. I have seen it now. It was just a bit confusing.

jorainer commented 4 years ago

If it's confusing you can request changes :) should I expand the documentation on that?

michaelwitting commented 4 years ago

No it is fine, now that I understand the logic behind it. Since the default for both values is 0 the user has to define only one and the other one will be 0... It is just interesting how we are thinking different about these things. I also had such a function, but the user had to define if he wants to use absolute or relative error. Your solution is much more elegant, fast and has less parameters

jorainer commented 4 years ago

In theory we could also drop the parameter ppm altogether, but then the user would have to use

matchSimilar(x, y, tolerance = ppm(x, 20)) to match with a ppm of 20 - I thought that is eventually a little too much to ask from a user :)

michaelwitting commented 4 years ago

Totally fine this way! Just have to make things clear in the vignette ;-)