What is beta diversity?
In ecology, beta diversity is classically defined as the ratio between regional and local species diversity. Put simply, beta diversity captures how much microbial community composition varies across samples or cohorts, for example between gut samples from different people or body sites. It shows how the microbiome shifts across environments or conditions. Beta-diversity analysis measures this shift using distance metrics. Each metric takes two microbiome feature profiles (for example, the relative abundance profiles of two patient samples) and computes a single value whose magnitude reflects how far apart they are. Applied to every pair of samples in a cohort, the metric produces a matrix holding the distance between all possible pairs of profiles. In microbiome publications, beta-diversity results are most often presented as ordination plots. An ordination plot takes the matrix of pairwise distances and turns it into a map, where each sample is a point and the spacing between points reflects how different the samples are. Several ordination methods exist, each converting the distance matrix into coordinates in a slightly different way. Points in an ordination plot can then be annotated with colors and shapes. This makes it easy to see whether a variable, such as treatment, disease status, or body site, is associated with the differences between microbial communities.What’s the difference between alpha and beta diversity?Alpha diversity measures the diversity within a single sample, a quantitative way to describe how rich and varied the microbial community in that sample is. Each sample gets its own value, so you can compare communities the way you would compare any other measurement, for example pH or cell count.Beta diversity, by contrast, measures how different two microbial communities are, offering a way to compare complex microbial profiles. Imagine trying to compare two profiles, each with hundreds of taxa at different abundances, by reading down two columns of numbers. Beta diversity does that comparison for you and returns a single distance for every pair of samples. It calculates this difference using a range of metrics (e.g: Bray-Curtis, Jaccard, Aitchison), and the metric you choose determines which features carry the most weight in the comparison.
Why is it useful?
Beta-diversity analysis lets you see how different samples are from one another, and once the points are annotated with colors or shapes, whether those differences line up with a variable you are visualizing, such as treatment, disease status, body site, or time point. For biological discovery, it can separate conditions that look clinically similar but differ in community structure, track how far a community is pushed from baseline after a perturbation such as antibiotics and whether it recovers, judge intervention success such as a recipient community moving closer to its donor after a fecal transplant, or check whether samples from treatment responders and non-responders group apart. Beta diversity is also useful for quality control: it can flag outlier samples that may signal low sequencing depth or contamination, expose mislabeled samples when known-similar ones fail to group together, and reveal batch effects when samples cluster by sequencing run rather than by biology.How does it work?

Step 5. Ordination plot. The final output is an ordination plot, where each sample becomes one dot. Dots that sit close together have similar communities, and dots far apart are more different. The axes tell you how much of the variation the plot captures. You can then color or shape the dots by metadata, such as treatment or body site, to see whether a variable is associated with the differences between samples.
To run beta diversity in Cosmos-Hub 2.0, including the plots and tables it produces, how to read them, and the parameters you can tune, see Beta diversity on Cosmos-Hub 2.0.