Scatter plots of IL15 expression in bulk RNAseq data and their correlation with AD trais | 1,210 unique samples from DLFPC region
data_bulk <- load ("C:/Users/beker/OneDrive/Documentos/Mestrado/GitHub/Cytokines/bulk_RNAseq/bulk_DLPFC_2022.Rdata")
phenotype_dt <- pheno_DLPFC
# Filtering dataset to IL15 expression
exprData_IL15_pheno <- as.data.frame(t(expr_target["IL15", ]))
exprData_IL15_pheno$projid <- rownames(exprData_IL15_pheno)
exprData_IL15_pheno <- merge(exprData_IL15_pheno,
pheno_DLPFC[, c("projid", "cogng_demog_slope", "cogng_path_slope", "tangles_sqrt", "gpath", "cogdx_3grp")],
by = "projid",
all.x = TRUE)
exprData_IL15_pheno$cogdx_3grp[exprData_IL15_pheno$cogdx_3grp == 0] <- "NCI"
exprData_IL15_pheno$cogdx_3grp[exprData_IL15_pheno$cogdx_3grp == 1] <- "MCI"
exprData_IL15_pheno$cogdx_3grp[exprData_IL15_pheno$cogdx_3grp == 2] <- "AD"
exprData_IL15_pheno$cogdx_3grp <- as.factor(exprData_IL15_pheno$cogdx_3grp)
names(exprData_IL15_pheno)[names(exprData_IL15_pheno) == 'cogdx_3grp'] <- 'Diagnosis'
# scatter plot IL15
# 1º: cognitive decline
gg <- ggplot(na.omit(exprData_IL15_pheno), aes(x=cogng_demog_slope, y=IL15, color=Diagnosis, pch=Diagnosis)) +
geom_point() +
stat_smooth(method = "lm", se=F) + # Add regression line
stat_cor(method = "spearman", label.x.npc = "left", label.y.npc = "bottom", size = 6) +
labs(x = "Cognitive decline slope", y = "IL15 expression", title = "IL15 expression on bulk for cognitive decline", color = "Diagnosis", pch = "Diagnosis") +
scale_color_manual(values = c("AD" = "#BB5566", "MCI" = "#DDAA33", "NCI" = "#004488")) +
theme_classic()+
theme(
text = element_text(size = 18),
axis.title = element_text(size = 16),
axis.text = element_text(size = 18),
legend.title = element_text(size = 14),
legend.text = element_text(size = 14),
legend.position = c(0.94, 0.145),
legend.background = element_rect(fill = "white", color = "black"),
legend.box.background = element_rect(fill = "lightgray")
)
print(gg)
# Save to PDF
pdf(file = paste0("scatterPlot_IL15_cogn_T045", ".pdf"), width = 10, height = 6)
print(gg)
dev.off()
## png
## 2
# Save to PNG
png(file = paste0("scatterPlot_IL15_cogn_T045", ".png"), width = 3000, height = 1800, res = 300)
print(gg)
dev.off()
## png
## 2
# scatter plot IL15
# 2º: resilience
gg <- ggplot(na.omit(exprData_IL15_pheno), aes(x=cogng_path_slope, y=IL15, color=Diagnosis, pch=Diagnosis)) +
geom_point() +
stat_smooth(method = "lm", se=F) + # Add regression line
stat_cor(method = "spearman", label.x.npc = "left", label.y.npc = "bottom") +
labs(x = "Resilience", y = "IL15 expression", title = "IL15 expression on bulk for resilience") +
scale_color_manual(values = c("AD" = "#BB5566", "MCI" = "#DDAA33", "NCI" = "#004488")) +
theme_classic()+
theme(
text = element_text(size = 18),
axis.title = element_text(size = 20),
axis.text = element_text(size = 18),
legend.title = element_text(size = 18),
legend.text = element_text(size = 16)
)
print(gg)
# Save to PDF
pdf(file = paste0("scatterPlot_IL15_resilience_T045", ".pdf"), width = 10, height = 6)
print(gg)
dev.off()
## png
## 2
# Save to PNG
png(file = paste0("scatterPlot_IL15_resilience_T045", ".png"), width = 3000, height = 1800, res = 300)
print(gg)
dev.off()
## png
## 2
# scatter plot IL15
# 3º: PHF tau tangles
gg <- ggplot(na.omit(exprData_IL15_pheno), aes(x=tangles_sqrt, y=IL15, color=Diagnosis, pch=Diagnosis)) +
geom_point() +
stat_smooth(method = "lm", se=F) + # Add regression line
stat_cor(method = "spearman", label.x.npc = "left", label.y.npc = "bottom") +
labs(x = "PHF tau tangles on brain parenchyma", y = "IL15 expression", title = "IL15 expression on bulk for PHF tau tangles") +
scale_color_manual(values = c("AD" = "#BB5566", "MCI" = "#DDAA33", "NCI" = "#004488")) +
theme_classic()+
theme(
text = element_text(size = 18),
axis.title = element_text(size = 20),
axis.text = element_text(size = 18),
legend.title = element_text(size = 18),
legend.text = element_text(size = 16)
)
print(gg)
# Save to PDF
pdf(file = paste0("scatterPlot_IL15_tangles_T045", ".pdf"), width = 10, height = 6)
print(gg)
dev.off()
## png
## 2
# Save to PNG
png(file = paste0("scatterPlot_IL15_tangles_T045", ".png"), width = 3000, height = 1800, res = 300)
print(gg)
dev.off()
## png
## 2
# scatter plot IL15
# 4º: global ad burden
gg <- ggplot(na.omit(exprData_IL15_pheno), aes(x=gpath, y=IL15, color=Diagnosis, pch=Diagnosis)) +
geom_point()+
stat_smooth(method = "lm", se=F) + # Add regression line
# stat_regline_equation(aes(label = ..adj.rr.label..), show.legend = T) + # Add Rsquare
stat_cor(method = "spearman", label.x.npc = "left", label.y.npc = "bottom") +
easy_labs(x = "Global AD burden", y = "IL15 expression", title = "IL15 expression on bulk for global AD burden") +
scale_color_manual(values = c("AD" = "#BB5566", "MCI" = "#DDAA33", "NCI" = "#004488")) +
theme_classic()+
theme(
text = element_text(size = 18),
axis.title = element_text(size = 20),
axis.text = element_text(size = 18),
legend.title = element_text(size = 18),
legend.text = element_text(size = 16)
)
print(gg)
# Save to PDF
pdf(file = paste0("scatterPlot_IL15_gpath_T045", ".pdf"), width = 10, height = 6)
print(gg)
dev.off()
## png
## 2
# Save to PNG
png(file = paste0("scatterPlot_IL15_gpath_T045", ".png"), width = 3000, height = 1800, res = 300)
print(gg)
dev.off()
## png
## 2
## R version 4.3.2 (2023-10-31 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 11 x64 (build 26100)
##
## Matrix products: default
##
##
## locale:
## [1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8
## [3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C
## [5] LC_TIME=Portuguese_Brazil.utf8
##
## time zone: America/Sao_Paulo
## tzcode source: internal
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggeasy_0.1.4 ggpubr_0.6.0 lubridate_1.9.3 forcats_1.0.0
## [5] stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2 readr_2.1.5
## [9] tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.0 tidyverse_2.0.0
##
## loaded via a namespace (and not attached):
## [1] sass_0.4.9 utf8_1.2.4 generics_0.1.3 rstatix_0.7.2
## [5] lattice_0.21-9 stringi_1.8.3 hms_1.1.3 digest_0.6.36
## [9] magrittr_2.0.3 evaluate_0.24.0 grid_4.3.2 timechange_0.3.0
## [13] fastmap_1.2.0 Matrix_1.6-5 jsonlite_1.8.8 backports_1.4.1
## [17] mgcv_1.9-0 fansi_1.0.6 scales_1.3.0 jquerylib_0.1.4
## [21] abind_1.4-5 cli_3.6.2 rlang_1.1.3 splines_4.3.2
## [25] munsell_0.5.1 withr_3.0.1 cachem_1.1.0 yaml_2.3.10
## [29] tools_4.3.2 tzdb_0.4.0 ggsignif_0.6.4 colorspace_2.1-0
## [33] broom_1.0.6 vctrs_0.6.5 R6_2.5.1 lifecycle_1.0.4
## [37] car_3.1-2 pkgconfig_2.0.3 pillar_1.9.0 bslib_0.8.0
## [41] gtable_0.3.5 glue_1.7.0 highr_0.11 xfun_0.46
## [45] tidyselect_1.2.1 rstudioapi_0.16.0 knitr_1.48 farver_2.1.1
## [49] nlme_3.1-163 htmltools_0.5.8.1 labeling_0.4.3 rmarkdown_2.27
## [53] carData_3.0-5 compiler_4.3.2