The run_MANTEL function is used to identify the association between the community and environmental variables.

run_MANTEL(
   object,
   level = c(NULL, "Kingdom", "Phylum", "Class",
           "Order", "Family", "Genus",
           "Species", "Strain", "unique"),
   y_variables,
   z_variables = NULL,
   norm = c(TRUE, FALSE),
   method = c("mantel", "mantel.partial", "mantel.randtest", "mantel.rtest"),
   method_cor = c("pearson", "spearman", "kendall"),
   method_dist = c("bray", "euclidean", "jaccard"),
   seedNum = 123,
   alpha = 0.5)

Arguments

object

(Required). a phyloseq::phyloseq or SummarizedExperiment::SummarizedExperiment object.

level

(Optional). character. Summarization level (from rank_names(pseq), default: NULL).

y_variables

(Required). vector. variables for a control matrix Y.

z_variables

(Optional). vector. variables for a control matrix Z (default: NULL).

norm

(Optional). logical. whether to norm y and z matrix into unit by scale (default: TRUE).

method

(Required). character. Mantel test method, "mantel" or "mantel.partial" or "mantel.randtest", "mantel.rtest" (default: "mantel").

method_cor

(Optional). character. Correlation method, as accepted by cor: "pearson", "spearman" or "kendall" (default: "spearman").

method_dist

(Required). character. methods for three(X, Y, Z matrix) distance matrices. Provide one of the currently supported options. See distanceMethodList for a detailed list of the supported options and links to accompanying documentation. Options include:

  • "unifrac" : unweighted UniFrac distance.

  • "wunifrac": weighted-UniFrac distance.

  • "GUniFrac": The variance-adjusted weighted UniFrac distances (default: alpha=0.5).

  • "bray": bray crutis distance.

  • "dpcoa": sample-wise distance used in Double Principle Coordinate Analysis.

  • "jsd": Jensen-Shannon Divergence. Alternatively, you can provide a character string that defines a custom distance method, if it has the form described in designdist (default: c("bray", "euclidean", "jaccard")).

seedNum

(Optional). numeric. specify seeds for reproduction (default: 123).

alpha

(Optional). numeric. the parameter for "GUniFrac" controlling weight on abundant lineages (default: 0.5).

Value

A Mantel test model.

Details

The run_MANTEL function is used to test the correlation between two distance matrices, calculating the Z statistic between community distance and variables distance to determine the significance. While the Mantel test is used to compare between two distance (dissimilarity) matrices, such as X and Y, the partial Mantel test is used to estimate the correlation between these two matrices, while controlling for the effect of a control matrix Z. It can be applied to both phyloseq::phyloseq and SummarizedExperiment::SummarizedExperiment object.

References

Mantel, Nathan. "The detection of disease clustering and a generalized regression approach." Cancer research 27.2 Part 1 (1967): 209-220.

Author

Created by Hua Zou (5/15/2022 Shenzhen China)

Examples


if (FALSE) {
# phyloseq object
data("Zeybel_2022_gut")
run_MANTEL(Zeybel_2022_gut,
          y_variables = c("LiverFatClass", "Liver_fat"),
          z_variables = c("Gender", "Age"),
          norm = FALSE,
          method = "mantel.partial",
          method_dist = c("bray", "euclidean", "jaccard"))

# SummarizedExperiment object
data("Zeybel_2022_protein")
run_MANTEL(Zeybel_2022_protein,
          y_variables = c("LiverFatClass", "Liver_fat"),
          z_variables = c("Gender", "Age"),
          norm = FALSE,
          method = "mantel.partial",
          method_dist = c("bray", "euclidean", "jaccard"))
}