R/gv_PERMANOVA.R
run_PERMANOVA.Rd
The run_PERMANOVA
function is used to identify the association between
the community and environmental variables.
run_PERMANOVA(
object,
level = c(NULL, "Kingdom", "Phylum", "Class",
"Order", "Family", "Genus",
"Species", "Strain", "unique"),
variables = "all",
method = c("unifrac", "wunifrac", "GUniFrac", "bray", "dpcoa", "jsd"),
mode = c("one", "all"),
seedNum = 123,
alpha = 0.5,
p_adjust = c("none", "fdr", "bonferroni", "holm",
"hochberg", "hommel", "BH", "BY"))
(Required). a phyloseq::phyloseq
or
SummarizedExperiment::SummarizedExperiment
object.
(Optional). character. Summarization
level (from rank_names(pseq)
, default: NULL).
(Optional). vector. variables for test (default: all).
(Optional). character. Provide one of the currently supported
options. See distanceMethodList
for a detailed list of the supported options
and links to accompanying documentation. Options include:
"bray": bray crutis distance.
"unifrac": unweighted UniFrac distance.
"wunifrac": weighted-UniFrac distance.
"GUniFrac": The variance-adjusted weighted UniFrac distances (default: alpha=0.5).
"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: "bray").
(Optional). character. Since there are missing values in some columns, providing two test model:
"one": test on one variable per time.
"all": test on all variables once. (default: "one").
(Optional). numeric. specify seeds for reproduction (default: 123).
(Optional). numeric. the parameter for "GUniFrac" controlling weight on abundant lineages (default: 0.5).
(Optional). character. method to adjust p-values by.
Options include "holm", "hochberg", "hommel",
"bonferroni", "BH", "BY", "fdr", "none". See stats::p.adjust()
for more details (default: "BH").
A data.frame of PERMANOVA result.
The run_PERMANOVA
function is used to identify the association between
the community and environmental variables, applying the distance in profile
and calculating the F statistic between community and variable by permutation
test to determine the significance. It can be applied to both
phyloseq::phyloseq
and SummarizedExperiment::SummarizedExperiment
object.
Anderson, Marti J. "Permutational multivariate analysis of variance."Department of Statistics, University of Auckland, Auckland 26 (2005): 32-46.
if (FALSE) {
# phyloseq object
data("Zeybel_2022_gut")
run_PERMANOVA(Zeybel_2022_gut,
variables = c("LiverFatClass", "Liver_fat", "Gender"),
mode = "one",
method = "bray")
# SummarizedExperiment object
data("Zeybel_2022_protein")
se_impute <- impute_abundance(
object = Zeybel_2022_protein,
group = "LiverFatClass",
ZerosAsNA = TRUE,
RemoveNA = TRUE,
cutoff = 20,
method = "knn")
run_PERMANOVA(se_impute,
variables = c("LiverFatClass", "Liver_fat"),
mode = "all",
method = "bray")
}