This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

This QIIME 2 plugin computes individual metrics for community alpha and beta diversity.

version: 2024.10.0
website: https://github.com/qiime2/q2-diversity-lib
user support:
Please post to the QIIME 2 forum for help with this plugin: https://forum.qiime2.org

Actions

NameTypeShort Description
faith-pdmethodFaith's Phylogenetic Diversity
observed-featuresmethodObserved Features
pielou-evennessmethodPielou's Evenness
shannon-entropymethodShannon's Entropy
bray-curtismethodBray-Curtis Dissimilarity
jaccardmethodJaccard Distance
unweighted-unifracmethodUnweighted Unifrac
weighted-unifracmethodWeighted Unifrac
alpha-passthroughmethodAlpha Passthrough (non-phylogenetic)
beta-passthroughmethodBeta Passthrough (non-phylogenetic)
beta-phylogenetic-passthroughmethodBeta Phylogenetic Passthrough
beta-phylogenetic-meta-passthroughmethodBeta Phylogenetic Meta Passthrough


diversity-lib faith-pd

Computes Faith's Phylogenetic Diversity for all samples in a feature table.

Citations

Faith, 1992; Armstrong et al., 2021

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Faith's phylogenetic diversity should be computed. Table values will be converted to presence/absence.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Faith's Phylogenetic Diversity.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/faith-pd/1/phylogeny.qza'

qiime diversity-lib faith-pd \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-vector faith-pd-vector.qza

diversity-lib observed-features

Compute the number of observed features for each sample in a feature table

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which the number of observed features should be calculated. Table values will be converted to presence/absence.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample counts of observed features.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/observed-features/1/feature-table.qza'

qiime diversity-lib observed-features \
  --i-table feature-table.qza \
  --o-vector obs-feat-vector.qza

diversity-lib pielou-evenness

Compute Pielou's Evenness for each sample in a feature table

Citations

Pielou, 1966

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Pielou's evenness should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with fewer than two observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Pielou's Evenness.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/1/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --o-vector pielou-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/pielou-evenness/2/feature-table.qza'

qiime diversity-lib pielou-evenness \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector pielou-vector.qza

diversity-lib shannon-entropy

Compute Shannon's Entropy for each sample in a feature table

Citations

Shannon, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Shannon's Entropy should be computed.[required]

Parameters

drop_undefined_samples: Bool

Samples with no observed features produce undefined (NaN) values. If true, these samples are dropped from the output vector.[default: False]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for Shannon's Entropy.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/1/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --o-vector shannon-vector.qza

dropping undefined samples

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/shannon-entropy/2/feature-table.qza'

qiime diversity-lib shannon-entropy \
  --i-table feature-table.qza \
  --p-drop-undefined-samples \
  --o-vector shannon-vector.qza

diversity-lib bray-curtis

Compute Bray-Curtis dissimilarity for each sample in a feature table. Note: Frequency and relative frequency data produce different results unless overall sample sizes are identical. Please consider the impact on your results if you use Bray-Curtis with count data that has not been adjusted (normalized).

Citations

