Closed jorainer closed 3 years ago
Internally compareSpectra
calls first the MAPFUN
(peak mapping) and subsequently the FUN
(similarity calculation) passing all additional parameters ...
to them. And that's where the error comes from: the MAPFUN = join
has a parameter type
so all works fine, but then the type = "inner"
is also passed to FUN = ndotproduct
which does not have a parameter type
.
What I would suggest is to add ...
to the function definition of both join
and ndotproduct
(and all other similarity calculation functions) to avoid this.
@lgatto @sgibb , any objections or better ideas (e.g. how to fix that already in Spectra
)?
Another solution I see would be to have two arguments, funargs = list()
and mapfunargs = list()
to set and pass the function respective arguments. The calls would them be do.call(FUN, args = funargs)
and do.call(MAPFUN, args = mapfunargs)
.
This would however make passing these extra arguments much more verbose and much less user-friendly. I prefer simply having ...
as you suggest.
This should be fixed with the updates we did in MsCoreUtils
version 1.1.5.
compareSpectra
withtype = "inner"
throws an error: