fitHURDLE: fitHURDLE

View source: R/fitDistribution.R

fitHURDLER Documentation

fitHURDLE

Description

Fit a truncated gaussian hurdle model for each taxon of the count data. The hurdle model estimation procedure is performed by MAST zlm function without assuming the presence of any group in the samples (design matrix equal to a column of ones.)

Usage

fitHURDLE(object, assay_name = "counts", scale = "default", verbose = TRUE)

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

Character vector, either median or default to choose between the median of the library size or one million to scale raw counts.

verbose

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

Value

A data frame containing the continuity corrected logarithms of the average fitted values for each row of the matrix of counts in the Y column, and the estimated probability to observe a zero in the Y0 column.

Examples

# Generate some random counts
counts = matrix(rnbinom(n = 600, size = 3, prob = 0.5), nrow = 100, ncol = 6)

# Fit model on the counts matrix
HURDLE <- fitHURDLE(counts, scale = "median")
head(HURDLE)

mcalgaro93/benchdamic documentation built on Nov. 28, 2024, 2:16 p.m.