library("tima")
<- cbind(
sp_1 mz = c(10, 36, 63, 91, 93),
intensity = c(14, 15, 999, 650, 1)
)<- 123.4567
precursor_1 <- precursor_1 + 14
precursor_2 <- cbind(
sp_2 mz = c(10, 12, 50, 63, 105),
intensity = c(35, 5, 16, 999, 450)
)calculate_similarity(
method = "entropy",
query_spectrum = sp_1,
target_spectrum = sp_2,
query_precursor = precursor_1,
target_precursor = precursor_2,
dalton = 0.005,
ppm = 10.0
)
[1] 0.5427377
calculate_similarity(
method = "gnps",
query_spectrum = sp_1,
target_spectrum = sp_2,
query_precursor = precursor_1,
target_precursor = precursor_2,
dalton = 0.005,
ppm = 10.0,
return_matched_peaks = TRUE
)
$score
[1] 0.9923501
$matches
[1] 4