Open kozo2 opened 7 months ago
yes, you're right. we base the GNPS implementation on the same paper (Michael Witting got permission for that). Note that in MsCoreUtils/Spectra we split the spectra matching functionality into two parts:
ppm
and tolerance
).So, for the first part you could use/rely on the join
function. This is for example how compareSpectra
in the Spectra
works, we have parameter MAPFUN = joinPeaks
and FUN = ndotproduct
by default there, i.e. use join
for the matching and then the normalized dot product for the similarity calculation (see also compareSpectra).
Alternatively, as in the case of the entropy-based similarity scoring, where we use the functionality from the external entropy
package, it is also possible to perform both the peak matching and similarity scoring in the same functions (see here how that could be done). I would prefer the first approach, i.e. keeping the mapping and scoring separate.
I will add bonanza.R to https://github.com/rformassspectrometry/MsCoreUtils/tree/main/R . I will mimic
Spectral_Similarity_Algorithms.r
in https://doi.org/10.1021/acs.analchem.0c02521 (for the implementation). https://github.com/rformassspectrometry/MsCoreUtils/blob/main/R/gnps.R also mimicsSpectral_Similarity_Algorithms.r
https://github.com/rformassspectrometry/MsCoreUtils/blob/main/R/gnps.R#L75-L78 . I have obtained permission from its author, @Philipbear , to mimic it.