prepareObserved {benchdamic}R Documentation

prepareObserved

Description

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

Usage

prepareObserved(counts, scale = NULL)

Arguments

counts

a phyloseq object or a matrix of counts with features (OTUs, ASVs, genes) by row and samples by column.

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")

[Package benchdamic version 1.0.0 Index]