Closed jorainer closed 2 years ago
I like the idea! (and could implement that if you are not already planning to do it)
I wanted anyway to assign you to that issue @andreavicini ;)
But think also a bit about the naming of the parameter classes - maybe you could find better ones?
For the SelectedMatchesParam
, I think it would be better to call that SelectMatchesParam
(because the user selects the matches to filter manually). For the other TopRankedMatchesParam
(because the user wants to get the top ranked match(es) for multi-matches). But I'm not super happy with these names.
Currently
filterMatches
allows to filter aMatched
object keeping only selected elements which are specified with the additional parameters. I would suggest the following extension:generic
forfilterMatches
to include a second parameterparam
to the definition.param = "missing"
method that has the additional parameters as the original implementation.SelectedMatchesParam
(or maybe another name?) that contains all parameters from the originalfilterMatches
. This is the original filtering that allows users to select specific matches (identified by index or values) to keep or drop.This should allow us to perform also other types of filtering on a
Matched
object. Example: keep only the best match for query matching multiple targets. The param name could maybe beTopRankedMatchesParam
. The algorithm could rank matches based on their score(s) (decreasing or increasingly) and keep only the first n (withn = 1
by default). For matches with rt and m/z we could rank m/z and rt separately and then perform the final ranking on the product of the m/z and rt ranks.Any thoughts @michaelwitting @andreavicini ? Also open for suggestions of better param names.