Normalizes count data in a phyloseq object, first by adding a pseudocount (+1), then transforming to relative abundances, then by normalizes via the Box-Cox transformation in the car package.

normalize_for_heritability(ps, covariates = c(),
  normalization_plots = FALSE, verbose = TRUE)

Arguments

ps

A phyloseq object that contains sample_data().

covariates

A vector of covariates found in sample_data. Defaults to `x ~ 1`.

normalization_plots

Logical. If TRUE, creates a directory and saves plots of ASV distributions pre- and post-normalization. Defaults to FALSE.

verbose

Logical. If FALSE, messages will be supressed.

Value

This function returns the input phyloseq object with the otu_table() counts normalized.

Examples

ps <- normalize_for_heritability(ps, covariates = c("Plate", "Age", "Sex"), normalization_plots = TRUE)
#> Error in normalize_for_heritability(ps, covariates = c("Plate", "Age", "Sex"), normalization_plots = TRUE): object 'ps' not found