Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Bonanza score to spectrum similarity calculation #124

Open
kozo2 opened this issue Mar 18, 2024 · 1 comment
Open

Adding Bonanza score to spectrum similarity calculation #124

kozo2 opened this issue Mar 18, 2024 · 1 comment

Comments

@kozo2
Copy link

kozo2 commented Mar 18, 2024

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 mimics Spectral_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.

@jorainer
Copy link
Member

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:

  • code to map/match peaks between the two spectra (based on ppm and tolerance).
  • code to calculate the similarity based on the m/z and intensity values of the matched spectra.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants