Calculate the alpha diversity of a set of samples using one or more metrics and output a kernal density estimator-smoothed histogram of the results.

usage: diversity.py [-h] [-d DIVERSITY [DIVERSITY ...]] [--plot_title PLOT_TITLE] [--image_type IMAGE_TYPE] [--save_calculations SAVE_CALCULATIONS] [--show_significance] [--show_available_metrics] -m MAP_FILE -i BIOM_FP -c CATEGORY --color_by COLOR_BY -o OUT_DIR

Required arguments

-m MAP_FILE, --map_file MAP_FILE

QIIME mapping file.

-i BIOM_FP, --biom_fp BIOM_FP

BIOM table file name

-c CATEGORY, --category CATEGORY

Specific category from the mapping file.

--color_by COLOR_BY

A column name in the mapping file containing hexadecimal (#FF0000) color values that will be used to color the groups. Each sample ID must have a color entry.

-o OUT_DIR, --out_dir OUT_DIR

The directory all plots will be saved to.

Optional arguments

-h, --help

show this help message and exit


The alpha diversity metric. Default value is ‘shannon’, which will calculate the Shannon entropy. Multiple metrics can be specified (space separated). The full list of metrics is available at: http://scikit-bio.org/docs/latest/generated/skbio.diversity.alpha.html.

--plot_title PLOT_TITLE

The name of a PDF file the pathway map will be written to.

-p IMAGE_TYPE, --image_type IMAGE_TYPE

The type of image to save: PNG, SVG, etc.

--save_calculations SAVE_CALCULATIONS

Path and name of text file to store the calculated diversity metrics.


Display significance testing results. The results will be shown by default.


Supply this parameter to see which alpha diversity metrics are available for usage. No calculations will be performed if this parameter is provided.