Last updated: 2021-02-10

Checks: 6 1

Knit directory: esoph-micro-cancer-workflow/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). 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(20200916) 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 results in this page were generated with repository version 1e15f06. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

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/
    Ignored:    data/

Untracked files:
    Untracked:  analysis/species-sample-type-combined.Rmd

Unstaged changes:
    Modified:   analysis/index.Rmd
    Modified:   analysis/results-question-3.Rmd

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.


# merge datasets by subsetting to specific variables then merging
analysis.dat <- dat.16s.s %>% 
  mutate(ID = as.factor(accession.number)) %>%
  select(OTU, sample_type, Abundance, ID, source)

dat <- dat.rna.s %>% 
  select(OTU, sample_type, Abundance, ID, source)
analysis.dat <- full_join(analysis.dat, dat)

dat <- dat.wgs.s %>% 
  select(OTU, sample_type, Abundance, ID, source)

analysis.dat <- full_join(analysis.dat, dat) %>%
  mutate(pres = ifelse(Abundance > 0, 1, 0)) # create a presence/absences variable


tb <- analysis.dat %>%
  filter(is.na(sample_type)==F)%>%
  group_by(sample_type, OTU) %>%
  summarise(
    N=n(),
    p = sum(pres, na.rm=T),
    percent = p/N*100
  )

kable(tb, format="html")%>%
  kable_styling(full_width = T)
sample_type OTU N p percent
16SrRNA Barrett’s (BO) Fusobacterium nucleatum 5 3 60.00000
16SrRNA Barrett’s (BO) Streptococcus spp. 5 5 100.00000
16SrRNA Barrett’s (BO) Campylobacter concisus 5 2 40.00000
16SrRNA Barrett’s (BO) Prevotella melaninogenica 5 4 80.00000
16SrRNA Non-tumor (w/ Barrett’s history) Fusobacterium nucleatum 43 19 44.18605
16SrRNA Non-tumor (w/ Barrett’s history) Streptococcus spp. 43 41 95.34884
16SrRNA Non-tumor (w/ Barrett’s history) Campylobacter concisus 43 6 13.95349
16SrRNA Non-tumor (w/ Barrett’s history) Prevotella melaninogenica 43 28 65.11628
16SrRNA Tumor (w/Barrett’s history) Fusobacterium nucleatum 35 16 45.71429
16SrRNA Tumor (w/Barrett’s history) Streptococcus spp. 35 33 94.28571
16SrRNA Tumor (w/Barrett’s history) Campylobacter concisus 35 9 25.71429
16SrRNA Tumor (w/Barrett’s history) Prevotella melaninogenica 35 27 77.14286
RNA-seq Non-tumor (w/o Barrett’s history) Fusobacterium nucleatum 7 5 71.42857
RNA-seq Non-tumor (w/o Barrett’s history) Streptococcus spp. 42 30 71.42857
RNA-seq Non-tumor (w/o Barrett’s history) Campylobacter concisus 7 4 57.14286
RNA-seq Non-tumor (w/o Barrett’s history) Prevotella melaninogenica 7 4 57.14286
RNA-seq Tumor (w/o Barrett’s history) Fusobacterium nucleatum 47 16 34.04255
RNA-seq Tumor (w/o Barrett’s history) Streptococcus spp. 282 92 32.62411
RNA-seq Tumor (w/o Barrett’s history) Campylobacter concisus 47 5 10.63830
RNA-seq Tumor (w/o Barrett’s history) Prevotella melaninogenica 47 15 31.91489
WGS Non-tumor (w/o Barrett’s history) Fusobacterium nucleatum 10 5 50.00000
WGS Non-tumor (w/o Barrett’s history) Streptococcus spp. 60 37 61.66667
WGS Non-tumor (w/o Barrett’s history) Campylobacter concisus 10 5 50.00000
WGS Non-tumor (w/o Barrett’s history) Prevotella melaninogenica 10 7 70.00000
WGS Tumor (w/o Barrett’s history) Fusobacterium nucleatum 11 6 54.54545
WGS Tumor (w/o Barrett’s history) Streptococcus spp. 66 31 46.96970
WGS Tumor (w/o Barrett’s history) Campylobacter concisus 11 3 27.27273
WGS Tumor (w/o Barrett’s history) Prevotella melaninogenica 11 7 63.63636
analysis.dat <- analysis.dat %>%
  filter(is.na(sample_type)==F)%>%
  mutate(
    Abund = Abundance*100
  )
