prepareObserved: prepareObserved

View source: R/GOF.R

prepareObservedR Documentation

prepareObserved

Description

Continuity corrected logarithms of the average counts and fraction of zeroes by feature.

Usage

prepareObserved(object, assay_name = "counts", scale = NULL)

Arguments

object

a phyloseq object, a TreeSummarizedExperiment object, or a matrix of counts.

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.

scale

If specified it refers to the character vector used in fitHURDLE function. Either median or default to choose between the median library size or one million as scaling factors for raw counts.

Value

A data frame containing the continuity corrected logarithm for the raw count mean values for each taxon of the matrix of counts in the Y column and the observed zero rate in the Y0 column. If scale is specified the continuity corrected logarithm for the mean CPM (scale = "default") or the mean counts per median library size (scale = "median") is computed instead.

See Also

meanDifferences

Examples

# Generate some random counts
counts <- matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6)

observed1 <- prepareObserved(counts)
# For the comparison with HURDLE model
observed2 <- prepareObserved(counts, scale = "median")

mcalgaro93/benchdamic documentation built on March 10, 2024, 10:40 p.m.