Skip to main content
Topic: Formula for calculating spectral similarity and total score (Read 2379 times) previous topic - next topic

Formula for calculating spectral similarity and total score

Hi all,

We are interested in how exactly the spectral similarity and the total score is calculated in MSDial. In particular, It would be nice to have the exact calculation path (step-by-step including the values used) for the examples in the FAQ document
(MSDIAL FAQMat-vs2/ page 20 and 21; Link: prime.psc.riken.jp/compms/msdial/download/mathematics/MS-DIAL%20FAQ-vs2.pdf)
It is also unclear to us how the two formulas shown for "dot product" and "reverse dot product" on pages 20 and 21 are related. Do they calculate the same values?

Thank you very much for your help!
With kind regards
FalcoB

 

Re: Formula for calculating spectral similarity and total score

Reply #1
Dot product is straightforward matrix maths.
https://en.wikipedia.org/wiki/Dot_product

Frustratingly, in mass spec the dot product that is often applied is not this algorithm but an optimised, or weighted dot product. See Stein & Scott, 1994: Optimization and testing of mass spectral library search algorithms for compound identification.
https://www.sciencedirect.com/science/article/pii/1044030594870098

Bad jargon but more robust spectral matching.

Reverse dot product uses a reverse filter to only match peaks which are present in the library spectra. Search for the term here: http://www.bioconductor.org/packages/devel/bioc/vignettes/msPurity/inst/doc/msPurity-lcmsms-data-processing-and-spectral-matching-vignette.html
Quote:
"The reverse dot product cosine (rpdc) uses the same algorithm as dpc but all peaks that do not match in the query spectra (based on the alignment) are omitted from the calculation. This will improve scores when the query spectra is noisy but should be used with caution as it might lead to more false positives."

I have reached out to Hiroshi Tsugawa in the past to ask for specifics of the dot product algorithms that MS-DIAL uses. I haven't had a response.