Last updated: 2022-02-10

Checks: 7 0

Knit directory: MelanomaIMC/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). 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(20200728) 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 a2860df. 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:    .Rproj.user/
    Ignored:    Table_S4.csv
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/._.DS_Store
    Ignored:    code/.DS_Store
    Ignored:    code/._.DS_Store
    Ignored:    data/.DS_Store
    Ignored:    data/._.DS_Store
    Ignored:    data/data_for_analysis/
    Ignored:    data/full_data/

Unstaged changes:
    Modified:   analysis/Figure_5.rmd
    Modified:   analysis/Supp-Figure_12.rmd
    Modified:   analysis/Supp-Figure_13.rmd
    Modified:   analysis/Supp-Figure_5.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/08_color_vectors.rmd) and HTML (docs/08_color_vectors.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 3da15db toobiwankenobi 2021-11-24 changes for revision
html 4109ff1 toobiwankenobi 2021-07-07 delete html files and adapt gitignore
Rmd 3203891 toobiwankenobi 2021-02-19 change celltype names
html 3203891 toobiwankenobi 2021-02-19 change celltype names
Rmd ee1595d toobiwankenobi 2021-02-12 clean repo and adapt files
html ee1595d toobiwankenobi 2021-02-12 clean repo and adapt files
Rmd 2e443a5 toobiwankenobi 2021-02-09 remove files that are not needed

Introduction

Color schemes

Preparations

knitr::opts_chunk$set(echo = TRUE, message= FALSE)
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())

Load libraries

library(SingleCellExperiment)
library(colorRamps)

Load data

sce_rna <- readRDS("data/data_for_analysis/sce_RNA.rds")
sce_prot <- readRDS("data/data_for_analysis/sce_protein.rds")

All celltypes

colvec <- c("sienna4", "tomato", "gray65", "red3", "blueviolet", "deeppink", "blueviolet",
         "darkorchid1", "deepskyblue", "darkblue", "deepskyblue","aquamarine", "green",
         "darkgreen", "yellow")

names(colvec) <- c("Tumor", "Stroma", "unknown", "Vasculature", "CD8- T cell", "CD8+ T cell", "CD4+ T cell",
           "FOXP3+ T cell", "B cell", "BnT cell", "HLA-DR", "CD38" ,"Macrophage", "Neutrophil", "pDC")

pie(c(rep(1,length((colvec)))),col = colvec,labels = names(colvec))

col_celltypes <- colvec
names(col_celltypes) <- names(colvec)

RNA

Celltypes

cell_rna <- col_celltypes[c("Tumor", "Stroma", "unknown", "Vasculature", "CD8- T cell", 
                            "CD8+ T cell", "HLA-DR", "CD38","Macrophage", "Neutrophil")]

metadata(sce_rna)$colour_vectors$celltype <- cell_rna

Chemokines (Combinations)

# add color vector to metadata
targets <- metadata(sce_rna)$chemokines_morethan600_withcontrol
color_chemo <- primary.colors(length(targets))
names(color_chemo) <- targets

#barplot(seq_along(targets), col=color_chemo, main="Pastel_hcl", names.arg = targets)
metadata(sce_rna)$colour_vectors$chemokine_combinations <- color_chemo

Chemokines (single)

col_vector_chemokines <- metadata(sce_rna)$colour_vector$chemokine_combinations
col_vector_chemokines <- col_vector_chemokines[c("CXCL13", "CXCL10", "CXCL9", "CCL2", "CXCL12", "CCL19", "CCL18", "CXCL8", "CCL4", "CCL22")]
col_vector_new_chemo <- c("forestgreen")
names(col_vector_new_chemo) <- c("CCL8")
  
col_vector_chemokines <- c(col_vector_chemokines, col_vector_new_chemo)

metadata(sce_rna)$colour_vectors$chemokine_single <- col_vector_chemokines

Protein

Celltypes

cell_protein <- col_celltypes[c("Tumor", "Stroma", "unknown", "CD8+ T cell", 
                                "CD4+ T cell", "FOXP3+ T cell", "B cell", "BnT cell",
                                "Macrophage", "Neutrophil", "pDC")]

metadata(sce_prot)$colour_vectors$celltype <- cell_protein

Save RDS

saveRDS(sce_rna, "data/data_for_analysis/sce_RNA.rds")
saveRDS(sce_prot, "data/data_for_analysis/sce_protein.rds")

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] colorRamps_2.3              SingleCellExperiment_1.16.0
 [3] SummarizedExperiment_1.24.0 Biobase_2.54.0             
 [5] GenomicRanges_1.46.1        GenomeInfoDb_1.30.1        
 [7] IRanges_2.28.0              S4Vectors_0.32.3           
 [9] BiocGenerics_0.40.0         MatrixGenerics_1.6.0       
[11] matrixStats_0.61.0          workflowr_1.7.0            

loaded via a namespace (and not attached):
 [1] xfun_0.29              bslib_0.3.1            lattice_0.20-45       
 [4] vctrs_0.3.8            htmltools_0.5.2        yaml_2.2.2            
 [7] utf8_1.2.2             rlang_1.0.0            jquerylib_0.1.4       
[10] later_1.3.0            pillar_1.7.0           glue_1.6.1            
[13] GenomeInfoDbData_1.2.7 lifecycle_1.0.1        stringr_1.4.0         
[16] zlibbioc_1.40.0        evaluate_0.14          knitr_1.37            
[19] callr_3.7.0            fastmap_1.1.0          httpuv_1.6.5          
[22] ps_1.6.0               fansi_1.0.2            highr_0.9             
[25] Rcpp_1.0.8             promises_1.2.0.1       DelayedArray_0.20.0   
[28] jsonlite_1.7.3         XVector_0.34.0         fs_1.5.2              
[31] digest_0.6.29          stringi_1.7.6          processx_3.5.2        
[34] getPass_0.2-2          grid_4.1.2             rprojroot_2.0.2       
[37] cli_3.1.1              tools_4.1.2            bitops_1.0-7          
[40] magrittr_2.0.2         sass_0.4.0             RCurl_1.98-1.5        
[43] tibble_3.1.6           crayon_1.4.2           whisker_0.4           
[46] pkgconfig_2.0.3        Matrix_1.4-0           ellipsis_0.3.2        
[49] rmarkdown_2.11         httr_1.4.2             rstudioapi_0.13       
[52] R6_2.5.1               git2r_0.29.0           compiler_4.1.2