524D / compareMS2

Compare samples by MS2 spectra
MIT License
3 stars 0 forks source link

Add spectral angle (SA) metric for individual spectra comparisons #43

Closed magnuspalmblad closed 2 years ago

magnuspalmblad commented 2 years ago

Add spectral angle metric for individual spectra comparisons, according to

SA(a, b) = 1 - 2 [ acos( ab/|a||b| ) ] / π

as an alternate spectral comparison metric to compareMS2.

magnuspalmblad commented 2 years ago

Done (see my repo). However, the code could benefit from further testing and renaming a number of variables incorporating "dot product" in their name, to avoid future confusion.