Finds the Jaccard similarity between rows of the two matricies. Note that the matrices must be binary, and any rows with zero total counts will result in an NaN entry that could cause problems in downstream analyses.
Jaccard(x, y)
x | The first matrix |
---|---|
y | The second matrix |
Returns a matrix
This will calculate the raw Jaccard index, without normalizing for the expected similarity between cells due to differences in sequencing depth.
#> [,1] [,2] [,3] [,4] [,5] #> [1,] 1.0000000 0.25 0.6666667 0.75 0 #> [2,] 0.2500000 1.00 0.0000000 0.20 0 #> [3,] 0.6666667 0.00 1.0000000 0.50 0 #> [4,] 0.7500000 0.20 0.5000000 1.00 0 #> [5,] 0.0000000 0.00 0.0000000 0.00 NaN