test_differential_prevalence: Differential prevalence testing

Description Usage Arguments Value Examples

View source: R/diff_tests.R

Description

Perform differential prevalence test on individual taxa in a phylseq object. If block is specified, then Cochran-Mantel-Haenszel test is used. If block is NULL, then Fisher's exact test is used.

Usage

1
2
test_differential_prevalence(physeq, group, compare = NULL, block = NULL,
  p.adjust.method = "fdr", minCount = 0L)

Arguments

physeq

Phyloseq object.

group

Name of column in sample metadata to perform group-wise comparisons on.

compare

List of 2 groups to be compared, which are present in the group column. Can be ignored or set to NULL when there are only 2 levels in the factor.

block

Name of column in sample metadata to control for the group-wise comparisons.

p.adjust.method

Method for adjusting P-values for multiple hypothesis testing.

minCount

Minimal threshold for a taxon to be considered present in a sample. Note: the check is count > minCount to distinguish zero from non-zero.

Value

Returns a list containing the following:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

# If there are only 2 levels for \code{Diet}
res <- test_differential_prevalence(physeq, group = "Diet", block = "Gender")

# If there are multiple levels for \code{Diet}
res <- test_differential_prevalence(physeq, group = "Diet", compare=c("Control", "High_Fat"), block = "Gender")
res <- test_differential_prevalence(physeq, group = "Diet", compare=c("Control", "High_Fibre"), block = "Gender")

## End(Not run)

TBrach/MicrobiomeX documentation built on April 19, 2018, 12:25 a.m.