Sørensen, 1948

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Bray-Curtis dissimilarity should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Bray-Curtis dissimilarity[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/1/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --o-distance-matrix bray-curtis-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/2/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix bray-curtis-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/bray-curtis/3/feature-table.qza'

qiime diversity-lib bray-curtis \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix bray-curtis-dm.qza

diversity-lib jaccard

Compute Jaccard distance for each sample in a feature table. Jaccard is calculated usingpresence/absence data. Data of type FeatureTable[Frequency | Relative Frequency] is reducedto presence/absence prior to calculation.

Citations

Jaccard, 1908

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Jaccard distance should be computed.[required]

Parameters

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Jaccard index[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/1/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --o-distance-matrix jaccard-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/2/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs 1 \
  --o-distance-matrix jaccard-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/jaccard/3/feature-table.qza'

qiime diversity-lib jaccard \
  --i-table feature-table.qza \
  --p-n-jobs auto \
  --o-distance-matrix jaccard-dm.qza

diversity-lib unweighted-unifrac

Compute Unweighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]

The feature table containing the samples for which Unweighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/1/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix unweighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/2/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix unweighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/3/phylogeny.qza'

qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix unweighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/unweighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib unweighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix unweighted-unifrac-dm.qza

diversity-lib weighted-unifrac

Compute Weighted Unifrac for each sample in a feature table

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018

Inputs

table: FeatureTable[Frequency | RelativeFrequency]

The feature table containing the samples for which Weighted Unifrac should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

Distance matrix for Unweighted Unifrac.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/1/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --o-distance-matrix weighted-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/2/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --o-distance-matrix weighted-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/3/phylogeny.qza'

qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --o-distance-matrix weighted-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/weighted-unifrac/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib weighted-unifrac \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-unifrac-dm.qza

diversity-lib alpha-passthrough

Computes a vector of values (one value for each samples in a feature table) using the scikit-bio implementation of the selected alpha diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples for which a selected metric should be computed.[required]

Parameters

metric: Str % Choices('ace', 'berger_parker_d', 'brillouin_d', 'chao1', 'chao1_ci', 'dominance', 'doubles', 'enspie', 'esty_ci', 'fisher_alpha', 'gini_index', 'goods_coverage', 'heip_e', 'kempton_taylor_q', 'lladser_pe', 'margalef', 'mcintosh_d', 'mcintosh_e', 'menhinick', 'michaelis_menten_fit', 'osd', 'robbins', 'simpson', 'simpson_e', 'singles', 'strong')

The alpha diversity metric to be computed.[required]

Outputs

vector: SampleData[AlphaDiversity]

Vector containing per-sample values for the chosen metric.[required]

Examples

basic

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/alpha-passthrough/1/feature-table.qza'

qiime diversity-lib alpha-passthrough \
  --i-table feature-table.qza \
  --p-metric simpson \
  --o-vector simpson-vector.qza

diversity-lib beta-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the scikit-bio implementation of the selected beta diversity metric.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

Parameters

metric: Str % Choices('aitchison', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule')

The beta diversity metric to be computed.[required]

pseudocount: Int % Range(1, None)

A pseudocount to handle zeros for compositional metrics. This is ignored for non-compositional metrics.[default: 1]

n_jobs: Threads

The number of concurrent jobs to use in performing this calculation. May not exceed the number of available physical cores. If n_jobs = 'auto', one job will be launched for each identified CPU core on the host.[default: 1]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/1/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --o-distance-matrix euclidean-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/2/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric euclidean \
  --p-n-jobs 1 \
  --o-distance-matrix euclidean-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/3/feature-table.qza'

# A default pseudocount of 1 is added to feature counts. Pseudocount is
# ignored for non-compositional metrics.
qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --o-distance-matrix aitchison-dm.qza

use 'pseudocount' to manually set a pseudocount for compositional metrics

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-passthrough/4/feature-table.qza'

qiime diversity-lib beta-passthrough \
  --i-table feature-table.qza \
  --p-metric aitchison \
  --p-n-jobs auto \
  --p-pseudocount 5 \
  --o-distance-matrix aitchison-dm.qza

diversity-lib beta-phylogenetic-passthrough

Computes a distance matrix for all pairs of samples in a feature table using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Sfiligoi et al., n.d.

Inputs

table: FeatureTable[Frequency]

The feature table containing the samples over which beta diversity should be computed.[required]

phylogeny: Phylogeny[Rooted]

Phylogenetic tree containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

run on one core (by default)

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/1/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

to run on n cores, replace 1 here with your preferred integer

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/2/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads 1 \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use 'auto' to run on all of host system's available CPU cores

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/3/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-threads auto \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

use bypass_tips to trade specificity for reduced compute time

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/4/phylogeny.qza'

# bypass_tips can be used with any threads setting, but auto may be a good
# choice if you're trimming run time.
qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-threads auto \
  --p-bypass-tips \
  --o-distance-matrix weighted-normalized-unifrac-dm.qza

variance adjustment

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Chang et al's variance adjustment may be applied to any unifrac method by
# using this passthrough function.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/5/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric weighted_unifrac \
  --p-threads auto \
  --p-variance-adjusted \
  --o-distance-matrix var-adj-weighted-unifrac-dm.qza

minimal generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# Generalized unifrac is passed alpha=1 by default. This is roughly
# equivalent to weighted normalized unifrac, which method will be used
# instead, because it is better optimized.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/6/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --o-distance-matrix generalized-unifrac-dm.qza

generalized unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# passing a float between 0 and 1 to 'alpha' gives you control over the
# importance of sample proportions.
wget -O 'feature-table.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/feature-table.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-passthrough/7/phylogeny.qza'

qiime diversity-lib beta-phylogenetic-passthrough \
  --i-table feature-table.qza \
  --i-phylogeny phylogeny.qza \
  --p-metric generalized_unifrac \
  --p-alpha 0.75 \
  --o-distance-matrix generalized-unifrac-dm.qza

diversity-lib beta-phylogenetic-meta-passthrough

Computes a distance matrix for all pairs of samples in the set of feature table and phylogeny pairs, using the unifrac implementation of the selected beta diversity metric.

Citations

Lozupone & Knight, 2005; Lozupone et al., 2007; Hamady et al., 2010; Lozupone et al., 2011; McDonald et al., 2018; Chang et al., 2011; Chen et al., 2012; Lozupone et al., 2008

Inputs

tables: List[FeatureTable[Frequency]]

The feature tables containing the samples over which beta diversity should be computed.[required]

phylogenies: List[Phylogeny[Rooted]]

Phylogenetic trees containing tip identifiers that correspond to the feature identifiers in the table. This tree can contain tip ids that are not present in the table, but all feature ids in the table must be present in this tree.[required]

Parameters

metric: Str % Choices('generalized_unifrac', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac')

The beta diversity metric to be computed.[required]

threads: Threads

The number of CPU threads to use in performing this calculation. May not exceed the number of available physical cores. If threads = 'auto', one thread will be created for each identified CPU core on the host.[default: 1]

variance_adjusted: Bool

Perform variance adjustment based on Chang et al. BMC Bioinformatics 2011. Weights distances based on the proportion of the relative abundance represented between the samples at a given node under evaluation.[default: False]

alpha: Float % Range(0, 1, inclusive_end=True)

This parameter is only used when the choice of metric is generalized_unifrac. The value of alpha controls importance of sample proportions. 1.0 is weighted normalized UniFrac. 0.0 is close to unweighted UniFrac, but only if the sample proportions are dichotomized.[optional]

bypass_tips: Bool

In a bifurcating tree, the tips make up about 50% of the nodes in a tree. By ignoring them, specificity can be traded for reduced compute time. This has the effect of collapsing the phylogeny, and is analogous (in concept) to moving from 99% to 97% OTUs[default: False]

weights: List[Float]

The weight applied to each tree/table pair. This tuple is expected to be in index order with tables and phylogenies. Default is to weight each tree/table pair evenly.[optional]

consolidation: Str % Choices('skipping_missing_matrices', 'missing_zero', 'missing_one', 'skipping_missing_values')

The matrix consolidation method, which determines how the individual distance matrices are aggregated[default: 'skipping_missing_values']

Outputs

distance_matrix: DistanceMatrix

The resulting distance matrix.[required]

Examples

Basic meta unifrac

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
# For brevity, these examples are focused on meta-specific parameters. See
# the documentation for beta_phylogenetic_passthrough for additional
# relevant information.
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/1/phylogeny2.qza'

# NOTE: the number of trees and tables must match.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

meta with weights

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/feature-table2.qza'

wget -O 'phylogeny.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/2/phylogeny.qza'

# The number of weights must match the number of tables/trees.
# If meaningful, it is possible to pass the same phylogeny more than once.
qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny.qza phylogeny.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 3.0 42.0 \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza

changing the consolidation method

[Command Line]
[Python API]
[Galaxy]
[R API]
[View Source]
wget -O 'feature-table1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table1.qza'

wget -O 'feature-table2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/feature-table2.qza'

wget -O 'phylogeny1.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny1.qza'

wget -O 'phylogeny2.qza' \
  'https://amplicon-docs.qiime2.org/en/latest/data/examples/diversity-lib/beta-phylogenetic-meta-passthrough/3/phylogeny2.qza'

qiime diversity-lib beta-phylogenetic-meta-passthrough \
  --i-tables feature-table1.qza feature-table2.qza \
  --i-phylogenies phylogeny1.qza phylogeny2.qza \
  --p-metric weighted_normalized_unifrac \
  --p-weights 0.4 0.6 \
  --p-consolidation skipping_missing_values \
  --o-distance-matrix ft1-ft2-w-norm-unifrac-dm.qza