run_MANTEL: Mantel Test (MANTEL)

View source: R/gv_MANTEL.R

run_MANTELR Documentation

Mantel Test (MANTEL)

Description

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

Usage

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).

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.

Value

A Mantel test model.

Author(s)

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

References

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

Examples


## Not run: 
# 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"))

## End(Not run)


HuaZou/MicrobiomeAnalysis documentation built on May 13, 2024, 11:10 a.m.