View source: R/contrastsTest.R
contrastsTest | R Documentation |
Identify differentially-abundant and differentially-variable taxa using contrasts
contrastsTest(
formula,
phi.formula,
contrasts_DA = NULL,
contrasts_DV = NULL,
data,
link = "logit",
phi.link = "logit",
sample_data = NULL,
taxa_are_rows = TRUE,
filter_discriminant = TRUE,
fdr_cutoff = 0.05,
fdr = "fdr",
inits = NULL,
try_only = NULL,
...
)
formula |
an object of class |
phi.formula |
an object of class |
contrasts_DA |
List. Optional. Constructs a contrast matrix. List elements should be characters specifying contrasts in the parameters within |
contrasts_DV |
List. Optional. Constructs a contrast matrix. List elements should be characters specifying contrasts in the parameters within |
data |
a data frame containing the OTU table, or |
link |
link function for abundance covariates, defaults to |
phi.link |
link function for dispersion covariates, defaults to |
sample_data |
Data frame or matrix. Defaults to |
taxa_are_rows |
Boolean. Optional. If |
filter_discriminant |
Boolean. Defaults to |
fdr_cutoff |
Integer. Defaults to |
fdr |
Character. Defaults to |
inits |
Optional initializations for model fit using |
try_only |
Optional numeric. Will try only the |
... |
Optional additional arguments for |
This function uses contrast matrices to test for differential abundance and differential variability using a Wald-type chi-squared test. To use a formula implementation, see differentialTest
.
An object of class contrastsTest
. List with elements p
containing the p-values for each contrast, p_fdr
containing the p-values after false discovery rate control, significant_taxa
containing the taxa names of the statistically significant taxa, contrasts_DA
containing the contrast matrix for parameters associated with the abundance, contrasts_DV
containing the contrast matrix for parameters associated with the dispersion, discriminant_taxa_DA
containing the taxa for which at least one covariate associated with the abundance was perfectly discriminant, discriminant_taxa_DV
containing the taxa for which at least one covariate associated with the dispersion was perfectly discriminant, and data
containing the data used to fit the models.
# data frame example
data(soil_phylum_contrasts_sample)
data(soil_phylum_contrasts_otu)
da_analysis <- contrastsTest(formula = ~ DayAmdmt,
phi.formula = ~ DayAmdmt,
contrasts_DA = list("DayAmdmt21 - DayAmdmt11",
"DayAmdmt22 - DayAmdmt21"),
data = soil_phylum_contrasts_otu,
sample_data = soil_phylum_contrasts_sample,
fdr_cutoff = 0.05,
try_only = 1:5)
# phyloseq example (only run if you have phyloseq installed)
## Not run:
contrasts_phylo <- phyloseq::phyloseq(phyloseq::sample_data(soil_phylum_contrasts_sample),
phyloseq::otu_table(soil_phylum_contrasts_otu, taxa_are_rows = TRUE))
da_analysis <- contrastsTest(formula = ~ DayAmdmt,
phi.formula = ~ DayAmdmt,
contrasts_DA = list("DayAmdmt21 - DayAmdmt11",
"DayAmdmt22 - DayAmdmt21"),
data = contrasts_phylo,
fdr_cutoff = 0.05,
try_only = 1:5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.