Calculation of richness and turnover metrics
We calculated richness and turnover metrics using the phyloseqpackage’s data structure
(McMurdie
& Holmes 2013). We calculated species richness as the number of
unique ASVs per sample.
We used Bray-Curtis distances to quantify two aspects of compositional
variation. First, for each time series and for each time point, we
calculated dispersion as the pairwise Bray-Curtis distances between all
combinations of experimental replicates. For studies that resampled the
same experimental unit (e.g., host organism or microcosm) over time, we
excluded pairwise comparisons between samples from the same experimental
units. Second, to quantify turnover, we calculated pairwise distances
between all control samples (i.e., pre-disturbance) and all subsequent
replicate samples at each time point following disturbance. Communities
that largely recover to their pre-disturbance conformation will have a
negative slope through time, while communities that become increasingly
different from the pre-disturbance community over time will have a
positive slope estimate (Figure 1).
To disentangle compositional changes from changes in richness, we
randomly permuted abundance values within each sample 1000 times,
preserving the number of taxa and observations for each sample, and
recalculated turnover and dispersion metrics for each matrix to derive a
null expectation for each. For both metrics, Z-scores were calculated as\(\frac{observed-\mu^{\text{expected}}}{\sigma^{\text{expected}}}\).
We present analyses of the Z-scores in the main text, and analyses of
the raw compositional metrics (i.e., Bray-Curtis) in the Supplementary
Methods. All code for bioinformatics processing and null models is
available at https://github.com/drcarrot/DisturbanceSynthesis.