tdepke / CluMSID

Clustering of MS² Spectra for Metabolite Identification
MIT License
10 stars 3 forks source link

distanceMatrix() #3

Open seb951 opened 5 years ago

seb951 commented 5 years ago

Hi,

it seems like the function distanceMatrix() calculates a distance that is equal to 1-cossim(). This is counter intuitive given that the distanceMatrix() documentations states distFun = "cossim", not distFun = "1 - cossim".

See this example:

load(file = system.file("extdata","annotatedSpeclist.RData",package = "CluMSIDdata"))

distmat = distanceMatrix(annotatedSpeclist[1:20])

distmat[1,2] == cossim(annotatedSpeclist[[1]],annotatedSpeclist[[2]])
[1] FALSE

distmat[1,2] == 1-cossim(annotatedSpeclist[[1]],annotatedSpeclist[[2]])
[1] TRUE]