This is the 2nd script used for data analysis and figure generation for the the manuscript by Masche et al. titled “Specific gut microbiome members are associated with distinct immune markers in allogeneic hematopoietic stem cell transplantation”.

This script and associated data are provided by Anna Caecilia Masche, Susan Holmes, and Suenje Johanna Pamp.

These data and the associated script are licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Under the condition that appropriate credit is provided, you are free to: 1) Share, copy and redistribute the material in any medium or format 2) Adapt, remix, transform, and build upon the material for any purpose, even commercially.

To see the full license associated with attribution of this work, see the CC-By-CA license, see http://creativecommons.org/licenses/by-sa/4.0/.

The local filename is: Script2_diversity.Rmd.

Load required packages:

## Registered S3 methods overwritten by 'ggplot2':
##   method         from 
##   [.quosures     rlang
##   c.quosures     rlang
##   print.quosures rlang
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
## PMCMR is superseded by PMCMRplus and will be no longer maintained. You may wish to install PMCMRplus instead.

Load the phyloseq object resulting from Script 1:

The file phy_obj1_core_cleaned_vsd1.Rdata is provided.

Boxplot of alpha-diversity per time point:

Comparison of alpha diversity at different time points using a Friedman test with Benjamini-Hochberg correction and a post-hoc Conover test:

## 
##  Friedman rank sum test
## 
## data:  div_fried_dcast_ma[, c(2:7)]
## Friedman chi-squared = 8.8571, df = 5, p-value = 0.1149
## Warning in mde(x): NAs introduced by coercion
## 
##  Pairwise comparisons using Conover's test for a two-way 
##                     balanced complete block design 
## 
## data:  div_fried_dcast_ma_num[, c(2:7)] 
## 
##    f01     w0      w1      w2      w3     
## w0 0.03520 -       -       -       -      
## w1 0.87249 0.04782 -       -       -      
## w2 0.00057 0.16067 0.00089 -       -      
## w3 2.4e-06 0.00653 4.1e-06 0.16067 -      
## w4 1.1e-14 1.4e-09 1.5e-14 1.4e-06 0.00036
## 
## P value adjustment method: BH

Plot stacked bar charts of microbial composition (relative abundance) on taxonomic family level for initial pattern identification

The file phy_obj1_core_cleaned.Rdata is provided.

The following code is modified after: Fukuyama J, Rumker L, Sankaran K, Jeganathan P, Dethlefsen L, Relman DA, et al. Multidomain analyses of a longitudinal human microbiome intestinal cleanout perturbation experiment. PLoS Comput Biol. 2017;13:e1005706. doi:10.1371/journal.pcbi.1005706.