- Introduced by
- Developed iteratively through the microbiome research community; key contributions from Susan Holmes, Rob Knight, and colleagues
- Year
- 2010s (formalized with 16S amplicon sequencing era; expanded ~2012–2020)
- Type
- Longitudinal observational / bioinformatics pipeline
- Family
- Bioinformatics / omics
What does it do?
Time-series microbiome diversity analysis tracks how the richness, evenness, and community composition of microbial communities change across multiple time points within the same subjects.
By combining standard diversity metrics with longitudinal statistical models, it separates true temporal dynamics from inter-individual variation, and it identifies temporal associations between perturbations such as diet changes, antibiotic treatment, or disease onset and shifts in the microbiome.
The intuition behind the method
Think of the gut microbiome as a small ecosystem. A cross-sectional snapshot tells you who is there right now, but it cannot tell you whether the community is recovering, deteriorating, or oscillating. Time-series microbiome diversity analysis takes repeated snapshots from the same individuals over weeks or months, then asks: does richness decline after antibiotic exposure and, if so, does it recover? Does community composition drift steadily with aging or does it track seasonal diet shifts? Longitudinal models account for the fact that consecutive samples from one person are more similar to each other than to samples from another person, enabling sharper inference about genuine temporal effects than a naive comparison of time points could provide.
History
Repeated microbiome sampling became more common as 16S rRNA gene sequencing was widely adopted and cohort studies began following the same individuals over time. The specific origin of the longitudinal analysis approach described here is not documented in the sources available for this page, so no individual lab or project is credited. MaAsLin and its successor MaAsLin2 are tools used for multivariable association analysis of microbiome data; their release dates are not verified here.
When to use it
Use time-series microbiome diversity analysis when you have repeated microbiome samples from the same subjects over time and your research question concerns temporal dynamics — recovery after intervention, developmental trajectories, or disease progression. It is the appropriate design for intervention studies (antibiotic trials, dietary interventions, probiotic studies) and for understanding natural microbiome variability. Do NOT use it when samples are purely cross-sectional (single time point per subject); in that case standard microbiome diversity analysis or differential abundance testing without longitudinal modeling is sufficient. Avoid this pipeline when fewer than three time points per subject are available, as longitudinal models cannot reliably separate trajectory from noise with only two observations per person.
Limitations and considerations
- Requires sufficient time points per subject (typically at least three) to fit longitudinal models; fewer points reduce statistical power and model reliability.
- Subject attrition over time introduces missing data that must be handled carefully, as complete-case analysis biases results if dropout is non-random.
- Microbiome data are compositional and zero-inflated, so standard linear mixed models applied directly to raw counts are inappropriate; log-ratio transformations or count-based mixed models are necessary.
- Increased design complexity raises data collection costs and logistical burden compared to cross-sectional studies.
- Confounding from unmeasured time-varying covariates (diet, medication use, illness episodes) can obscure true temporal dynamics if not recorded alongside microbiome samples.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Accounts for within-subject correlation inherent in repeated-measures data, giving comparisons that treat time points as dependent rather than as independent samples.
- Separates individual baseline differences from temporal or treatment effects, which reduces confounding by stable between-person differences; it cannot remove confounding by unmeasured time-varying covariates.
- Captures dynamic processes such as recovery, cyclicity and drift that cross-sectional designs cannot detect.
- Compatible with standard microbiome data formats (16S OTU/ASV tables, shotgun metagenomic read tables) and with the analysis tools named in this page (QIIME2, R/phyloseq, MaAsLin2).
- Provides both community-level (beta-diversity trajectories) and taxon-level (mixed-effects differential abundance) inference in one workflow.
Applications
- Estimating how alpha diversity recovers within individuals after an antibiotic course, using subject-level random intercepts to separate each person's baseline from the treatment effect.
- Modelling how taxon abundances change across repeated stool samples in an infant cohort, with subject as a random effect.
- Testing whether a dietary fibre intervention shifts community composition during the intervention period and whether the shift persists afterwards, using beta-diversity trajectories and PERMANOVA with subject-level stratification.
- Comparing taxon-level trajectories between treatment and control arms of a probiotic study while controlling for within-subject correlation across sampling visits.
- Examining whether community composition returns to baseline after a perturbation, by comparing per-subject trajectories against the pre-intervention samples of the same individuals.
How it works
How it works
Raw sequencing reads are quality-filtered and denoised (for example with DADA2, or QIIME2 Deblur) to produce amplicon sequence variants (ASVs) or operational taxonomic units (OTUs). Library sizes usually differ between samples, so a normalisation step is needed before diversity is calculated. The choice between rarefaction and alternatives such as CSS is discussed under pitfalls.
Within-sample diversity is summarised per time point and per subject using indices such as Shannon entropy, Faith's phylogenetic diversity, and observed species richness. Trajectories of these indices over time are visualised and tested for trends with mixed-effects models that include subject as a random intercept, so that repeated samples from the same person are not treated as independent.
Between-sample dissimilarity matrices are computed using metrics such as Bray-Curtis dissimilarity or UniFrac distance. Ordination methods (PCoA, NMDS) visualise community-level trajectories. Permutational MANOVA (PERMANOVA) with subject-level stratification, or longitudinal extensions such as permutation of residuals, tests whether community composition differs between groups or time points. A significant PERMANOVA can reflect differences in multivariate dispersion between groups rather than in community location, so pair it with a dispersion test (such as betadisper). PERMANOVA tests group or time differences but does not estimate individual trajectories; use a mixed-model or permutation scheme for trajectory inference.
Subject-specific trajectories are modelled with linear mixed-effects models that include subject as a random effect, so each person's baseline and trajectory are estimated relative to the group. Generalised estimating equations (GEE) are an alternative that targets population-averaged effects through an assumed working correlation structure. Tools such as MaAsLin2 fit taxon-level abundance as a function of time and covariates and can include subject as a random effect.
Taxa that change over time or between treatment groups are identified while controlling for within-subject correlation. Methods such as MaAsLin2, ANCOM-BC2, or count-based mixed models are applied, chosen for the distributional properties of compositional count data. Taxon-level p-values are adjusted for multiple testing across taxa for each contrast (for example with the Benjamini–Hochberg false discovery rate), and the adjusted q-values are used as the decision threshold. Tools differ in whether they accept a random effect for subject: blocking factors in DESeq2 or edgeR enter as fixed effects, which handles pairing but does not model subject-level variation in the same way.
Statistically significant taxa and diversity shifts are placed in biological context by cross-referencing functional annotations (e.g., PICRUSt2 predicted pathways), known ecological roles, and clinical metadata. Results are reported as effect sizes with confidence intervals alongside trajectory plots to communicate both statistical and practical significance. Judge practical significance against a minimum meaningful change specified before analysis, not only against the adjusted significance threshold.
Common pitfalls
- Ignoring the repeated-measures structure by treating all samples as independent inflates degrees of freedom and produces anticonservative p-values; include subject as a random effect in the models.
- Rarefying to a low depth to make library sizes uniform can discard much of the data and reduce statistical power. For longitudinal analyses, use the same normalisation procedure across all time points; CSS, which was designed for sparse microbiome counts, is one option. TMM and DESeq2 size factors were developed for RNA-seq and do not correct for compositionality, so if they are used, pair them with a compositionally aware differential abundance method. If rarefaction is used, apply the same depth consistently across all time points.
- Applying differential abundance tools designed for independent samples (for example, DESeq2 without a subject term) to longitudinal data ignores within-subject correlation and can yield spurious findings.
- Conflating alpha diversity decline with community instability: a lower Shannon index can reflect loss of taxa or redistribution of abundances among taxa already present. Plotting taxon-level trajectories alongside alpha metrics helps distinguish these cases.
- Neglecting time-varying confounders (antibiotic co-medication, acute infections) when modelling trajectories; if these are not recorded at sampling, their adjustment after the fact is not possible.
Frequently asked questions
How many time points and subjects do I need?
Longitudinal trajectory models need several samples per subject; this page recommends at least three time points, since with fewer points trajectory and noise cannot be separated reliably. More time points improve the ability to detect non-linear dynamics. Power to detect community-level change depends on the expected effect size, the variance components, and the degree of within-subject correlation, and small cohorts generally have limited power for modest effects. A simulation-based power analysis at the design stage is advisable, as the number of subjects needed is not fixed by the method itself.
Should I rarefy my data before longitudinal analysis?
Rarefaction (subsampling to equal depth) equalises library sizes but discards data and adds variability from the random subsampling. For longitudinal studies, CSS (cumulative sum scaling) is one option that keeps all samples and was designed for sparse microbiome counts. TMM and DESeq2 size factors were developed for RNA-seq and do not address compositionality, so they are not a substitute for compositionally aware differential abundance methods. If rarefaction is used, justify the depth and apply it consistently across all time points.
What is the difference between alpha and beta diversity in this context?
Alpha diversity describes richness and evenness within a single sample. Longitudinal alpha diversity analysis tracks whether individual subjects become richer or more even over time. Beta diversity describes dissimilarity between samples; longitudinal beta-diversity analysis examines whether community composition trajectories cluster by time point, treatment group, or individual, showing whether community structure shifts directionally or returns toward baseline after a perturbation.
Can I use standard DESeq2 or edgeR for longitudinal differential abundance?
These tools were designed for comparisons between independent samples. They can be used on longitudinal data only if the design formula includes subject as a blocking factor, which enters as a fixed effect and does not model within-subject correlation in the same way as a random effect. Tools that accept a random effect for subject, such as MaAsLin2 (named on this page), or ANCOM-BC2 with random effects, are better suited to repeated-measures microbiome data.
How do I handle missing time points due to dropout?
Linear mixed-effects models and GEE can use data from subjects with different numbers of time points, provided the missingness is at random given the observed data; this assumption should be considered explicitly. If dropout is substantial, a sensitivity analysis comparing complete-case results with the full-data mixed-effects estimates is advisable to assess how robust the conclusions are.
Related methods
Sources
Callahan, B. J., McMurdie, P. J., Rosen, M. J., Han, A. W., Johnson, A. J. A., & Holmes, S. P. (2016). DADA2: High-resolution sample inference from Illumina amplicon data. Nature Methods, 13(7), 581–583.
Open DOI referenceChen, Y., Lun, A. T. L., & Smyth, G. K. (2023). Differential abundance testing on single-cell data using quasi-likelihood methods. Genome Biology, 24(1), 188.
Open publication reference