Skip to contents

Alpha Diversity

Calculate within-sample diversity using various indices.

alpha_div()
Alpha Diversity Wrapper Function

Richness metrics

Estimators focused on the number of species (richness).

ace()
Abundance-based Coverage Estimator (ACE)
chao1()
Chao1 Richness Estimator
margalef()
Margalef's Richness Index
menhinick()
Menhinick's Richness Index
observed()
Observed Features
squares()
Squares Richness Estimator

Diversity metrics

Indices accounting for both richness and evenness.

brillouin()
Brillouin Index
fisher()
Fisher's Alpha
inv_simpson()
Inverse Simpson Index
shannon()
Shannon Diversity Index
simpson()
Gini-Simpson Index

Dominance metrics

Indices focused on the abundance of the most dominant species.

berger()
Berger-Parker Index
mcintosh()
McIntosh Index

Phylogenetic metrics

Diversity based on phylogenetic branch lengths.

faith()
Faith's Phylogenetic Diversity (PD)

Beta Diversity

Calculate between-sample similarity or distance.

beta_div()
Beta Diversity Wrapper Function

Abundance metrics

Distance measures using quantitative abundance data.

aitchison()
Aitchison distance
bhattacharyya()
Bhattacharyya distance
bray()
Bray-Curtis dissimilarity
canberra()
Canberra distance
chebyshev()
Chebyshev distance
chord()
Chord distance
clark()
Clark's divergence distance
divergence()
Divergence
euclidean()
Euclidean distance
gower()
Gower distance
hellinger()
Hellinger distance
horn()
Horn-Morisita dissimilarity
jensen()
Jensen-Shannon distance
jsd()
Jensen-Shannon divergence (JSD)
lorentzian()
Lorentzian distance
manhattan()
Manhattan distance
matusita()
Matusita distance
minkowski()
Minkowski distance
morisita()
Morisita dissimilarity
motyka()
Motyka dissimilarity
psym_chisq()
Probabilistic Symmetric Chi-Squared distance
robust_aitchison()
Robust Aitchison distance
soergel()
Soergel distance
squared_chisq()
Squared Chi-Squared distance
squared_chord()
Squared Chord distance
squared_euclidean()
Squared Euclidean distance
topsoe()
Topsoe distance
wave_hedges()
Wave Hedges distance

Presence/Absence metrics

Distance measures using binary (presence/absence) data.

hamming()
Hamming distance
jaccard()
Jaccard distance
ochiai()
Otsuka-Ochiai dissimilarity
sorensen()
Dice-Sorensen dissimilarity

Phylogenetic metrics

Distance measures based on phylogenetic branch lengths (the UniFrac family, and the compositional PhILR distance).

unweighted_unifrac()
Unweighted UniFrac
weighted_unifrac()
Weighted UniFrac
normalized_unifrac()
Normalized Weighted UniFrac
generalized_unifrac()
Generalized UniFrac (GUniFrac)
variance_adjusted_unifrac()
Variance-Adjusted Weighted UniFrac
philr_distance()
PhILR Distance

Compositional Data

Log ratios for relative abundances. The centered log ratios (clr and rclr) are norm choices; see normalize().

Zeros

Replace zeros before taking log ratios, instead of adding a pseudocount. replace_zeros() runs any method by name.

replace_zeros()
Zero Replacement
replace_zeros_mult()
Multiplicative Zero Replacement
list_zero_replacements() match_zero_replacement()
Find and Browse Zero Replacement Methods

Log-ratio transforms

Coordinates for analyses of the transformed features themselves. For distances, use aitchison().

alr()
Additive Log-Ratio Transform
ilr()
Isometric Log-Ratio Transform
philr()
Phylogenetic Isometric Log-Ratio Transform (PhILR)

Log ratios

One log ratio per sample, between two groups of features, to use as a variable in tests and models.

log_ratio()
Log Ratio of Summed Abundances
balance()
Isometric Log-Ratio Balance

Proportionality

Which features keep a constant ratio across samples, the compositionally valid alternative to correlation. A dist over the features.

vlr()
Variance of Log Ratios
rho_p()
Proportionality Correlation
phi_s()
Symmetric Proportionality

Associations and networks

Correlations between features’ absolute abundances, estimated from relative abundances (a dist over the features), the pairs above a cutoff, and the networks they make. feature_assoc() runs any association measure by name.

sparcc()
SparCC Correlation
feature_assoc()
Associations Between Features
list_feature_assocs() match_feature_assoc()
Find and Browse Association Measures
assoc_pairs()
Strongly Associated Pairs of Features
assoc_network()
Association Network
assoc_network_compare()
Compare Two Association Networks
assoc_network_diff()
Differential Associations

Differential abundance

Which features’ abundances differ between groups. da_test() runs any method by name; the classical per-feature tests compare normalized values, the others log ratios or clr values, so that the samples’ totals don’t matter.

