run_MANTEL | R Documentation |
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)
object |
(Required). a |
level |
(Optional). character. Summarization
level (from |
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
|
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
|
seedNum |
(Optional). numeric. specify seeds for reproduction (default: 123). |
alpha |
(Optional). numeric. the parameter for "GUniFrac" controlling weight on abundant lineages (default: 0.5). |
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.
A Mantel test model.
Created by Hua Zou (5/15/2022 Shenzhen China)
Mantel, Nathan. "The detection of disease clustering and a generalized regression approach." Cancer research 27.2 Part 1 (1967): 209-220.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.