Skip to content

Lesson 5 Practice

This practice lesson is associated with Lesson 5 of the Microbiome Analysis with QIIME 2. In this practice lesson, we will work on choosing a sampling depth to rarefy, running core-metrics, and comparing alpha diveristy between our two metadata groups (Old vs young). We will continue working with the data from Zhang et al. 2022.

  1. Navigate to your Practice directory.

    Solution

    cd Practice  
    

  2. Generate a summary of your recently filtered feature table (i.e., 04_filter/filtered-table3.qza).

    Solution

    qiime feature-table summarize \
    --i-table 04_filter/filtered-table3.qza \
    --m-sample-metadata-file /data/practice/metadata.txt \
    --o-visualization 04_filter/filtered-table3-summ.qzv  
    

  3. Generate an alpha rarefaction plot and save the plot to a new directory named 07_analysis. There is a tree available at /data/practice/phylogeny-align-to-tree-mafft-fasttree/rooted_tree.qza.

    Solution

    mkdir 07_analysis  
    qiime diversity alpha-rarefaction \
    --i-table 04_filter/filtered-table3.qza \
    --i-phylogeny /data/practice/06_tree/phylogeny-align-to-tree-mafft-fasttree/rooted_tree.qza \
    --m-metadata-file /data/practice/metadata.txt \
    --p-max-depth 40000 \
    --o-visualization 07_analysis/alpha-rarefaction-plot.qzv   
    

  4. Choose a sampling depth to rarefy using the feature table summary (filtered-table3-summ.qzv) and the alpha-rarefaction plot (`alpha-rarefaction-plot.qzv).

    Solution

    Diversity plateaus around 20k reads, so it is safe to rarefy at the smallest library depth (69,355).

  5. Generate core metrics using the core-metrics-phylogenetic pipeline.

    Solution

    qiime diversity core-metrics-phylogenetic \
    --i-phylogeny /data/practice/06_tree/phylogeny-align-to-tree-mafft-fasttree/rooted_tree.qza \
    --i-table 04_filter/filtered-table3.qza \
    --p-sampling-depth 69355 \
    --p-n-jobs-or-threads 8 \
    --m-metadata-file /data/practice/metadata.txt \
    --output-dir 07_analysis/diversity-core-metrics-phylogenetic  
    

  6. Compare old vs young using a kruskal-wallis test (alpha-group-significance).

    Solution

    qiime diversity alpha-group-significance \
    --i-alpha-diversity 07_analysis/diversity-core-metrics-phylogenetic/observed_features_vector.qza \
    --m-metadata-file /data/practice/metadata.txt \
    --o-visualization 07_analysis/alpha-group-sig-obs-feats.qzv  
    

How does this compare to the paper?