da_test()
Differential Abundance Testing
list_da_tests() match_da_test()
Find and Browse Differential Abundance Methods
da_sensitivity()
Sensitivity of a Differential Abundance Analysis
ancom()
Analysis of Composition of Microbiomes (ANCOM)
ancombc() ancombc2()
Analysis of Compositions of Microbiomes with Bias Correction (ANCOM-BC)
ancombc_global() ancombc_pairwise() ancombc_dunnett() ancombc_trend()
Post-hoc tests for ANCOM-BC and ANCOM-BC2
structural_zeros()
Structural zeros
dirmult_ttest()
Dirichlet-multinomial Welch t-tests (ALDEx2-style)
da_wilcoxon() da_ttest() da_lm()
Per-feature Wilcoxon, t and Linear Model Tests
linda()
Linear Models for Differential Abundance (LinDA)

Absolute abundance

With each sample’s total microbial load measured (cell counts, qPCR, a spike-in), estimate absolute abundances instead of ratios.

qmp_scale() qmp_rarefy()
Quantitative Microbiome Profiling: Absolute Abundances from a Measured Load

Community types

Assign each sample to one of a few community types. The types come back as a data frame whose type column can be used as groups in any test or ordination plot.

enterotype()
Enterotypes
ecodive_types
Community types

Source Tracking

What share of each sink sample’s community came from each of several source environments, and from an unknown source.

sourcetracker()
Microbial source tracking (SourceTracker)

Ordination

Place samples on a few axes for plotting. dist_ord() runs the methods that take beta diversity distances, and count_ord() the methods that take the count table.

dist_ord()
Distance-based Ordination
count_ord()
Count Table Ordination
pcoa()
Principal Coordinates Analysis (PCoA)
pcoa_biplot()
PCoA Biplot Scores
mds()
Metric Multidimensional Scaling (MDS)
nmds()
Non-metric Multidimensional Scaling (NMDS)
isomap()
Isometric Feature Mapping (Isomap)
tsne()
t-distributed Stochastic Neighbor Embedding (t-SNE)
umap()
Uniform Manifold Approximation and Projection (UMAP)
dbrda()
Distance-based Redundancy Analysis (db-RDA)
capscale()
Constrained Analysis of Principal Coordinates (capscale)
rda()
Redundancy Analysis (RDA)
cca()
Canonical Correspondence Analysis (CCA)
ca()
Correspondence Analysis (CA)
pca()
Principal Component Analysis (PCA)
rpca()
Robust Aitchison PCA (RPCA)
rpca_phylo()
Phylogenetic Robust Aitchison PCA
dpcoa()
Double Principal Coordinate Analysis
envfit()
Fit Variables or Taxa onto an Ordination
bioenv()
Best Subset of Environmental Variables (BIOENV)
varpart()
Variation Partitioning
forward_select()
Forward Selection of Explanatory Variables
procrustes()
Procrustes Rotation of One Ordination onto Another
procrustes_test()
Procrustes Randomization Test (PROTEST)
list_dist_ords() match_dist_ord()
Find and Browse Distance-based Ordination Methods
list_count_ords() match_count_ord()
Find and Browse Count Table Ordination Methods

Supervised

Ordinations that look for the axes that separate known groups. They always find some, so validate them with a permutation test such as permanova().

lda()
Linear Discriminant Analysis (LDA)
capda()
Discriminant Canonical Analysis of Principal Coordinates (CAP)
plsda()
Partial Least Squares Discriminant Analysis (PLS-DA)
oplsda()
Orthogonal Partial Least Squares Discriminant Analysis (OPLS-DA)

Hypothesis Tests

Test whether sample metadata explain beta diversity distances.

dist_test()
Distance Test Wrapper Function
permanova()
Permutational Multivariate Analysis of Variance (PERMANOVA)
mantel()
Mantel Test
mantel_partial()
Partial Mantel Test
mrpp()
Multi-Response Permutation Procedure (MRPP)
anosim()
Analysis of Similarities (ANOSIM)
permdisp()
Homogeneity of Multivariate Dispersions (PERMDISP)
list_dist_tests() match_dist_test()
Find and Browse Distance Tests

Interpreting Differences

Which taxa drive the differences between groups.

simper()
Similarity Percentages (SIMPER)

Plotting and Printing

plot() and print() methods for ecodive’s results. They show what a result already holds, with titles, labels and legends taken from its attributes; plots use base graphics, and printing shows a preview rather than every value.

Utilities & Helpers

Tools for programmatic access, data manipulation, and configuration.

list_metrics() match_metric()
Find and Browse Available Metrics
read_tree()
Read a newick formatted phylogenetic tree.
rarefy()
Rarefy Observation Counts
beta_div_rarefied() alpha_div_rarefied()
Diversity Averaged over Repeated Rarefactions
normalize()
Normalize a Count Table
n_cpus()
Number of CPU Cores
blas_threads()
Threads of the BLAS Library

Datasets

Example data provided with the package.

ex_counts
Example counts matrix
ex_tree
Example phylogenetic tree