I have run cgMLST on E. coli isolates, then i ran the resulting allele labels through the "daisy" function in R with the "gower" setting to generate a dissimilarity matrix.
I have subsets of isolates isolated from different sources. What I want to do is to compare two dissimilarity matrices and see if the isolates in matrix1 is more similar to themselves (i.e. less distance from one another) than the isolates in matrix2.In other words, I'd like to see if the distances in matrix 1 is closer to 0 or 1 than the other matrix.
However, since there are more isolates in matrix1 than matrix2, they are not of the same size, thus the mantel test does not work. Is there any way of doing a similar comparison for two matrices that aren't the same size?
Example data:
Matrix 1:
structure(c(0, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0, 0.8, 0.8, 0.8,
0.6, 0.8, 0.8, 0, 0.6, 0.6, 0.8, 0.8, 0.8, 0.6, 0, 0, 0.8, 0.8,
0.8, 0.6, 0, 0, 0.8, 0.8, 0.6, 0.8, 0.8, 0.8, 0), .Dim = c(6L,
6L), .Dimnames = list(c("1", "2", "3", "4", "5", "6"), c("1",
"2", "3", "4", "5", "6")))
Matrix 2:
structure(c(0, 0.2, 0.5, 0.9, 0.9, 0.2, 0, 0.5, 0.9, 0.9, 0.5,
0.5, 0, 0.9, 0.9, 0.9, 0.9, 0.9, 0, 0.8, 0.9, 0.9, 0.9, 0.8,
0), .Dim = c(5L, 5L), .Dimnames = list(c("1", "2", "3", "4",
"5"), c("1", "2", "3", "4", "5")))
It would be preferable if it was possible to do in R.