Learn R Programming

DirichletMultinomial (version 1.14.0)

dmngroup: Dirichlet-Multinomial generative classifiers.

Description

Fit Dirichlet-Multinomial generative classifiers to groups (rows) within a sample x taxon count matrix.

Usage

dmngroup(count, group, k, ..., simplify = TRUE, .lapply = parallel::mclapply)

Arguments

count
matrix() of sample x taxon counts.
group
factor() or vector to be coerced to a factor, with as many elements as there are rows in count, indicating the group to which the corresponding sample belongs.
k
integer(), the number(s) of Dirichlet components to fit.
...
Additional arguments, passed to dmn.
simplify
Return only the best-fit model for each group?
.lapply
An lapply-like function for application of group x k fits.

Value

An object of class dmngroup, a list of fitted models of class dmn. When simplify=TRUE, elements are named by the group to which they correspond.

Details

This function divided count into groups defined by group, creates all combinations of group x k, and evaluates each using dmn. When simplify=TRUE, the best (Laplace) fit is selected for each group.

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

dmn, DirichletMultinomial-package, vignette("DirichletMultinomial")

Examples

Run this code
## best fit for groups 'Lean' and 'Obese'; full example in vignette.
## Not run: bestgrp <- dmngroup(count, pheno, k=1:5, verbose=TRUE, 
#                     mc.preschedule=FALSE)
# ## End(Not run)
data(bestgrp)
bestgrp
bestgrp[["Obese"]]

Run the code above in your browser using DataLab