• Data prep
  • Phylum Level Microbiome and Food
    • Correlation between Phylum and HEI scores
      • Start of Study

Last updated: 2020-02-27

Checks: 6 1

Knit directory: Fiber_Intervention_Study/

This reproducible R Markdown analysis was created with workflowr (version 1.5.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20191210) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  analysis/microbiome_food.Rmd

Unstaged changes:
    Modified:   analysis/_site.yml
    Modified:   code/get_cleaned_data.R
    Modified:   code/microbiome_statistics_and_functions.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


This page contains the investigation of the changes over time.

Data prep

This is only to recode some variables to ease interpretation.

microbiome_data$meta.dat <- microbiome_data$meta.dat %>%
  mutate(intB = ifelse(Intervention=="B", 1,0),
         time = as.numeric(Week) - 1,
         female = ifelse(Gender == "F", 1, 0),
         hispanic = ifelse(Ethnicity %in% c("White", "Asian", "Native America"), 1, 0))

Phylum Level Microbiome and Food

Get the phylum level data

data.phylum <-get_combined_data(mydata=microbiome_data,
                                taxa.level="Phylum")

#phylum 
bugs <- data.phylum$bug.list
bugs
 [1] "Actinobacteria"  "Bacteroidetes"   "Cyanobacteria"   "Euryarchaeota"  
 [5] "Firmicutes"      "Fusobacteria"    "Lentisphaerae"   "Proteobacteria" 
 [9] "Tenericutes"     "Verrucomicrobia"

Correlation between Phylum and HEI scores

Start of Study

Actinobacteria

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[1])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[1]))
Warning: Removed 2 rows containing missing values (geom_point).

Bacteroidetes

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[2])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[2]))
Warning: Removed 2 rows containing missing values (geom_point).

Cyanobacteria

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[3])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[3]))
Warning: Removed 2 rows containing missing values (geom_point).

Euryarchaeota

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[4])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[4]))
Warning: Removed 2 rows containing missing values (geom_point).

Firmicutes

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[5])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[5]))
Warning: Removed 2 rows containing missing values (geom_point).

Fusobacteria

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[6])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[6]))
Warning: Removed 2 rows containing missing values (geom_point).

Lentisphaerae

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[7])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[7]))
Warning: Removed 2 rows containing missing values (geom_point).

Proteobacteria

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[8])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[8]))
Warning: Removed 2 rows containing missing values (geom_point).

Tenericutes

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[9])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[9]))
Warning: Removed 2 rows containing missing values (geom_point).

Verrucomicrobia

subdat <- filter(data.phylum$full_data,
                 Week == "1" & Bug == bugs[10])

ggplot(subdat, aes(x=Abundance, y=HEI_Total,
                   color=Intervention))+
  geom_point(size=3) +
  labs(title = paste0("Phylum: ", bugs[10]))
Warning: Removed 2 rows containing missing values (geom_point).


sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] viridis_0.5.1     viridisLite_0.3.0 gridExtra_2.3     xtable_1.8-4     
 [5] kableExtra_1.1.0  plyr_1.8.4        data.table_1.12.6 readxl_1.3.1     
 [9] forcats_0.4.0     stringr_1.4.0     dplyr_0.8.3       purrr_0.3.3      
[13] readr_1.3.1       tidyr_1.0.0       tibble_2.1.3      ggplot2_3.2.1    
[17] tidyverse_1.3.0   lmerTest_3.1-1    lme4_1.1-21       Matrix_1.2-17    
[21] phyloseq_1.30.0  

loaded via a namespace (and not attached):
 [1] nlme_3.1-140        fs_1.3.1            lubridate_1.7.4    
 [4] RColorBrewer_1.1-2  webshot_0.5.2       httr_1.4.1         
 [7] rprojroot_1.3-2     numDeriv_2016.8-1.1 tools_3.6.1        
[10] backports_1.1.5     R6_2.4.1            vegan_2.5-6        
[13] DBI_1.0.0           lazyeval_0.2.2      BiocGenerics_0.32.0
[16] mgcv_1.8-28         colorspace_1.4-1    permute_0.9-5      
[19] ade4_1.7-13         withr_2.1.2         tidyselect_0.2.5   
[22] compiler_3.6.1      git2r_0.26.1        cli_1.1.0          
[25] rvest_0.3.5         Biobase_2.46.0      xml2_1.2.2         
[28] labeling_0.3        scales_1.1.0        digest_0.6.23      
[31] minqa_1.2.4         rmarkdown_1.18      XVector_0.26.0     
[34] pkgconfig_2.0.3     htmltools_0.4.0     dbplyr_1.4.2       
[37] rlang_0.4.2         rstudioapi_0.10     farver_2.0.1       
[40] generics_0.0.2      jsonlite_1.6        magrittr_1.5       
[43] biomformat_1.14.0   Rcpp_1.0.3          munsell_0.5.0      
[46] S4Vectors_0.24.1    Rhdf5lib_1.8.0      ape_5.3            
[49] lifecycle_0.1.0     stringi_1.4.3       yaml_2.2.0         
[52] MASS_7.3-51.4       zlibbioc_1.32.0     rhdf5_2.30.1       
[55] grid_3.6.1          parallel_3.6.1      promises_1.1.0     
[58] crayon_1.3.4        lattice_0.20-38     Biostrings_2.54.0  
[61] haven_2.2.0         splines_3.6.1       multtest_2.42.0    
[64] hms_0.5.2           zeallot_0.1.0       knitr_1.26         
[67] pillar_1.4.2        igraph_1.2.4.2      boot_1.3-22        
[70] reshape2_1.4.3      codetools_0.2-16    stats4_3.6.1       
[73] reprex_0.3.0        glue_1.3.1          evaluate_0.14      
[76] modelr_0.1.5        vctrs_0.2.0         nloptr_1.2.1       
[79] httpuv_1.5.2        foreach_1.4.7       cellranger_1.1.0   
[82] gtable_0.3.0        assertthat_0.2.1    xfun_0.11          
[85] broom_0.5.2         later_1.0.0         survival_2.44-1.1  
[88] iterators_1.0.12    IRanges_2.20.1      workflowr_1.5.0    
[91] cluster_2.1.0