Apply the Mantel test to two distance matrices
Apply a two-sided Mantel test to identify correlation between two distance
matrices. Note: the directionality of the comparison has no bearing on the
results. Thus, comparing distance matrix X to distance matrix Y is
equivalent to comparing Y to X. Note: the order of samples within the two
distance matrices does not need to be the same; the distance matrices will
be reordered before applying the Mantel test. See the scikit-bio docs for
more details about the Mantel test: http://scikit-
bio.org/docs/latest/generated/generated/skbio.stats.distance.mantel.html
Parameters
- dm1 : DistanceMatrix
- Matrix of distances between pairs of samples.
- dm2 : DistanceMatrix
- Matrix of distances between pairs of samples.
- method : Str % Choices('spearman', 'pearson'), optional
- The correlation test to be applied in the Mantel test.
- permutations : Int % Range(0, None), optional
- The number of permutations to be run when computing p-values. Supplying
a value of zero will disable permutation testing and p-values will not
be calculated (this results in much quicker execution time if
p-values are not desired).
- intersect_ids : Bool, optional
- If supplied, IDs that are not found in both distance matrices will be
discarded before applying the Mantel test. Default behavior is to error
on any mismatched IDs.
- label1 : Str, optional
- Label for dm1 in the output visualization.
- label2 : Str, optional
- Label for dm2 in the output visualization.
Returns
visualization : Visualization