p <- ggplot(analysis.dat, aes(sample_type, Abund)) +
  geom_violin(scale="width", adjust=0.5)+
  geom_point(alpha=0.75)+
  scale_y_continuous(trans="sqrt")+
  annotate("text", x=c(1, 3), y=c(95, 95), label=c(paste0(tb[1,5],"% (",tb[1,4],",",tb[1,3],")"),"round 2"))+
  theme(
    axis.text.x = element_text(angle=30, hjust=0.95, vjust=0.95)
  )
p


sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

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] cowplot_1.1.1     dendextend_1.14.0 ggdendro_0.1.22   reshape2_1.4.4   
 [5] car_3.0-10        carData_3.0-4     gvlma_1.0.0.3     patchwork_1.1.1  
 [9] viridis_0.5.1     viridisLite_0.3.0 gridExtra_2.3     xtable_1.8-4     
[13] kableExtra_1.3.1  data.table_1.13.6 readxl_1.3.1      forcats_0.5.1    
[17] stringr_1.4.0     dplyr_1.0.3       purrr_0.3.4       readr_1.4.0      
[21] tidyr_1.1.2       tibble_3.0.6      ggplot2_3.3.3     tidyverse_1.3.0  
[25] lmerTest_3.1-3    lme4_1.1-26       Matrix_1.2-18     vegan_2.5-7      
[29] lattice_0.20-41   permute_0.9-5     phyloseq_1.34.0   workflowr_1.6.2  

loaded via a namespace (and not attached):
 [1] minqa_1.2.4         colorspace_2.0-0    rio_0.5.16         
 [4] ellipsis_0.3.1      rprojroot_2.0.2     XVector_0.30.0     
 [7] fs_1.5.0            rstudioapi_0.13     farver_2.0.3       
[10] lubridate_1.7.9.2   xml2_1.3.2          codetools_0.2-16   
[13] splines_4.0.3       knitr_1.31          ade4_1.7-16        
[16] jsonlite_1.7.2      nloptr_1.2.2.2      broom_0.7.4        
[19] cluster_2.1.0       dbplyr_2.1.0        BiocManager_1.30.10
[22] compiler_4.0.3      httr_1.4.2          backports_1.2.1    
[25] assertthat_0.2.1    cli_2.3.0           later_1.1.0.1      
[28] htmltools_0.5.1.1   prettyunits_1.1.1   tools_4.0.3        
[31] igraph_1.2.6        gtable_0.3.0        glue_1.4.2         
[34] Rcpp_1.0.6          Biobase_2.50.0      cellranger_1.1.0   
[37] vctrs_0.3.6         Biostrings_2.58.0   rhdf5filters_1.2.0 
[40] multtest_2.46.0     ape_5.4-1           nlme_3.1-149       
[43] iterators_1.0.13    xfun_0.20           ps_1.5.0           
[46] openxlsx_4.2.3      rvest_0.3.6         lifecycle_0.2.0    
[49] statmod_1.4.35      zlibbioc_1.36.0     MASS_7.3-53        
[52] scales_1.1.1        hms_1.0.0           promises_1.1.1     
[55] parallel_4.0.3      biomformat_1.18.0   rhdf5_2.34.0       
[58] curl_4.3            yaml_2.2.1          stringi_1.5.3      
[61] highr_0.8           S4Vectors_0.28.1    foreach_1.5.1      
[64] BiocGenerics_0.36.0 zip_2.1.1           boot_1.3-25        
[67] rlang_0.4.10        pkgconfig_2.0.3     evaluate_0.14      
[70] Rhdf5lib_1.12.1     labeling_0.4.2      tidyselect_1.1.0   
[73] plyr_1.8.6          magrittr_2.0.1      R6_2.5.0           
[76] IRanges_2.24.1      generics_0.1.0      DBI_1.1.1          
[79] foreign_0.8-80      pillar_1.4.7        haven_2.3.1        
[82] withr_2.4.1         mgcv_1.8-33         abind_1.4-5        
[85] survival_3.2-7      modelr_0.1.8        crayon_1.4.1       
[88] rmarkdown_2.6       progress_1.2.2      grid_4.0.3         
[91] git2r_0.28.0        reprex_1.0.0        digest_0.6.27      
[94] webshot_0.5.2       httpuv_1.5.5        numDeriv_2016.8-1.1
[97] stats4_4.0.3        munsell_0.5.0