Geneset enrichment gsva scores correlations – Schulte-Schrepping et al

Generate Figure S4F

### scores were calculated based on LE genes for from severity comparison
FIG_OUT_PATH <- "Schulte-Schrepping/output/"
combined_genesets <- c("HALLMARK_TNFA_SIGNALING_VIA_NFKB", 
                       "reactome_Fatty acid metabolism")

severity_gsva_esetlist <- readRDS("../input/SchulteSchrepping/cohort1/severe-mild_module_score_gsva_filtered_samples_genes_cohort1.rds")
severity_gsva_esetlist_df <- getgsvascore_list_df(severity_gsva_esetlist, combined_genesets)
## [1] "0_Classical Monocytes"
## [1] "1_HLA-DR+ CD83+ Monocytes"
## [1] "10_CD4+ T cells_2"
## [1] "11_CD4+ T cells_3"
## [1] "12_CD8+ T cells_1"
## [1] "13_CD8+ T cells_2"
## [1] "14_CD8+ T cells_3"
## [1] "15_NK cells"
## [1] "16_B cells_1"
## [1] "19_Plasmablasts"
## [1] "20_Megakaryocyte"
## [1] "3_HLA-DR- S100A+ monocytes"
## [1] "4_Non-classical Monocytes"
## [1] "5_Neutrophils"
## [1] "7_mDCs"
## [1] "9_CD4+ T cells_1"
severity_gsva_esetlist_df_T0 <- severity_gsva_esetlist_df %>% filter(Timepoint == "T0", celltype == "15_NK cells")

severity_gsva_esetlist_cohort2 <- readRDS("../input/SchulteSchrepping/cohort2/severe-mild_module_score_gsva_filtered_samples_genes_cohort2.rds")
severity_gsva_esetlist_cohort2_df <- getgsvascore_list_df(severity_gsva_esetlist_cohort2, combined_genesets)
## [1] "B cells"
## [1] "CD4+ T cells"
## [1] "CD8+ T cells"
## [1] "HLA-DRhi CD83hi Monocytes"
## [1] "HLA-DRlo CD163hi Monocytes"
## [1] "HLA-DRlo S100Ahi Monocytes"
## [1] "mixed_1"
## [1] "Neutrophils"
## [1] "NK cells"
## [1] "pDC"
## [1] "Plasmablasts"
## [1] "Prol. cells"
severity_gsva_esetlist_cohort2_df_T0 <- severity_gsva_esetlist_cohort2_df %>% filter(Timepoint == "T0", celltype == "NK cells")

cohort1

# cohort1 plot
severity.color <- c("mild"="#00A1D5FF" ,"severe"="#B24745FF", "control" = "#79AF97FF")
p <- ggplot(severity_gsva_esetlist_df_T0, aes(x = HALLMARK_TNFA_SIGNALING_VIA_NFKB, y = `reactome_Fatty acid metabolism`)) + 
  geom_point(shape=21,aes(fill=group_per_sample),size=3, color="white") + 
  scale_fill_manual(name="Severity",values = severity.color) +
  geom_smooth(se = F,method = "lm") + 
  stat_cor(method = "pearson") +
  facet_wrap(~celltype, scales = "free") +
  theme_bw()

p

# ggsave("../SchulteSchrepping/output/", filename = "NK.NFkBvsfatty.severity.cor.pdf", plot = p, device = "pdf", width = 4, height = 3)

cohort2

# cohort2 plot
p <- ggplot(severity_gsva_esetlist_cohort2_df_T0, aes(x = HALLMARK_TNFA_SIGNALING_VIA_NFKB, y = `reactome_Fatty acid metabolism`)) + 
  geom_point(shape=21,aes(fill=group_per_sample),size=3, color="white") + 
  scale_fill_manual(name="Severity",values = severity.color) +
  geom_smooth(se = F,method = "lm") + 
  stat_cor(method = "pearson") +
  facet_wrap(~celltype, scales = "free") +
  theme_bw()

p

# ggsave("../SchulteSchrepping/output/", filename = "NK.NFkBvsfatty.severity.cor.cohort2.pdf", plot = p, device = "pdf", width = 4, height = 3)
sI <- sessionInfo()
utils:::print.sessionInfo(sI[-c(10,11)])
## R version 3.6.2 (2019-12-12)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Mojave 10.14.6
## 
## Matrix products: default
## 
## 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] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] gridExtra_2.3       ggpubr_0.4.0.999    reshape2_1.4.3     
##  [4] Biobase_2.46.0      BiocGenerics_0.32.0 forcats_0.4.0      
##  [7] stringr_1.4.0       dplyr_0.8.4         purrr_0.3.3        
## [10] readr_1.3.1         tidyr_1.0.2         tibble_3.0.3       
## [13] ggplot2_3.3.2       tidyverse_1.3.0     plyr_1.8.5         
## [16] matrixStats_0.55.0 
## 
## loaded via a namespace (and not attached):
##  [1] httr_1.4.1        jsonlite_1.6.1    splines_3.6.2     carData_3.0-3    
##  [5] modelr_0.1.6      assertthat_0.2.1  cellranger_1.1.0  yaml_2.2.1       
##  [9] pillar_1.4.3      backports_1.1.5   lattice_0.20-40   glue_1.3.1       
## [13] digest_0.6.25     ggsignif_0.6.0    rvest_0.3.5       colorspace_1.4-1 
## [17] htmltools_0.4.0   Matrix_1.2-18     pkgconfig_2.0.3   broom_0.7.0      
## [21] haven_2.2.0       scales_1.1.0      openxlsx_4.1.4    rio_0.5.16       
## [25] mgcv_1.8-31       generics_0.0.2    farver_2.0.3      car_3.0-6        
## [29] ellipsis_0.3.0    withr_2.1.2       cli_2.0.2         magrittr_1.5     
## [33] crayon_1.3.4      readxl_1.3.1      evaluate_0.14     fs_1.3.1         
## [37] fansi_0.4.1       nlme_3.1-144      rstatix_0.6.0     xml2_1.2.2       
## [41] foreign_0.8-75    tools_3.6.2       data.table_1.12.8 hms_0.5.3        
## [45] lifecycle_0.2.0   munsell_0.5.0     reprex_0.3.0      zip_2.0.4        
## [49] compiler_3.6.2    rlang_0.4.7       grid_3.6.2        rstudioapi_0.11  
## [53] labeling_0.3      rmarkdown_2.1     gtable_0.3.0      abind_1.4-5      
## [57] DBI_1.1.0         curl_4.3          R6_2.4.1          lubridate_1.7.4  
## [61] knitr_1.28        stringi_1.4.6     Rcpp_1.0.3        vctrs_0.3.4      
## [65] dbplyr_1.4.2      tidyselect_1.0.0  xfun_0.12