Fork me on GitHub

beta-rarefaction: Beta diversity rarefactionΒΆ

Citations
  • Nathan Mantel. The detection of disease clustering and a generalized regression approach. Cancer research, 27(2 Part 1):209–220, 1967.

  • Karl Pearson. Note on regression and inheritance in the case of two parents. Proceedings of the Royal Society of London, 58:240–242, 1895. doi:https://doi.org/10.1098/rspl.1895.0041.

  • Charles Spearman. The proof and measurement of association between two things. The American journal of psychology, 15(1):72–101, 1904. doi:https://doi.org/10.2307/1422689.

Docstring:

Usage: qiime diversity beta-rarefaction [OPTIONS]

  Repeatedly rarefy a feature table to compare beta diversity results within a
  given rarefaction depth.

  For a given beta diversity metric, this visualizer will provide: an Emperor
  jackknifed PCoA plot, samples clustered by UPGMA or neighbor joining with
  support calculation, and a heatmap showing the correlation between
  rarefaction trials of that beta diversity metric.

Inputs:
  --i-table ARTIFACT FeatureTable[Frequency]
                          Feature table upon which to perform beta diversity
                          rarefaction analyses.                     [required]
  --i-phylogeny ARTIFACT  Phylogenetic tree containing tip identifiers that
    Phylogeny[Rooted]     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 for phylogenetic
                          metrics]                                  [optional]
Parameters:
  --p-metric TEXT Choices('aitchison', 'braycurtis', 'canberra',
    'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine',
    'dice', 'euclidean', 'generalized_unifrac', 'hamming', 'jaccard',
    'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao',
    'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean',
    'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac',
    'yule')               The beta diversity metric to be computed. [required]
  --p-clustering-method TEXT Choices('nj', 'upgma')
                          Samples can be clustered with neighbor joining or
                          UPGMA. An arbitrary rarefaction trial will be used
                          for the tree, and the remaining trials are used to
                          calculate the support of the internal nodes of that
                          tree.                                     [required]
  --m-metadata-file METADATA...
    (multiple arguments   The sample metadata used for the Emperor jackknifed
     will be merged)      PCoA plot.                                [required]
  --p-sampling-depth INTEGER
    Range(1, None)        The total frequency that each sample should be
                          rarefied to prior to computing the diversity metric.
                                                                    [required]
  --p-iterations INTEGER  Number of times to rarefy the feature table at a
    Range(2, None)        given sampling depth.                  [default: 10]
  --p-correlation-method TEXT Choices('pearson', 'spearman')
                          The Mantel correlation test to be applied when
                          computing correlation between beta diversity
                          distance matrices.             [default: 'spearman']
  --p-color-scheme TEXT Choices('BrBG', 'BrBG_r', 'PRGn', 'PRGn_r', 'PiYG',
    'PiYG_r', 'PuOr', 'PuOr_r', 'RdBu', 'RdBu_r', 'RdGy', 'RdGy_r', 'RdYlBu',
    'RdYlBu_r', 'RdYlGn', 'RdYlGn_r')
                          The matplotlib color scheme to generate the heatmap
                          with.                              [default: 'BrBG']
Outputs:
  --o-visualization VISUALIZATION
                                                                    [required]
Miscellaneous:
  --output-dir PATH       Output unspecified results to a directory
  --verbose / --quiet     Display verbose output to stdout and/or stderr
                          during execution of this action. Or silence output
                          if execution is successful (silence is golden).
  --example-data PATH     Write example data and exit.
  --citations             Show citations and exit.
  --use-cache DIRECTORY   Specify the cache to be used for the intermediate
                          work of this action. If not provided, the default
                          cache under $TMP/qiime2/ will be used.
                          IMPORTANT FOR HPC USERS: If you are on an HPC system
                          and are using parallel execution it is important to
                          set this to a location that is globally accessible
                          to all nodes in the cluster.
  --help                  Show this message and exit.

Import:

from qiime2.plugins.diversity.visualizers import beta_rarefaction

Docstring:

Beta diversity rarefaction

Repeatedly rarefy a feature table to compare beta diversity results within
a given rarefaction depth.  For a given beta diversity metric, this
visualizer will provide: an Emperor jackknifed PCoA plot, samples clustered
by UPGMA or neighbor joining with support calculation, and a heatmap
showing the correlation between rarefaction trials of that beta diversity
metric.

Parameters
----------
table : FeatureTable[Frequency]
    Feature table upon which to perform beta diversity rarefaction
    analyses.
metric : Str % Choices('aitchison', 'braycurtis', 'canberra', 'canberra_adkins', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'generalized_unifrac', 'hamming', 'jaccard', 'jensenshannon', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'unweighted_unifrac', 'weighted_normalized_unifrac', 'weighted_unifrac', 'yule')
    The beta diversity metric to be computed.
clustering_method : Str % Choices('nj', 'upgma')
    Samples can be clustered with neighbor joining or UPGMA. An arbitrary
    rarefaction trial will be used for the tree, and the remaining trials
    are used to calculate the support of the internal nodes of that tree.
metadata : Metadata
    The sample metadata used for the Emperor jackknifed PCoA plot.
sampling_depth : Int % Range(1, None)
    The total frequency that each sample should be rarefied to prior to
    computing the diversity metric.
iterations : Int % Range(2, None), optional
    Number of times to rarefy the feature table at a given sampling depth.
phylogeny : Phylogeny[Rooted], optional
    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 for phylogenetic metrics]
correlation_method : Str % Choices('pearson', 'spearman'), optional
    The Mantel correlation test to be applied when computing correlation
    between beta diversity distance matrices.
color_scheme : Str % Choices('BrBG', 'BrBG_r', 'PRGn', 'PRGn_r', 'PiYG', 'PiYG_r', 'PuOr', 'PuOr_r', 'RdBu', 'RdBu_r', 'RdGy', 'RdGy_r', 'RdYlBu', 'RdYlBu_r', 'RdYlGn', 'RdYlGn_r'), optional
    The matplotlib color scheme to generate the heatmap with.

Returns
-------
visualization : Visualization