DirichletMultinomial
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 1.54.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Depends: S4Vectors, IRanges
- Imports: BiocGenerics
- System requirements: gsl
- Install:
BiocManager::install("DirichletMultinomial")
When to Use
- Fitting Dirichlet-Multinomial models to microbial metagenomic count data using
dmn(). - Identifying the optimal number of Dirichlet components (clusters) by comparing
laplace(),AIC(), orBIC()scores. - Building generative classifiers for phenotypic groups using
dmngroup(). - Assigning new samples to classes using
predict().
When NOT to Use
- For continuous covariate modeling, use alternative regression frameworks because
dmngroup()is designed for discrete phenotypic categories (e.g., 'Lean', 'Obese').
Data Requirements
- A matrix of raw integer counts (samples in rows, taxa in columns).
- Phenotypic information as a factor for classification.
Key Parameters
- count (default): The matrix of samples by taxa counts provided to
dmn()ordmngroup(). - k (default): The number of Dirichlet components to model in
dmn()ordmngroup(). - assign (FALSE): Set to
TRUEinpredict()ormixture()to return the component/class with the maximum value. - scale (FALSE): Set to
TRUEinfitted()to scale the posterior mean difference by theta.
Best Practices
- Fit models across a range of components (e.g.,
k=1:7) and select the best fit usingwhich.min(lplc)on the Laplace scores. - Use
cvdmngroup()to perform cross-validation and assess classifier performance via ROC curves. - Use
heatmapdmn()to visualize samples arranged by their dominant Dirichlet component.
Common Pitfalls
- Cross-validation with
cvdmngroup()is computationally expensive; fix this by usingmc.preschedule=FALSEand running it on multiple cores via theparallelpackage. - Passing non-integer or normalized data to
dmn()violates the multinomial assumption; fix this by ensuring the input is a raw count matrix.
Alternatives
vegan: For standard distance-based clustering and ordination rather than generative mixture modeling.phyloseq: For general microbiome data manipulation and visualization.
Citations
- Holmes et al., 2012, PLoS ONE 7(2): 1-15. https://doi.org/10.1371/journal.pone.0030126
References
- Homepage: https://bioconductor.org/packages/DirichletMultinomial
- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/DirichletMultinomial/inst/doc/DirichletMultinomial.pdf
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use dirichletmultinomial. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.