Chapter 5 Alpha and Beta Diversity Analyses

NOte: Use sampling depth of 20718 (including all samples)

5.1 Alpha Rarefaction Curves

$ mkdir alpha_rarefaction

$ qiime diversity alpha-rarefaction \
--i-table DADA2_denoising_output/table.qza \
--i-phylogeny phylogenetic_tree/rooted_tree.qza \
--p-max-depth 20718 \
--m-metadata-file metadata.txt \
--o-visualization alpha_rarefaction/rarefaction_20718.qzv

5.2 Diversity Metrics

$ qiime diversity core-metrics-phylogenetic \
  --i-phylogeny phylogenetic_tree/rooted_tree.qza \
  --i-table DADA2_denoising_output/table.qza \
  --p-sampling-depth 20718  \
  --m-metadata-file metadata.txt \
  --output-dir core-metrics-results

Then I used this script from Rachel Lappan to iterate the alpha-group-significance plugin.

for result in *vector.qza; \
do \
outname=${result/_vector.qza/_group_significance.qzv}; \
qiime diversity alpha-group-significance \
--i-alpha-diversity $result \
--m-metadata-file ../metadata.txt \
--o-visualization $outname; \
done

5.3 Beta signficance metrics

$ qiime diversity beta-group-significance \
--i-distance-matrix bray_curtis_distance_matrix.qza \
--m-metadata-file ../metadata.txt \
--m-metadata-column treatment \
--o-visualization bray_curtis_distance_matrix.qzv

$ qiime diversity beta-group-significance \
--i-distance-matrix unweighted_unifrac_distance_matrix.qza \
--m-metadata-file ../metadata.txt \
--m-metadata-column treatment \
--o-visualization unweighted_unifrac_distance_matrix.qzv

$ qiime diversity beta-group-significance \
--i-distance-matrix weighted_unifrac_distance_matrix.qza \
--m-metadata-file ../metadata.txt \
--m-metadata-column treatment \
--o-visualization weighted_unifrac_distance_matrix.qzv