I'm looking for some statistical advice on the following problem. I speak python and R.
I have two sets of data. These are matrices of the form: samples as rows, features as columns. They are supposed to represent data on the same entities (samples). All variables in either matrix are supposed to be distributed in the same way, and are all counts (non-negative). There are lots of zeros in the matrices, about 95% of all values.
So something like:
feature0 feature1 feature2 feature3 sample0 0 0 1 0 sample1 0 0 26 0 sample2 1 0 175 0 sample3 0 0 14 0 sample4 0 0 20 0 sample5 0 0 1 0 sample6 10 2 24 0 sample7 1 0 3 0 sample8 0 0 6 0 sample9 0 0 0 0
Now, I would like to compute many different pairwise relationships between samples: these may be correlations, distances, or other (dis)similarity metrics.
I would like to be able to compare each of those resulting, hm, 'pairwise relationship' matrices to each other and be able to tell which of them are different and which are the same with respect to sample relationships. So I assume I'd need a measure of similarity, and then perform permutation test to assess its significance. How can I do this?
I know I could do this with Mantel test, but the python implementation wants the matrices to be symmetrical - no problem - and have zeros along diagonals, which is not the case for some of those metrics. Can I transform a similarity matrix safely? Perhaps subtract each value in matrix from the maximum value of similarity per sample, which should be the diagonal values? What about measures like mutual information, that aren't bound to intervals (this post's answer isn't very informative: How to make normalised mutual information be range from 0 to 1). I also worry that transforming the values may make it trickier to interpret the results due to the sparsity of original data.
Another option I found was to compare hierarchical clustering results using cophenetic correlation coefficient. But I'm not sure whether I can use it with two different count (input) matrices, and, again, it needs distances. And anyhow, I would prefer not to add unnecessary complexity.
I'd be grateful for any advice or criticism!