- Introduced by
- Ian Holmes, Katie Harris, Christopher Quince (Dirichlet-Multinomial Mixture framework, 2012); broader Bayesian microbiome modeling community
- Year
- 2010s (Dirichlet-Multinomial approach formalized ~2012; extensions ongoing)
- Type
- Probabilistic/Bayesian pipeline for compositional count data
- Family
- Bioinformatics / omics
What does it do?
Bayesian microbiome diversity analysis fits probabilistic models, mainly Dirichlet-Multinomial and related hierarchical frameworks, to 16S rRNA or shotgun metagenomic count data.
It estimates alpha diversity (richness and evenness within a sample) and beta diversity (compositional differences between samples) as posterior distributions, so uncertainty is carried into the reported credible intervals. Unlike rarefaction-based workflows, the counts are modelled directly rather than subsampled to a common library size.
The intuition behind the method
Diversity indices such as Shannon entropy return one number per sample, but microbiome counts are sparse, compositional and generated at very different sequencing depths. A Bayesian analysis asks instead which range of true community compositions is consistent with the observed counts, given a prior. The Multinomial likelihood describes how reads are sampled from a community, and the Dirichlet prior is a natural choice for proportions that sum to one. Sampling from the posterior gives a distribution for each diversity metric, and groups can be compared by how far their posterior distributions overlap, without discarding reads to equalise depth.
History
Bayesian treatments of microbiome counts developed alongside the expansion of 16S rRNA sequencing. Dirichlet priors over multinomial mixtures were already used in text analysis, for example in Latent Dirichlet Allocation. Holmes, Harris and Quince (2012) adapted Dirichlet-Multinomial Mixtures to metagenomic community profiling. For comparison, La Rosa et al. (2012) addresses hypothesis testing and power calculations for taxonomic microbiome data, a different question from the Bayesian modelling described on this page. ALDEx2 is a differential-abundance method that uses Dirichlet Monte Carlo sampling with log-ratio transformation, and ANCOM-BC2 is a separate bias-corrected method usually classed as frequentist.
When to use it
Choose this approach when sample sizes are small to moderate and the uncertainty of diversity estimates matters for the conclusion; when library sizes differ strongly and discarding reads by rarefaction would be costly; when credible intervals are needed rather than p-values alone; when community types should be inferred with uncertainty on cluster membership; or when samples are longitudinal or nested within subjects, so that subject-level random effects are needed. Do not use standard Bayesian regression on raw counts, because it ignores the compositional constraint; use Dirichlet-based likelihoods or log-ratio transformations. It is a poor fit when computing time is severely limited or when a quick exploratory ordination of rarefied data is all that is needed.
Limitations and considerations
- Full MCMC over high-dimensional taxon vectors is computationally demanding, and run time grows with the number of samples and taxa, so pilot runs on a subset are advisable.
- Results depend on prior choices; in sparse, high-dimensional data a diffuse prior can still shape the posterior in ways that are hard to diagnose.
- There are fewer ready-made tools than in frequentist pipelines such as QIIME2 or mothur, and many analyses require custom Stan or R code.
- Credible intervals and Bayes factors require statistical literacy that many applied microbiome groups do not have, and posterior summaries are easy to misread.
- Upstream choices of denoising, clustering and reference database define the taxa the model sees; Bayesian modelling does not correct for them.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Diversity estimates come with posterior credible intervals, so the precision of each sample's estimate is visible rather than hidden behind a single value.
- Samples with different sequencing depths are modelled on their full counts, without subsampling to the smallest library.
- Dirichlet-Multinomial mixtures allow community types to be inferred with a posterior probability for each sample's cluster membership.
- Stan or brms models can include covariates, repeated measures and random effects, which suits longitudinal designs.
- Posterior inclusion probabilities give a probabilistic basis for flagging taxa, to be read together with effect sizes; the false-discovery behaviour of the chosen threshold should be checked for the specific dataset rather than assumed.
Applications
- Comparing gut microbiome alpha- and beta-diversity between disease cohorts (IBD, obesity, CRC) and healthy controls, with credible intervals on each estimate.
- Enterotype discovery: clustering shotgun metagenomics samples into latent community types with posterior uncertainty on cluster membership.
- Longitudinal microbiome studies tracking how diversity changes over time under diet, antibiotics or probiotics, using hierarchical models with subject-level random effects.
- Differential abundance analysis of taxa between treatment arms in clinical trials, with the posterior threshold chosen and reported by the analyst.
- Integrating phylogenetic information into regression models through PhILR-transformed responses fitted in a Bayesian framework.
- Estimating diversity in low-biomass samples (skin, lung, placenta), where uncertainty is high and rarefaction would discard most reads.
How it works
How it works
Raw reads are quality-filtered and denoised into amplicon sequence variants (ASVs) with tools such as DADA2 or Deblur, or clustered into OTUs at 97% identity. The result is a count table of samples by taxa. A phylogenetic tree is built when phylogenetic metrics such as Faith's PD or UniFrac are needed, and taxa are assigned against a reference database such as SILVA, Greengenes 2 or NCBI. Rarefaction is not performed, so all counts remain in the model.
A Dirichlet prior is placed on the vector of taxon proportions for each sample or group. A symmetric Dirichlet with small concentration is the uninformative option; informative hyperparameters can be drawn from reference microbiome distributions. In hierarchical Dirichlet-Multinomial Mixture (DMM) models, a Dirichlet process or finite mixture prior governs cluster membership across samples, which is how unsupervised community types (enterotypes) are discovered.
The joint posterior over taxon proportions, and over cluster assignments in mixture models, is approximated with Markov Chain Monte Carlo (MCMC) or variational inference. Implementations named here include the DirichletMultinomial R/Bioconductor package, PhILR transformations combined with Stan, and custom Stan or brms models. Convergence is checked with R-hat statistics and trace plots.
Each set of posterior draws of taxon proportions gives a value of every diversity metric, so Shannon entropy, richness and Faith's PD become posterior distributions for each sample. These are summarised as posterior means and 95% credible intervals. Beta diversity follows the same logic at the level of sample pairs: the dissimilarity between two samples, such as Bray-Curtis or UniFrac, is computed from each pair of posterior draws, so every pair receives its own posterior distribution, summarised by a mean and a 95% credible interval. Because these dissimilarities are non-linear functions of the proportions, their value at the posterior mean proportions generally differs from the posterior mean of the dissimilarity, and the latter is the quantity to report. For ordination or PERMANOVA-style comparisons, the posterior mean dissimilarity matrix can serve as input, with the per-pair credible intervals reported alongside, and the choice of aggregation should be stated. The Dirichlet posterior does not by itself remove depth effects: samples with fewer reads carry less information and therefore yield wider intervals, and any depth adjustment has to be specified in the model.
Group differences are assessed from the posterior distribution of the difference in a metric between conditions, for example treated versus control. Bayesian summaries of metric differences, such as a region of practical equivalence (ROPE) analysis or a Bayes factor, can complement rank-based tests such as the Wilcoxon test; they do not directly replace multivariate tests of community structure such as PERMANOVA. For differential abundance, log-ratio tools are used: ALDEx2 draws Monte Carlo samples from a Dirichlet model and applies a centred log-ratio transformation, while ANCOM-BC2 is a separate bias-corrected method usually classed as frequentist. Posterior inclusion probabilities from a fitted Bayesian model can be thresholded to flag taxa with credible differences. The threshold is an analyst's choice rather than a universal standard: it should be justified and reported, and the flagged taxa should be checked across a range of cut-offs to show how sensitive the result is.
Common pitfalls
- Ignoring the compositional nature of the data: placing a standard Gaussian prior on raw counts rather than on log-ratios or Dirichlet proportions produces posteriors that are hard to interpret, because microbial counts are relative rather than absolute.
- Using uninformative priors in very sparse datasets: when many taxa have zero counts across most samples, a symmetric Dirichlet prior with small concentration can dominate the posterior and inflate estimated richness; weakly informative or empirical priors are safer, with sensitivity checks.
- Conflating statistical and practical significance: in large cohorts the model can assign high posterior probability to very small compositional differences, so effect sizes (log-ratios, fold-changes) should be reported alongside credible intervals.
- Skipping convergence diagnostics: poorly mixed MCMC chains produce unreliable posteriors, so trace plots and R-hat values should be inspected before results are interpreted.
- Treating the analysis as a black box: automated DMM fits still require the analyst to choose the number of mixture components and to check that the discovered clusters are biologically coherent.
Frequently asked questions
Why not just rarefy and use the Shannon index as usual?
Rarefaction discards reads by subsampling every sample to the smallest library, which lowers precision. Dirichlet-Multinomial models use all counts and produce a posterior distribution over diversity, giving both an estimate and its uncertainty. For datasets with very unequal depths, the conclusions can differ substantially between the two approaches.
What software implements Bayesian microbiome diversity analysis?
The DirichletMultinomial Bioconductor package implements DMM clustering. ALDEx2 provides Dirichlet-based differential abundance analysis, and ANCOM-BC2 is a frequentist bias-corrected alternative. For custom models, Stan (through rstan or cmdstanr) combined with PhILR log-ratio transformations is the most flexible option. Check each package's documentation for its current feature set.
How do I choose the number of mixture components in DMM clustering?
Fit the DMM model across a range of component numbers, for example from 1 up to about 10, and compare the fits with an information criterion such as BIC or AIC, as reported by the DirichletMultinomial package. The Laplace approximation is a method for estimating model evidence and is not the same as BIC or AIC, so state explicitly which criterion was used. Verify that the clusters are biologically interpretable: enterotype labels should correspond to meaningful driver taxa such as Prevotella, Bacteroides or Ruminococcus rather than statistical artefacts.
Is Bayesian microbiome diversity analysis appropriate for very small studies (n < 10)?
Small studies can benefit from Bayesian analysis because the credible intervals are wide, which discourages overconfident conclusions. However, with very few samples the likelihood is weak and the prior has a large influence, so sensitivity analyses across prior choices are essential, and conclusions should be treated as preliminary pending replication.
How does this relate to compositional data analysis (CoDA)?
Bayesian microbiome diversity analysis and CoDA are complementary. CoDA establishes that microbiome data are compositional, since only relative abundances are observed, and prescribes log-ratio transformations before analysis. Bayesian Dirichlet-Multinomial models respect the compositional constraint at the likelihood level, while ALDEx2 combines Bayesian Monte Carlo sampling with centred log-ratio (CLR) transformation, bringing both frameworks together.
Related methods
Sources
Holmes, I., Harris, K., & Quince, C. (2012). Dirichlet Multinomial Mixtures: Generative Models for Microbial Metagenomics. PLOS ONE, 7(2), e30126.
Open publication referenceLa Rosa, P. S., Brooks, J. P., Deych, E., Boone, E. L., Edwards, D. J., Wang, Q., Sodergren, E., Weinstock, G., & Shannon, W. D. (2012). Hypothesis Testing and Power Calculations for Taxonomic-Based Human Microbiome Data. PLOS ONE, 7(12), e52078.
Open publication reference