Last updated: 2020-07-31
Checks: 7 0
Knit directory: jesslyn_ovca/analysis/
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.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
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(20200713) 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 284aad4. 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: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: code/.DS_Store
Ignored: data/.DS_Store
Ignored: data/HTAPP/
Ignored: data/Izar_2020/
Ignored: data/gene_lists/.DS_Store
Ignored: data/gene_lists/extra/.DS_Store
Ignored: jesslyn_plots/
Ignored: mike_plots/
Ignored: old/.DS_Store
Ignored: old/edited/.DS_Store
Ignored: renv/.DS_Store
Ignored: renv/library/
Ignored: renv/python/
Ignored: renv/staging/
Ignored: vignettes/
Unstaged changes:
Modified: old/edited/02_Izar2020_SS2_Load_Plots.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.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/03.2_Izar2020_PDX_CellCycleAnalysis.Rmd) and HTML (docs/03.2_Izar2020_PDX_CellCycleAnalysis.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 284aad4 | jgoh2 | 2020-07-31 | workflowr::wflow_publish(files = files) |
| Rmd | c8bb9fc | jgoh2 | 2020-07-30 | PDX Exploratory + DE + Cell Cycle Analyses |
| html | c8bb9fc | jgoh2 | 2020-07-30 | PDX Exploratory + DE + Cell Cycle Analyses |
This is the fifth part of our 5-part analysis of the Izar 2020 PDX (Cohort 3) data.
We are interested in answering a few questions for our Cell Cycle Analysis:
CELL CYCLE ANALYSIS
# Load packages
source(here::here('packages.R'))
#Read in PDX RDS object
PDX_All = readRDS("data/Izar_2020/test/jesslyn_PDX_All_processed.RDS")
PDX_DF20 = readRDS("data/Izar_2020/test/jesslyn_PDX_DF20_processed.RDS")
PDX_DF101 = readRDS("data/Izar_2020/test/jesslyn_PDX_DF101_processed.RDS")
PDX_DF68 = readRDS("data/Izar_2020/test/jesslyn_PDX_DF68_processed.RDS")
#center module and cell cycle scores and reassign to the metadata of each Seurat object
hm.names <- names(PDX_All@meta.data)[9:48]
for(i in hm.names){
DF20.hm.centered <- scale(PDX_DF20[[i]], center = TRUE, scale = FALSE)
PDX_DF20 <- AddMetaData(PDX_DF20, DF20.hm.centered, col.name = glue("{i}.centered"))
DF101.hm.centered <- scale(PDX_DF101[[i]], center = TRUE, scale = FALSE)
PDX_DF101 <- AddMetaData(PDX_DF101, DF101.hm.centered, col.name = glue("{i}.centered"))
DF68.hm.centered <- scale(PDX_DF68[[i]], center = TRUE, scale = FALSE)
PDX_DF68 <- AddMetaData(PDX_DF68, DF68.hm.centered, col.name = glue("{i}.centered"))
}
In our Exploratory Analysis section, we observed that PC_2 captures Cell Cycle Phase, S.Score and G2M scores, as cells in the same phase or have high S or G2M scores are found to be near each other on the PC_2 Axis. However, cells did not seem to cluster by treatment status. We now use a more quantitative approach to investigate the correlation between treatment and cell cycle phase.
#Stacked Bar Plot --------------------------
hms.centered <- c("UNUPDATED.OXPHOS37.centered", "UNUPDATED.UPR38.centered")
PDXs <- c(PDX_DF20, PDX_DF101, PDX_DF68)
PDX.names <- c("DF20", "DF101", "DF68")
bar.plots <- vector("list", length = 3)
names(bar.plots) <- PDX.names
for(i in 1:length(PDXs)){
obj = PDXs[[i]]
name = PDX.names[[i]]
numCells = nrow(obj@meta.data)
obj$Phase <- factor(obj$Phase, levels = c("G1", "S", "G2M"))
t = table(obj$Phase, obj$treatment.status) %>%
as.data.frame() %>%
rename(Phase = Var1, Treatment = Var2, numCells = Freq)
sum = c()
z = 1
while(z < nrow(t)){
n = t$numCells[z] + t$numCells[z+1] + t$numCells[z+2]
sum = c(sum, rep(n,3))
z = z + 3
}
t <- t %>% mutate(total = sum) %>% mutate(percent = (numCells/total)*100)
p = t %>%
ggplot(aes(x=Treatment, y=percent, fill=Phase)) +
geom_bar(stat="identity") +
labs(title = glue("{name} % of Malignant Cells in Each Cell Cycle Phase/ Treatment"), subtitle = glue("Total # Cells in {name}: {numCells}"), caption = "Labeled by # cells in each phase per treatment") +
theme(plot.title = element_text(size = 10), plot.subtitle = element_text(size = 10), plot.caption = element_text(size = 8)) +
geom_text(aes(label = numCells), position = "stack", hjust = 0.5, vjust = 2, size = 3, color = "white")
bar.plots[[i]] <- p
}
bar.plots[["DF20"]] + bar.plots[["DF101"]] + bar.plots[["DF68"]] + plot_layout(guides= 'collect')

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
To investigate this further, we build violin plots of cell cycle scores separated by treatment status.
#VlnPlot -------------------------
cc.Vln.plots <- vector("list", length = 3)
names(cc.Vln.plots) <- PDX.names
for (i in 1:length(PDXs)){
obj <- PDX.names[[i]]
numCells = nrow(PDXs[[i]]@meta.data)
my_comparisons <- list(
c("MRD", "vehicle"),
c("MRD", "relapse"),
c("vehicle", "relapse")
)
if(obj == "DF101"){
p <- VlnPlot(PDXs[[i]], features = c("S.Score.centered", "G2M.Score.centered"), group.by = "treatment.status", pt.size = 0, combine = F, y.max = 4.3, c("#00AFBB", "#E7B800", "#FC4E07"))
}
else{
p <- VlnPlot(PDXs[[i]], features = c("S.Score.centered", "G2M.Score.centered"), group.by = "treatment.status", pt.size = 0, combine = F, y.max = 4, c("#00AFBB", "#E7B800", "#FC4E07"))
}
p[[1]] <- p[[1]] + labs(title = glue("{obj} S.Score across treatment"), x = obj, subtitle = glue("Number of cells in {obj}: {numCells}")) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F) +
geom_text(label = paste(sum(PDXs[[i]]$treatment.status == "vehicle"), "cells"), x = "vehicle", y = min(PDXs[[i]]$S.Score.centered) -0.03) +
geom_text(label = paste(sum(PDXs[[i]]$treatment.status == "MRD"), "cells"), x = "MRD", y = min(PDXs[[i]]$S.Score.centered) - 0.03) +
geom_text(label = paste(sum(PDXs[[i]]$treatment.status == "relapse"), "cells"), x = "relapse", y = min(PDXs[[i]]$S.Score.centered) - 0.03) +
stat_compare_means(comparisons = my_comparisons, method = "wilcox.test", label = "p.format", step.increase = 0.06) +
stat_compare_means(comparisons = my_comparisons, method = "wilcox.test", label = "p.signif", step.increase = 0.06, bracket.size = 0, vjust = 1.8)
p[[2]] <- p[[2]] + labs(title = glue("{obj} G2M.Score across treatment"), x = obj) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F) +
stat_compare_means(comparisons = my_comparisons, method = "wilcox.test", label = "p.format", step.increase = 0.06) +
stat_compare_means(comparisons = my_comparisons, method = "wilcox.test", label = "p.signif", step.increase = 0.06, bracket.size = 0, vjust = 1.8)
cc.Vln.plots[[obj]] <- p[[1]] + p[[2]] + plot_layout(guides= 'collect')
}
cc.Vln.plots[["DF20"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
cc.Vln.plots[["DF101"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
cc.Vln.plots[["DF68"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
Our results from above collectively suggest that OXPHOS and UPR expression, and cell cycle phase, do not significantly correlate with the treatment condition a cell is in. However, considering the idea that cell cycle might influence the expression of signatures, we are now interested in examining whether there is a correlation between the expression of OXPHOS and UPR and cell cycle phase.
cc.exp.plot <- vector("list", length = 3)
names(cc.exp.plot) <- PDX.names
for(i in 1:length(PDXs)){
obj = PDXs[[i]]
name = PDX.names[[i]]
numCells = nrow(obj@meta.data)
obj$Phase <- factor(obj$Phase, levels = c("G1", "S", "G2M"))
p1 <- VlnPlot(obj, features = hms.centered, group.by = "Phase", pt.size = 0, combine = FALSE, c("#00AFBB", "#E7B800", "#FC4E07"))
p1[[1]] <- p1[[1]] + labs(title = glue("{name} OXPHOS score by Cell Cycle Phase"), subtitle = glue("Number of cells in {name}: {numCells}")) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F)+
geom_text(label = paste(sum(obj$Phase == "G1"), "cells"), x = "G1", y = min(obj$HALLMARK_OXIDATIVE_PHOSPHORYLATION25.centered) -0.03) +
geom_text(label = paste(sum(obj$Phase == "G2M"), "cells"), x = "G2M", y = min(obj$HALLMARK_OXIDATIVE_PHOSPHORYLATION25.centered) - 0.03) +
geom_text(label = paste(sum(obj$Phase == "S"), "cells"), x = "S", y = min(obj$HALLMARK_OXIDATIVE_PHOSPHORYLATION25.centered) - 0.03)
p1[[2]] <- p1[[2]] + labs(title = glue("{name} UPR score by Cell Cycle Phase")) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F)
p2 <- VlnPlot(obj, features = hms.centered, group.by = "treatment.status", split.by = "Phase", pt.size = 0, combine = FALSE, c("#00AFBB", "#FC4E07", "#E7B800"))
p2[[1]] <- p2[[1]] + labs(title = glue("{name} OXPHOS score by Cell Cycle Phase / Treatment")) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F)
p2[[2]] <- p2[[2]] + labs(title = glue("{name} UPR score by Cell Cycle Phase / Treatment")) +
geom_boxplot(width = 0.15, position = position_dodge(0.9), alpha = 0.3, show.legend = F)
cc.exp.plot[[i]] <- p1[[1]] + p1[[2]] + p2[[1]]+ p2[[2]] + plot_layout(guides= 'collect')
}
cc.exp.plot[["DF20"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
cc.exp.plot[["DF101"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
cc.exp.plot[["DF68"]]

| Version | Author | Date |
|---|---|---|
| c8bb9fc | jgoh2 | 2020-07-30 |
note: our sample size is extremely small for each condition, which may mean that we have really low power
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] ggpubr_0.4.0 GGally_2.0.0 gt_0.2.1 reshape2_1.4.4 tidyselect_1.1.0
[6] presto_1.0.0 data.table_1.12.8 Rcpp_1.0.5 glue_1.4.1 patchwork_1.0.1
[11] EnhancedVolcano_1.6.0 ggrepel_0.8.2 here_0.1 readxl_1.3.1 forcats_0.5.0
[16] stringr_1.4.0 dplyr_1.0.0 purrr_0.3.4 readr_1.3.1 tidyr_1.1.0
[21] tibble_3.0.3 ggplot2_3.3.2 tidyverse_1.3.0 cowplot_1.0.0 Seurat_3.1.5
[26] BiocManager_1.30.10 renv_0.11.0-4
loaded via a namespace (and not attached):
[1] Rtsne_0.15 colorspace_1.4-1 ggsignif_0.6.0 rio_0.5.16 ellipsis_0.3.1 ggridges_0.5.2
[7] rprojroot_1.3-2 fs_1.4.2 rstudioapi_0.11 farver_2.0.3 leiden_0.3.3 listenv_0.8.0
[13] fansi_0.4.1 lubridate_1.7.9 xml2_1.3.2 codetools_0.2-16 splines_4.0.2 knitr_1.29
[19] jsonlite_1.7.0 workflowr_1.6.2 broom_0.7.0 ica_1.0-2 cluster_2.1.0 dbplyr_1.4.4
[25] png_0.1-7 uwot_0.1.8 sctransform_0.2.1 compiler_4.0.2 httr_1.4.1 backports_1.1.8
[31] assertthat_0.2.1 Matrix_1.2-18 lazyeval_0.2.2 cli_2.0.2 later_1.1.0.1 htmltools_0.5.0
[37] tools_4.0.2 rsvd_1.0.3 igraph_1.2.5 gtable_0.3.0 RANN_2.6.1 carData_3.0-4
[43] cellranger_1.1.0 vctrs_0.3.2 ape_5.4 nlme_3.1-148 lmtest_0.9-37 xfun_0.15
[49] globals_0.12.5 openxlsx_4.1.5 rvest_0.3.5 lifecycle_0.2.0 irlba_2.3.3 rstatix_0.6.0
[55] future_1.18.0 MASS_7.3-51.6 zoo_1.8-8 scales_1.1.1 hms_0.5.3 promises_1.1.1
[61] parallel_4.0.2 RColorBrewer_1.1-2 curl_4.3 yaml_2.2.1 reticulate_1.16 pbapply_1.4-2
[67] gridExtra_2.3 reshape_0.8.8 stringi_1.4.6 zip_2.0.4 rlang_0.4.7 pkgconfig_2.0.3
[73] evaluate_0.14 lattice_0.20-41 ROCR_1.0-11 labeling_0.3 htmlwidgets_1.5.1 RcppAnnoy_0.0.16
[79] plyr_1.8.6 magrittr_1.5 R6_2.4.1 generics_0.0.2 DBI_1.1.0 foreign_0.8-80
[85] pillar_1.4.6 haven_2.3.1 whisker_0.4 withr_2.2.0 fitdistrplus_1.1-1 abind_1.4-5
[91] survival_3.2-3 future.apply_1.6.0 tsne_0.1-3 car_3.0-8 modelr_0.1.8 crayon_1.3.4
[97] KernSmooth_2.23-17 plotly_4.9.2.1 rmarkdown_2.3 grid_4.0.2 blob_1.2.1 git2r_0.27.1
[103] reprex_0.3.0 digest_0.6.25 httpuv_1.5.4 munsell_0.5.0 viridisLite_0.3.0