dmn: Fit Dirichlet-Multinomial models to count data.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/dmn.R

Description

Fit Dirichlet-Multinomial models to a sample x taxon count matrix.

Usage

1
dmn(count, k, verbose = FALSE, seed = runif(1, 0, .Machine$integer.max))

Arguments

count

matrix() of sample x taxon counts.

k

integer(1), the number of Dirichlet components to fit.

verbose

logical(1) indicating whether progress in fit should be reported.

seed

numeric(1) random number seed.

Details

This implements Dirichlet-multinomial mixture models describe in the package help page, DirichletMultinomial-package.

Value

An object of class dmn, with elements (elements are usually retrieved via functions defined in the package, not directly).

GoodnessOfFit

NLE, LogDet, Laplace, AIC, and BIC criteria assessing goodness-of-fit.

Group

matrix of dimension samples x k, providing the Dirichlet parameter vectors.

Mixture
Weight

numeric() of length k, with relative weight of each component.

Fit
Lower

matrix() of dimension taxa x k with 95% lower bounds on Dirichlet component vector estimates.

Estimate

matrix() of dimension taxa x k with Dirichlet component vector estimates.

Upper

matrix() of dimension taxa x k with 95% upper bounds on Dirichlet component vector estimates.

Author(s)

Martin Morgan mailto:mtmorgan@fhcrc.org

References

Holmes I, Harris K, Quince C, 2012 Dirichlet Multinomial Mixtures: Generative Models for Microbial Metagenomics. PLoS ONE 7(2): e30126. doi:10.1371/journal.pone.0030126.

See Also

DirichletMultinomial-package, vignette("DirichletMultinomial")

Examples

1
2
3
4
5
data(fit)
## k = 1:7; full example in vignette
lplc <- sapply(fit, laplace)
plot(lplc, type="b")
fit[[which.min(lplc)]]

Example output

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min


Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: IRanges
class: DMN 
k: 4 
samples x taxa: 278 x 130 
Laplace: 38781.1 BIC: 40425.31 AIC: 39476.69 

DirichletMultinomial documentation built on Nov. 8, 2020, 7 p.m.