Last updated: 2021-08-16
Checks: 7 0
Knit directory: Turati_NatCancer_2021/
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(20200627)
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 9254340. 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: bulkRNA/
Ignored: data/bulk4_counts.rda
Ignored: data/bulk4_dds.rda
Ignored: data/paper_palette.rda
Ignored: data/signatures.rda
Ignored: output/deseq2-mini_bulk4_dds.3pts-Treated-vs-Untreated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt1-Treated-vs-Untreated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt12-Treated-vs-Untreated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt13-Treated-vs-Untreated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt2-Acutely treated-vs-Chronically treated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt2-Acutely treated-vs-Never treated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt2-Chronically treated-vs-Never treated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt2-Relapse-vs-Never treated.rds
Ignored: output/deseq2-mini_bulk4_dds.pt2-Treatment withdrawn-vs-Never treated.rds
Ignored: output/fgsea_results.RDS
Ignored: output/figures/ExtFig5a_pca_3patients.pdf
Ignored: output/figures/ExtFig5b_pca_treatment_response.pdf
Ignored: output/figures/Fig5C_fgsea_selected_signatures.pdf
Ignored: output/figures/ItemS2.pdf
Ignored: output/tables/ExtFig5a_bulkRNAseq_data.xlsx
Ignored: output/tables/ExtFig5b_bulkRNAseq_data.xlsx
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/data-ancillary.Rmd
) and HTML (docs/data-ancillary.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 |
---|---|---|---|---|
html | b6f5b35 | Javier Herrero | 2021-08-13 | Build site. |
html | 537463a | Javier Herrero | 2021-08-13 | Update site |
Rmd | 73647b7 | Javier Herrero | 2021-08-13 | Adding the “Data / Ancillary” page |
html | 73647b7 | Javier Herrero | 2021-08-13 | Adding the “Data / Ancillary” page |
# knitr::opts_chunk$set(cache = T, autodep = T)
library(tidyverse)
library(DT)
Several signatures/gene sets are used in this analysis.
MSigDB: all signatures have been downloaded using the msigdbr
package.
Lineage signatures: from Laurenti et al (ProB, MLP, MEP, HSC, GMP, ETP, EarlyB, CMP)
Cell state: from Tirosh et al (Tirosh_G1_S, Tirosh_G2_M, TIROSH_Stemness)
msigdbr_full_signatures_table <- msigdbr::msigdbr("Homo sapiens")
groups <- msigdbr_full_signatures_table %>%
group_by(gs_cat, gs_subcat) %>%
summarise(n = n()) %>%
mutate(name = ifelse(gs_subcat != "", paste0(gs_cat, "-", gs_subcat), gs_cat))
`summarise()` regrouping output by 'gs_cat' (override with `.groups` argument)
signatures <- list()
sink <- groups %>% apply(1, function(x) {
signatures[[x["name"]]] <<- msigdbr_full_signatures_table %>%
filter(gs_cat == x["gs_cat"] & gs_subcat == x["gs_subcat"]) %>%
split(x = .$gene_symbol, f = .$gs_name)
})
# This table is available from Laurenti et al.
laurenti_signatures <- read.table("data-raw/PopSpecificSignatures_250.gmx", header = T)
sink <- lapply(colnames(laurenti_signatures), function(x) {
signatures[["lineages"]][[x]] <<- as.character(laurenti_signatures[, x])
})
# This table was extracted from Tirosh et al.
cell_state_signatures <- fgsea::gmtPathways("data-raw/cell_state.gmt")
sink <- lapply(names(cell_state_signatures), function(x) {
signatures[["cell_state"]][[x]] <<- as.character(cell_state_signatures[[x]])
})
usethis::use_directory("data")
✓ Setting active project to '/Users/javier/Projects/Turati_NatCancer_2021'
save(signatures, file = "data/signatures.rda")
Here is a list of the different signature sets:
enframe(sapply(signatures, length), name = "set", "number") %>%
left_join(enframe(sapply(signatures, function(x) {
num <- length(x)
if (num > 10) {
names <- paste(c(names(x)[1:10], "..."), collapse = ",")
} else {
names <- paste(names(x), collapse = ",")
}
return(names)
}), name = "set", "signatures"), by = "set") %>%
DT::datatable()
To use the signatures, simply do:
data("signatures")
hallmarks <- signatures[["H"]]
lineages <- signatures[["lineages"]]
cell_cycle_genes <- signatures[["lineages"]][["GO_CELL_CYCLE"]]
# Combinations
pathways <- c(signatures[["lineages"]], signatures[["H"]])
names(pathways) <- gsub("HALLMARK_", "", names(pathways))
To use the paper palette with ggplot2, simply do:
data("paper_palette")
ggplot() +
... +
scale_fill_manual(values = paper_palette) +
...
paper_palette <- c(
## Bulk treated
"BulkChemotherapy" = "#AF4FAF",
"Chemotherapy" = "#AF4FAF",
"Treated" = "#AF4FAF",
## Bulk relapse (240, 146, 242)
"BulkRelapse" = "#F092F2",
"Relapse" = "#F092F2",
## Bulk untreated (for simple)
"BulkUntreated" = "#43B0E3",
"Untreated" = "#43B0E3",
## Diagnosis
"Diagnosis" = "#E38522",
"MRD" = "#30AF30",
## PRS
"PRS" = "#307F7F",
## Cell cycle: deep quiescent
"Deep" = "#959867",
"DeepQ" = "#959867",
## Cell cycle: shallow quiescent
"Shallow" = "#94BE69",
"ShallowQ" = "#94BE69",
## Cell cycle: cycling
"Cycling" = "#CA4B1F",
"Cycling" = "#CA4B1F",
## Bulk headache: T/T (231, 119, 108)
"chem-chem" = "#E7776C",
"Chronically treated" = "#E7776C",
## Bulk headache: T/U
"chem-nochem" = "#A1A22C",
"Treatment Withdrawn" = "#A1A22C",
"Treatment withdrawn" = "#A1A22C",
## Bulk headache: U/T
"nochem-chem" = "#55B583",
"Acutely treated" = "#55B583",
## Bulk headache: U/U
"nochem-nochem" = "#0416C8",
"Untreated" = "#0416C8",
"Never treated" = "#0416C8",
## Lineages
"ProB" = "#AF4AFF",
"MLP" = "#797FF4",
"MEP" = "#44B4FF",
"HSC" = "#4BD6B3",
"GMP" = "#67F16C",
"ETP" = "#97A645",
"EarlyB" = "#CCB43D",
"CMP" = "#F88134",
"pre-BII" = "#FF4C24",
"pre-BI" = "#AB0300",
## Yes/No
"Yes"= "#307F7F",
"No" = "#B4B4B4")
usethis::use_directory("data")
save(paper_palette, file = "data/paper_palette.rda")
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.7
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DT_0.13 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.0
[5] purrr_0.3.3 readr_1.3.1 tidyr_1.0.2 tibble_2.1.3
[9] ggplot2_3.3.1 tidyverse_1.3.0 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4 lubridate_1.7.4 lattice_0.20-40
[4] assertthat_0.2.1 rprojroot_1.3-2 digest_0.6.25
[7] R6_2.4.1 cellranger_1.1.0 backports_1.1.5
[10] reprex_0.3.0 evaluate_0.14 httr_1.4.1
[13] pillar_1.4.3 rlang_0.4.11 readxl_1.3.1
[16] rstudioapi_0.11 data.table_1.12.8 whisker_0.4
[19] Matrix_1.2-18 rmarkdown_2.1 BiocParallel_1.20.1
[22] htmlwidgets_1.5.1 munsell_0.5.0 broom_0.5.5
[25] fgsea_1.12.0 compiler_3.6.3 httpuv_1.5.2
[28] modelr_0.1.6 xfun_0.16 pkgconfig_2.0.3
[31] base64enc_0.1-3 htmltools_0.5.1.1 tidyselect_1.1.0
[34] gridExtra_2.3 crayon_1.3.4 dbplyr_1.4.2
[37] withr_2.4.2 later_1.0.0 grid_3.6.3
[40] nlme_3.1-145 jsonlite_1.6.1 gtable_0.3.0
[43] lifecycle_0.2.0 DBI_1.1.0 git2r_0.26.1
[46] magrittr_1.5 scales_1.1.0 cli_3.0.0
[49] stringi_1.4.6 msigdbr_7.0.1 fs_1.3.2
[52] promises_1.1.0 xml2_1.2.5 ellipsis_0.3.0
[55] generics_0.0.2 vctrs_0.3.0 fastmatch_1.1-0
[58] tools_3.6.3 glue_1.3.2 crosstalk_1.1.0.1
[61] hms_0.5.3 parallel_3.6.3 yaml_2.2.1
[64] colorspace_1.4-1 rvest_0.3.5 knitr_1.28
[67] haven_2.2.0 usethis_2.0.1