Fork me on GitHub

heatmap: Generate heatmap of important features.ΒΆ

Docstring:

Usage: qiime sample-classifier heatmap [OPTIONS]

  Generate a heatmap of important features. Features are filtered based on
  importance scores; samples are optionally grouped by sample metadata; and
  a heatmap is generated that displays (normalized) feature abundances per
  sample.

Inputs:
  --i-table ARTIFACT FeatureTable[Frequency]
                         Feature table containing all features that should be
                         used for target prediction.                [required]
  --i-importance ARTIFACT FeatureData[Importance]
                         Feature importances.                       [required]
Parameters:
  --m-sample-metadata-file METADATA
  --m-sample-metadata-column COLUMN  MetadataColumn[Categorical]
                         Sample metadata column to use for sample labeling or
                         grouping.                                  [optional]
  --m-feature-metadata-file METADATA
  --m-feature-metadata-column COLUMN  MetadataColumn[Categorical]
                         Feature metadata (e.g., taxonomy) to use for
                         labeling features in the heatmap.          [optional]
  --p-feature-count INTEGER
    Range(0, None)       Filter feature table to include top N most important
                         features. Set to zero to include all features.
                                                                 [default: 50]
  --p-importance-threshold NUMBER
    Range(0, None)       Filter feature table to exclude any features with an
                         importance score less than this threshold. Set to
                         zero to include all features.            [default: 0]
  --p-group-samples / --p-no-group-samples
                         Group samples by sample metadata.    [default: False]
  --p-normalize / --p-no-normalize
                         Normalize the feature table by adding a psuedocount
                         of 1 and then taking the log10 of the table.
                                                               [default: True]
  --p-missing-samples TEXT Choices('error', 'ignore')
                         How to handle missing samples in metadata. "error"
                         will fail if missing samples are detected. "ignore"
                         will cause the feature table and metadata to be
                         filtered, so that only samples found in both files
                         are retained.                     [default: 'ignore']
  --p-metric TEXT Choices('cityblock', 'yule', 'braycurtis', 'euclidean',
    'chebyshev', 'correlation', 'matching', 'sqeuclidean', 'sokalsneath',
    'cosine', 'jaccard', 'canberra', 'kulsinski', 'dice', 'rogerstanimoto',
    'russellrao', 'sokalmichener', 'seuclidean', 'hamming', 'mahalanobis',
    'minkowski')         Metrics exposed by seaborn (see
                         http://seaborn.pydata.org/generated/seaborn.clusterma
                         p.html#seaborn.clustermap for more detail).
                                                       [default: 'braycurtis']
  --p-method TEXT Choices('single', 'weighted', 'complete', 'median',
    'ward', 'centroid', 'average')
                         Clustering methods exposed by seaborn (see
                         http://seaborn.pydata.org/generated/seaborn.clusterma
                         p.html#seaborn.clustermap for more detail).
                                                          [default: 'average']
  --p-cluster TEXT Choices('none', 'both', 'features', 'samples')
                         Specify which axes to cluster.  [default: 'features']
  --p-color-scheme TEXT Choices('viridis_r', 'cool', 'rocket_r',
    'gist_stern_r', 'spring', 'gray_r', 'Set1', 'gist_heat', 'YlOrRd_r',
    'tab10', 'bone', 'hsv', 'OrRd', 'copper', 'Blues_r', 'RdGy_r', 'terrain',
    'Purples_r', 'Reds_r', 'pink_r', 'Vega20b_r', 'BuPu_r', 'jet_r',
    'Purples', 'RdYlBu', 'Dark2_r', 'rainbow_r', 'viridis', 'spectral_r',
    'cividis_r', 'Pastel1_r', 'nipy_spectral_r', 'Oranges_r', 'PuOr', 'PiYG',
    'PRGn', 'PuRd', 'YlOrBr', 'YlGn', 'RdYlGn_r', 'PuBuGn', 'Accent',
    'winter_r', 'afmhot_r', 'BrBG_r', 'prism_r', 'vlag', 'RdGy', 'YlOrRd',
    'OrRd_r', 'Spectral_r', 'binary_r', 'plasma_r', 'gist_gray_r', 'Set2_r',
    'seismic_r', 'GnBu_r', 'mako', 'flag_r', 'Wistia_r', 'gist_stern',
    'gist_rainbow_r', 'coolwarm_r', 'RdYlBu_r', 'prism', 'Vega10_r',
    'cubehelix', 'Reds', 'BrBG', 'autumn', 'Pastel2', 'Vega20c', 'gist_earth',
    'Blues', 'hsv_r', 'PuOr_r', 'RdBu_r', 'RdYlGn', 'Set3', 'GnBu',
    'Greens_r', 'binary', 'CMRmap', 'icefire', 'mako_r', 'RdPu', 'gist_yarg',
    'gist_yarg_r', 'winter', 'brg_r', 'Dark2', 'afmhot', 'Accent_r', 'Greys',
    'Greens', 'Paired', 'bwr_r', 'autumn_r', 'ocean_r', 'cool_r', 'gnuplot2',
    'bone_r', 'inferno_r', 'Vega20_r', 'BuGn_r', 'Paired_r', 'Vega20b',
    'YlGnBu', 'plasma', 'gnuplot2_r', 'jet', 'gist_rainbow', 'gnuplot',
    'terrain_r', 'PuRd_r', 'YlGn_r', 'Spectral', 'gray', 'gnuplot_r', 'Set2',
    'tab20c_r', 'brg', 'icefire_r', 'bwr', 'BuPu', 'cubehelix_r', 'YlOrBr_r',
    'ocean', 'PRGn_r', 'YlGnBu_r', 'Vega20c_r', 'tab20_r', 'RdPu_r',
    'Pastel2_r', 'tab20b_r', 'seismic', 'inferno', 'cividis', 'Greys_r',
    'rainbow', 'Set3_r', 'Vega10', 'CMRmap_r', 'spring_r', 'magma_r',
    'Pastel1', 'Set1_r', 'gist_ncar_r', 'gist_earth_r', 'hot', 'magma',
    'PuBuGn_r', 'Wistia', 'Vega20', 'tab20c', 'summer', 'flag', 'summer_r',
    'gist_heat_r', 'pink', 'spectral', 'BuGn', 'RdBu', 'PuBu', 'gist_ncar',
    'copper_r', 'rocket', 'tab10_r', 'vlag_r', 'PuBu_r', 'tab20b', 'PiYG_r',
    'gist_gray', 'hot_r', 'Oranges', 'nipy_spectral', 'coolwarm', 'tab20')
                         Color scheme for heatmap.         [default: 'rocket']
Outputs:
  --o-heatmap VISUALIZATION
                         Heatmap of important features.             [required]
  --o-filtered-table ARTIFACT FeatureTable[Frequency]
                         Filtered feature table containing data displayed in
                         heatmap.                                   [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).
  --citations            Show citations and exit.
  --help                 Show this message and exit.

Import:

from qiime2.plugins.sample_classifier.pipelines import heatmap

Docstring:

Generate heatmap of important features.

Generate a heatmap of important features. Features are filtered based on
importance scores; samples are optionally grouped by sample metadata; and a
heatmap is generated that displays (normalized) feature abundances per
sample.

Parameters
----------
table : FeatureTable[Frequency]
    Feature table containing all features that should be used for target
    prediction.
importance : FeatureData[Importance]
    Feature importances.
sample_metadata : MetadataColumn[Categorical], optional
    Sample metadata column to use for sample labeling or grouping.
feature_metadata : MetadataColumn[Categorical], optional
    Feature metadata (e.g., taxonomy) to use for labeling features in the
    heatmap.
feature_count : Int % Range(0, None), optional
    Filter feature table to include top N most important features. Set to
    zero to include all features.
importance_threshold : Float % Range(0, None), optional
    Filter feature table to exclude any features with an importance score
    less than this threshold. Set to zero to include all features.
group_samples : Bool, optional
    Group samples by sample metadata.
normalize : Bool, optional
    Normalize the feature table by adding a psuedocount of 1 and then
    taking the log10 of the table.
missing_samples : Str % Choices('error', 'ignore'), optional
    How to handle missing samples in metadata. "error" will fail if missing
    samples are detected. "ignore" will cause the feature table and
    metadata to be filtered, so that only samples found in both files are
    retained.
metric : Str % Choices('sokalsneath', 'correlation', 'chebyshev', 'sokalmichener', 'mahalanobis', 'cosine', 'yule', 'hamming', 'cityblock', 'jaccard', 'seuclidean', 'kulsinski', 'russellrao', 'canberra', 'rogerstanimoto', 'matching', 'euclidean', 'sqeuclidean', 'braycurtis', 'minkowski', 'dice'), optional
    Metrics exposed by seaborn (see http://seaborn.pydata.org/generated/sea
    born.clustermap.html#seaborn.clustermap for more detail).
method : Str % Choices('ward', 'centroid', 'single', 'average', 'weighted', 'median', 'complete'), optional
    Clustering methods exposed by seaborn (see http://seaborn.pydata.org/ge
    nerated/seaborn.clustermap.html#seaborn.clustermap for more detail).
cluster : Str % Choices('features', 'both', 'samples', 'none'), optional
    Specify which axes to cluster.
color_scheme : Str % Choices('flag_r', 'RdBu_r', 'gist_heat_r', 'icefire_r', 'YlOrBr_r', 'tab20', 'tab20b_r', 'rainbow_r', 'gist_ncar_r', 'vlag_r', 'gist_earth', 'PuOr_r', 'spectral_r', 'Vega10', 'hsv_r', 'icefire', 'hot', 'Reds', 'Set1_r', 'bwr', 'YlGn', 'coolwarm', 'ocean', 'coolwarm_r', 'cubehelix', 'Accent_r', 'seismic_r', 'PuBu_r', 'PuRd', 'inferno_r', 'PuBuGn', 'cool', 'RdYlBu', 'bone_r', 'jet', 'gist_heat', 'RdYlGn', 'Greens', 'binary', 'hsv', 'Accent', 'gray', 'tab10', 'winter_r', 'BuPu', 'tab10_r', 'gist_rainbow_r', 'gist_yarg', 'GnBu', 'Set3_r', 'Set2_r', 'RdBu', 'Spectral', 'Pastel1_r', 'gnuplot2', 'summer_r', 'Vega20_r', 'Pastel1', 'magma_r', 'Wistia_r', 'tab20b', 'PRGn_r', 'vlag', 'Blues_r', 'brg', 'ocean_r', 'plasma', 'rainbow', 'PiYG', 'Vega10_r', 'gist_stern_r', 'magma', 'bwr_r', 'spring', 'PuBu', 'gnuplot', 'BuPu_r', 'summer', 'PuRd_r', 'tab20c', 'gist_gray_r', 'prism', 'rocket', 'Paired', 'gist_ncar', 'Blues', 'Oranges', 'Vega20c_r', 'Paired_r', 'PiYG_r', 'Greys', 'Purples_r', 'RdGy_r', 'mako_r', 'viridis', 'YlOrRd_r', 'gist_yarg_r', 'Greens_r', 'PuBuGn_r', 'bone', 'tab20_r', 'winter', 'Spectral_r', 'tab20c_r', 'prism_r', 'afmhot', 'Set2', 'gist_stern', 'BrBG', 'spring_r', 'OrRd', 'rocket_r', 'viridis_r', 'terrain', 'seismic', 'YlOrRd', 'CMRmap_r', 'mako', 'OrRd_r', 'Set1', 'Wistia', 'RdYlGn_r', 'inferno', 'BuGn', 'binary_r', 'Set3', 'GnBu_r', 'flag', 'gist_earth_r', 'Dark2_r', 'YlGn_r', 'gist_rainbow', 'pink_r', 'BrBG_r', 'YlGnBu_r', 'copper', 'Vega20c', 'RdYlBu_r', 'brg_r', 'RdPu', 'cividis', 'copper_r', 'BuGn_r', 'Reds_r', 'gnuplot2_r', 'jet_r', 'gray_r', 'plasma_r', 'pink', 'RdPu_r', 'spectral', 'RdGy', 'cividis_r', 'Oranges_r', 'gist_gray', 'gnuplot_r', 'Vega20', 'Vega20b', 'autumn', 'YlGnBu', 'PRGn', 'cool_r', 'autumn_r', 'Greys_r', 'CMRmap', 'Pastel2', 'terrain_r', 'Dark2', 'nipy_spectral', 'nipy_spectral_r', 'afmhot_r', 'YlOrBr', 'Purples', 'Pastel2_r', 'Vega20b_r', 'cubehelix_r', 'PuOr', 'hot_r'), optional
    Color scheme for heatmap.

Returns
-------
heatmap : Visualization
    Heatmap of important features.
filtered_table : FeatureTable[Frequency]
    Filtered feature table containing data displayed in heatmap.