getPERMANOVA | R Documentation |
These functions perform PERMANOVA to assess the significance of group
differences based on a specified dissimilarity matrix. The results can be
returned directly or added to metadata in an object of class
TreeSummarizedExperiment
.
getPERMANOVA(x, ...)
addPERMANOVA(x, ...)
## S4 method for signature 'SingleCellExperiment'
getPERMANOVA(x, ...)
## S4 method for signature 'SummarizedExperiment'
getPERMANOVA(x, assay.type = "counts", formula = NULL, col.var = NULL, ...)
## S4 method for signature 'ANY'
getPERMANOVA(x, formula, data, method = "bray", test.homogeneity = TRUE, ...)
## S4 method for signature 'SummarizedExperiment'
addPERMANOVA(x, name = "permanova", ...)
x |
|
... |
additional arguments passed to
|
assay.type |
|
formula |
|
col.var |
|
data |
|
method |
|
test.homogeneity |
|
name |
|
PERMANOVA is a non-parametric method used to test whether the centroids of different groups (as defined by the formula or covariates) are significantly different in terms of multivariate space.
PERMANOVA relies on the assumption of group homogeneity, meaning the groups should be distinct and have similar variances within each group. This assumption is essential as PERMANOVA is sensitive to differences in within-group dispersion, which can otherwise confound results. This is why the functions return homogeneity test results by default.
The functions utilize vegan::adonis2
to compute
PERMANOVA. For homogeneity testing,
vegan::betadisper
along
with vegan::permutest
are utilized by default,
which allow testing for equal dispersion across groups and validate the
homogeneity assumption.
PERMANOVA and distance-based redundancy analysis (dbRDA) are closely related methods for analyzing multivariate data. PERMANOVA is non-parametric, making fewer assumptions about the data. In contrast, dbRDA assumes a linear relationship when constructing the ordination space, although it also employs a PERMANOVA-like approach to test the significance of predictors within this space. dbRDA offers a broader scope overall, as it provides visualization of the constrained ordination, which can reveal patterns and relationships. However, when the underlying data structure is non-linear, the results from the two methods can differ significantly due to dbRDA's reliance on linear assumptions.
getPERMANOVA
returns the PERMANOVA results or a list containing the
PERMANOVA results and homogeneity test results if
test.homogeneity = TRUE
. addPERMANOVA
adds these results to
metadata of x
.
For more details on the actual implementation see
vegan::adonis2
,
vegan::betadisper
, and
vegan::permutest
. See also
addCCA
and addRDA
data(GlobalPatterns)
tse <- GlobalPatterns
# Apply relative transformation
tse <- transformAssay(tse, method = "relabundance")
# Perform PERMANOVA
tse <- addPERMANOVA(
tse,
assay.type = "relabundance",
method = "bray",
formula = x ~ SampleType,
permutations = 99
)
# The results are stored to metadata
metadata(tse)[["permanova"]]
# Calculate dbRDA
rda_res <- getRDA(
tse, assay.type = "relabundance", method = "bray",
formula = x ~ SampleType, permutations = 99)
# Significance results are similar to PERMANOVA
attr(rda_res, "significance")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.