Fork me on GitHub

evaluate-composition: Evaluate expected vs. observed taxonomic composition of samplesΒΆ

Citations

[quality-control:evaluate-composition:BKR+18]Nicholas A Bokulich, Benjamin D Kaehler, Jai Ram Rideout, Matthew Dillon, Evan Bolyen, Rob Knight, Gavin A Huttley, and J Gregory Caporaso. Optimizing taxonomic classification of marker-gene amplicon sequences with qiime 2’s q2-feature-classifier plugin. Microbiome, 2018.

Docstring:

Usage: qiime quality-control evaluate-composition [OPTIONS]

  This visualizer compares the feature composition of pairs of observed and
  expected samples containing the same sample ID in two separate feature
  tables. Typically, feature composition will consist of taxonomy
  classifications or other semicolon-delimited feature annotations. Taxon
  accuracy rate, taxon detection rate, and linear regression scores between
  expected and observed observations are calculated at each semicolon-
  delimited rank, and plots of per-level accuracy and observation
  correlations are plotted. A histogram of distance between false positive
  observations and the nearest expected feature is also generated, where
  distance equals the number of rank differences between the observed
  feature and the nearest common lineage in the expected feature. This
  visualizer is most suitable for testing per-run data quality on sequencing
  runs that contain mock communities or other samples with known
  composition. Also suitable for sanity checks of bioinformatics pipeline
  performance.

Options:
  --i-expected-features ARTIFACT PATH FeatureTable[RelativeFrequency]
                                  Expected feature compositions  [required]
  --i-observed-features ARTIFACT PATH FeatureTable[RelativeFrequency]
                                  Observed feature compositions  [required]
  --p-depth INTEGER               Maximum depth of semicolon-delimited
                                  taxonomic ranks to test (e.g., 1 = root, 7 =
                                  species for the greengenes reference
                                  sequence database).  [default: 7]
  --p-palette [Pastel1|Set3|Set1|tab20|Pastel2|magma|rainbow|Paired|inferno|Accent|tab10|plasma|Dark2|Set2|tab20b|tab20c|terrain|viridis]
                                  Color palette to utilize for plotting.
                                  [default: Set1]
  --p-plot-tar / --p-no-plot-tar  Plot taxon accuracy rate (TAR) on score
                                  plot. TAR is the number of true positive
                                  features divided by the total number of
                                  observed features (TAR = true positives /
                                  (true positives + false positives)).
                                  [default: True]
  --p-plot-tdr / --p-no-plot-tdr  Plot taxon detection rate (TDR) on score
                                  plot. TDR is the number of true positive
                                  features divided by the total number of
                                  expected features (TDR = true positives /
                                  (true positives + false negatives)).
                                  [default: True]
  --p-plot-r-value / --p-no-plot-r-value
                                  Plot expected vs. observed linear regression
                                  r value on score plot.  [default: False]
  --p-plot-r-squared / --p-no-plot-r-squared
                                  Plot expected vs. observed linear regression
                                  r-squared value on score plot.  [default:
                                  True]
  --p-plot-bray-curtis / --p-no-plot-bray-curtis
                                  Plot expected vs. observed Bray-Curtis
                                  dissimilarity scores on score plot.
                                  [default: False]
  --p-plot-jaccard / --p-no-plot-jaccard
                                  Plot expected vs. observed Jaccard distances
                                  scores on score plot.  [default: False]
  --p-plot-observed-features / --p-no-plot-observed-features
                                  Plot observed features count on score plot.
                                  [default: False]
  --p-plot-observed-features-ratio / --p-no-plot-observed-features-ratio
                                  Plot ratio of observed:expected features on
                                  score plot.  [default: True]
  --m-metadata-file MULTIPLE FILE
                                  Metadata file or artifact viewable as
                                  metadata. This option may be supplied
                                  multiple times to merge metadata.
                                  [optional]
  --m-metadata-column MetadataColumn[Categorical]
                                  Column from metadata file or artifact
                                  viewable as metadata. Optional sample
                                  metadata that maps observed_features sample
                                  IDs to expected_features sample IDs.
                                  [optional]
  --o-visualization VISUALIZATION PATH
                                  [required if not passing --output-dir]
  --output-dir DIRECTORY          Output unspecified results to a directory
  --cmd-config FILE               Use config file for command options
  --verbose                       Display verbose output to stdout and/or
                                  stderr during execution of this action.
                                  [default: False]
  --quiet                         Silence output if execution is successful
                                  (silence is golden).  [default: False]
  --citations                     Show citations and exit.
  --help                          Show this message and exit.

Import:

from qiime2.plugins.quality_control.visualizers import evaluate_composition

Docstring:

Evaluate expected vs. observed taxonomic composition of samples

This visualizer compares the feature composition of pairs of observed and
expected samples containing the same sample ID in two separate feature
tables. Typically, feature composition will consist of taxonomy
classifications or other semicolon-delimited feature annotations. Taxon
accuracy rate, taxon detection rate, and linear regression scores between
expected and observed observations are calculated at each semicolon-
delimited rank, and plots of per-level accuracy and observation
correlations are plotted. A histogram of distance between false positive
observations and the nearest expected feature is also generated, where
distance equals the number of rank differences between the observed feature
and the nearest common lineage in the expected feature. This visualizer is
most suitable for testing per-run data quality on sequencing runs that
contain mock communities or other samples with known composition. Also
suitable for sanity checks of bioinformatics pipeline performance.

Parameters
----------
expected_features : FeatureTable[RelativeFrequency]
    Expected feature compositions
observed_features : FeatureTable[RelativeFrequency]
    Observed feature compositions
depth : Int, optional
    Maximum depth of semicolon-delimited taxonomic ranks to test (e.g., 1 =
    root, 7 = species for the greengenes reference sequence database).
palette : Str % Choices({'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3', 'inferno', 'magma', 'plasma', 'rainbow', 'tab10', 'tab20', 'tab20b', 'tab20c', 'terrain', 'viridis'}), optional
    Color palette to utilize for plotting.
plot_tar : Bool, optional
    Plot taxon accuracy rate (TAR) on score plot. TAR is the number of true
    positive features divided by the total number of observed features (TAR
    = true positives / (true positives + false positives)).
plot_tdr : Bool, optional
    Plot taxon detection rate (TDR) on score plot. TDR is the number of
    true positive features divided by the total number of expected features
    (TDR = true positives / (true positives + false negatives)).
plot_r_value : Bool, optional
    Plot expected vs. observed linear regression r value on score plot.
plot_r_squared : Bool, optional
    Plot expected vs. observed linear regression r-squared value on score
    plot.
plot_bray_curtis : Bool, optional
    Plot expected vs. observed Bray-Curtis dissimilarity scores on score
    plot.
plot_jaccard : Bool, optional
    Plot expected vs. observed Jaccard distances scores on score plot.
plot_observed_features : Bool, optional
    Plot observed features count on score plot.
plot_observed_features_ratio : Bool, optional
    Plot ratio of observed:expected features on score plot.
metadata : MetadataColumn[Categorical], optional
    Optional sample metadata that maps observed_features sample IDs to
    expected_features sample IDs.

Returns
-------
visualization : Visualization