fitNB {benchdamic} | R Documentation |
Fit a Negative Binomial (NB) distribution for each taxon of the count data.
The NB estimation procedure is performed by edgeR glmFit
function, using TMM
normalized counts, tag-wise dispersion estimation,
and not assuming the presence of any group in the samples (design matrix
equal to a column of ones.)
fitNB(counts, verbose = TRUE)
counts |
a phyloseq object or a matrix of counts with features (OTUs, ASVs, genes) by row and samples by column. |
verbose |
an optional logical value. If |
A data frame containing the continuity corrected logarithms of the average fitted values for each row of the 'counts' matrix in the 'Y' column, and the estimated probability to observe a zero in the 'Y0' column.
# Generate some random counts counts = matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6) # Fit model on the matrix of counts NB <- fitNB(counts) head(NB)