runNormalizations: runNormalizations

View source: R/runNormalizations.R

runNormalizationsR Documentation

runNormalizations

Description

Add normalization/scaling factors to a phyloseq object

Usage

runNormalizations(
  normalization_list,
  object,
  assay_name = "counts",
  verbose = TRUE
)

Arguments

normalization_list

a list object containing the normalization methods and their parameters.

object

a phyloseq or TreeSummarizedExperiment object.

assay_name

the name of the assay to extract from the TreeSummarizedExperiment object (default assayName = "counts"). Not used if the input object is a phyloseq.

verbose

an optional logical value. If TRUE, information about the steps of the algorithm is printed. Default verbose = TRUE.

Value

A phyloseq object containing the normalization/scaling factors.

See Also

setNormalizations

Examples

set.seed(1)
# Create a very simple phyloseq object
counts <- matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6)
metadata <- data.frame("Sample" = c("S1", "S2", "S3", "S4", "S5", "S6"),
                       "group" = as.factor(c("A", "A", "A", "B", "B", "B")))
ps <- phyloseq::phyloseq(phyloseq::otu_table(counts, taxa_are_rows = TRUE),
                         phyloseq::sample_data(metadata))

# Set some simple normalizations
my_normalizations <- setNormalizations()

# Add them to the phyloseq object
ps <- runNormalizations(normalization_list = my_normalizations, object = ps)

mcalgaro93/benchdamic documentation built on Sept. 26, 2024, 6:34 p.m.