Tutorials

Alpha and beta diversity in plain language

Alpha and beta diversity explained for microbiome studies: richness, evenness, Shannon and Simpson, Bray-Curtis, UniFrac, PCoA and PERMANOVA.

Microbiome papers are full of diversity numbers: Shannon indices, Bray-Curtis distances, PCoA plots, PERMANOVA p-values. The vocabulary can make a simple idea look complicated. Alpha diversity asks how much variation there is inside one sample. Beta diversity asks how different two samples are from each other. Almost everything else is a choice about how to measure those two things. This article explains the choices in plain language and points out where they mislead.

Alpha diversity: one sample at a time

Alpha diversity summarises a single community. It answers questions such as: how many taxa are present, how evenly are they represented, and how does this sample compare with others from the same group?

The answer depends on the measure, because "diversity" bundles two different properties. Richness is the number of distinct taxa. Evenness is how similar their abundances are. A sample with ten taxa at equal abundance and a sample with ten taxa where one dominates are equally rich but not equally diverse.

Richness, evenness and the common indices

Observed richness is simply the number of amplicon sequence variants or operational taxonomic units detected. It is easy to understand and strongly dependent on sequencing depth: sequence more, and you find more rare taxa.

Chao1 estimates the true richness by using the number of taxa seen once and twice. It tries to correct for the taxa you missed, and it is most useful when many rare taxa are present. It can be unstable when doubletons are scarce.

Shannon index combines richness and evenness. It is calculated from the proportional abundance of each taxon and increases when either more taxa are present or abundances are more even. It is sensitive to rare taxa and is probably the most reported alpha index in the literature.

Simpson index focuses on dominant taxa. In its common form it estimates the probability that two individuals drawn at random belong to the same taxon, so higher values mean lower diversity. The Gini-Simpson version, one minus that probability, reverses the direction and is easier to interpret.

Pielou evenness divides the Shannon index by the logarithm of richness, giving a value between zero and one. It is useful for separating evenness from richness, but it inherits the depth sensitivity of both inputs.

Whichever index you use, report the one you pre-specified rather than testing several and choosing the one that separates your groups; that is another form of multiple testing.

Sampling depth and rarefaction

Richness grows with the number of reads. A sample sequenced twice as deeply will usually appear more diverse even if the community is identical. Comparing raw richness across samples with different depths is therefore invalid.

Rarefaction addresses this by subsampling every sample to a common depth before computing diversity. It makes samples comparable at the cost of discarding reads from the deeper libraries. The choice of depth matters: too low and you lose real signal, too high and you drop samples that cannot reach it.

Coverage-based rarefaction equalises sample coverage instead of read counts. Coverage estimates how completely a community has been observed, so this approach often uses more of the data and is less arbitrary, but it needs more explanation in the methods.

Whatever you choose, report the depth, the number of samples excluded and whether any samples were dropped. A diversity comparison that silently excludes the weakest samples is not reproducible.

Beta diversity: comparing samples

Beta diversity is a distance, or dissimilarity, between two samples. Put all pairwise distances into a matrix and you have a complete description of how the samples relate. A distance of zero means identical communities by that measure. The absolute number matters less than the ordering, and different measures produce different orderings, so the choice must match the question.

Distance measures

Bray-Curtis compares abundance profiles. It is common, easy to explain, and sensitive to the dominant taxa. Two samples that share the same taxa in different proportions have a non-zero distance.

Jaccard compares presence and absence only. It asks how much of the combined taxon list the two samples share, ignoring abundance. It is useful when detection matters more than proportion, and it is less sensitive to sequencing depth than abundance-based measures, though not immune.

UniFrac uses a phylogenetic tree. Unweighted UniFrac counts the branch length unique to each sample, so it reflects which lineages are present. Weighted UniFrac also accounts for abundance, so it reflects how much of the community sits on each branch. UniFrac can detect differences that taxon-based measures miss, but it depends on the quality of the tree and is harder to explain to a non-specialist.

Aitchison distance is the Euclidean distance between centred log-ratio transformed values. It respects the compositional nature of amplicon data, where proportions sum to a fixed total and a change in one taxon necessarily changes the apparent abundance of others. Compositional data analysis is not universal in the field, but ignoring the constraint can produce spurious correlations. If you use Aitchison distances, say so and use tools designed for them.

Ordination: PCoA and NMDS

Ordination projects the distance matrix into two or three dimensions so you can look at it.

Principal coordinates analysis preserves the distances as well as possible and reports the percentage of variation explained by each axis. Those percentages are meaningful and should appear on the axis labels.

Non-metric multidimensional scaling preserves the rank order of distances rather than their exact values. It is flexible and often produces clearer separation, but the axes have no percentage and the stress value indicates how well the two-dimensional picture represents the full matrix. A high stress value means the plot is hiding structure, not that the groups are absent.

Neither method tests anything. A visual gap between groups is a hypothesis, not a result.

Testing group differences

PERMANOVA tests whether the centroids of groups differ in multivariate space. It partitions the distance matrix, computes a pseudo-F statistic and obtains a p-value by permutation. Report the R², which is the proportion of variation explained by the grouping variable, alongside the p-value. A significant result with a tiny R² means the group difference is real but explains little of the overall variation.

PERMANOVA assumes that groups have similar dispersion, meaning similar spread around their centroid. If one group is more variable than another, the test can be significant because of that difference rather than because the centroids differ. Run a dispersion test such as betadisper before interpreting a significant PERMANOVA, and report the result either way.

Reading a PCoA plot

Look at the axis percentages first. If the first two explain little, the plot is a slice of a more complex picture. Compare the spread within groups before the gaps between them: overlapping clusters may still differ statistically when the sample size is large and dispersion is small.

Do not draw ellipses that exclude inconvenient samples, and do not read an axis as a biological gradient without checking which taxa drive it. Colour by the variable you pre-specified, then by batch or extraction date to see whether the separation is technical. The 16S versus ITS guide explains why the marker and region affect these patterns.

Key points

  • Alpha diversity describes one sample; beta diversity describes the distance between samples.
  • Richness counts taxa, evenness describes how equal they are, and Shannon and Simpson combine both.
  • Shannon and Simpson combine richness and evenness, with different weightings of rare and dominant taxa.
  • Richness depends on sequencing depth; rarefy or use coverage-based methods before comparing samples.
  • Bray-Curtis uses abundance, Jaccard uses presence and absence, UniFrac uses phylogeny, and Aitchison respects compositionality.
  • PCoA preserves distances and reports axis percentages; NMDS preserves rank order and reports stress.
  • PERMANOVA tests group differences but can be confounded by unequal dispersion, so run a dispersion check.
  • Pre-specify the diversity measure and the distance rather than choosing the one that separates the groups.

When to ask for help

If your PCoA shows separation that disappears when you colour by extraction batch, or if a PERMANOVA result depends on which distance measure you choose, the next step is a careful look at the design and the data rather than another test. You can order an analysis or discuss the study through our microbiome and microbial genomics service. The free Microbiome workspace lets you compute diversity measures on a demo table, and the amplicon marker guide covers the upstream choices that shape the table.

Sources

When to ask for help. If your data or design do not fit a tutorial, order an analysis and we will reply with a fixed price.

Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.