final_major_table <- readRDS("~/Documents/r_codes/final_major_table.rds")
table(final_major_table$cell_type)
##
## cDC1 cDC2
## 777 777
## DC Macrophage
## 777 777
## Macrophage_alveolar Monocyte_classical
## 777 777
## Monocyte_non-classical Myeloid
## 777 777
## Neutrophils pDC
## 777 777
## Pericyte Plasma
## 777 777
## Plasma_cell_dividing T_cell_CD4
## 777 777
## T_cell_CD4_dividing T_cell_CD8_activated
## 777 777
## T_cell_CD8_dividing T_cell_CD8_effector_memory
## 777 777
## T_cell_CD8_naive T_cell_CD8_terminally_exhausted
## 777 777
## T_cell_NK-like T_cell_regulatory
## 777 777
library(ggplot2)
library(gridExtra)
cdc1 <- final_major_table[final_major_table$cell_type == "cDC1", ]
y_limits <- range(cdc1$value)
plot_cdc1 <- ggplot(cdc1, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "cDC1", x = "Diagnosis", y= "Percent of cDC1") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_cdc1)

library(ggplot2)
library(gridExtra)
cdc2 <- final_major_table[final_major_table$cell_type == "cDC2", ]
y_limits <- range(cdc2$value)
plot_cdc2 <- ggplot(cdc2, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "cDC2", x = "Diagnosis", y= "Percent of cDC2") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_cdc2)

library(ggplot2)
library(gridExtra)
pdc <- final_major_table[final_major_table$cell_type == "pDC", ]
y_limits <- range(pdc$value)
plot_pdc <- ggplot(pdc, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "pDC", x = "Diagnosis", y= "Percent of pDC") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_pdc)

library(ggplot2)
library(gridExtra)
DC <- final_major_table[final_major_table$cell_type == "DC", ]
y_limits <- range(DC$value)
plot_dc <- ggplot(DC, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "DC mature", x = "Diagnosis", y= "Percent of DC") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_dc)

library(ggplot2)
library(gridExtra)
Macrophage <- final_major_table[final_major_table$cell_type == "Macrophage", ]
y_limits <- range(Macrophage$value)
plot_Macrophage <- ggplot(Macrophage, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Macrophage", x = "Diagnosis", y= "Percent of Macrophage") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Macrophage)

library(ggplot2)
library(gridExtra)
Macrophage_alveolar <- final_major_table[final_major_table$cell_type == "Macrophage_alveolar", ]
y_limits <- range(Macrophage_alveolar$value)
plot_Macrophage_alveolar <- ggplot(Macrophage_alveolar, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Macrophage alveolar", x = "Diagnosis", y= "Percent of Macrophage alveolar") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Macrophage_alveolar)

library(ggplot2)
library(gridExtra)
Monocyte_classical <- final_major_table[final_major_table$cell_type == "Monocyte_classical", ]
y_limits <- range(Monocyte_classical$value)
plot_Monocyte_classical <- ggplot(Monocyte_classical, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Monocyte classical", x = "Diagnosis", y= "Percent of Monocyte classical") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Monocyte_classical)

library(ggplot2)
library(gridExtra)
Monocyte_non_classical <- final_major_table[final_major_table$cell_type == "Monocyte_non-classical", ]
y_limits <- range(Monocyte_non_classical$value)
plot_Monocyte_non_classical <- ggplot(Monocyte_non_classical, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Monocyte non-classical", x = "Diagnosis", y= "Percent of Monocyte non-classical") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Monocyte_non_classical)

library(ggplot2)
library(gridExtra)
Myeloid <- final_major_table[final_major_table$cell_type == "Myeloid", ]
y_limits <- range(Myeloid$value)
plot_Myeloid <- ggplot(Myeloid, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Myeloid", x = "Diagnosis", y= "Percent of Myeloid") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Myeloid)

library(ggplot2)
library(gridExtra)
Neutrophils <- final_major_table[final_major_table$cell_type == "Neutrophils", ]
y_limits <- range(Neutrophils$value)
plot_Neutrophils <- ggplot(Neutrophils, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Neutrophils", x = "Diagnosis", y= "Percent of Neutrophils") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Neutrophils)

library(ggplot2)
library(gridExtra)
Pericyte <- final_major_table[final_major_table$cell_type == "Pericyte", ]
y_limits <- range(Pericyte$value)
plot_Pericyte <- ggplot(Pericyte, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Pericyte", x = "Diagnosis", y= "Percent of Pericyte") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Pericyte)

library(ggplot2)
library(gridExtra)
Plasma <- final_major_table[final_major_table$cell_type == "Plasma", ]
y_limits <- range(Plasma$value)
plot_Plasma <- ggplot(Plasma, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Plasma", x = "Diagnosis", y= "Percent of Plasma") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Plasma)

library(ggplot2)
library(gridExtra)
Plasma_cell_dividing <- final_major_table[final_major_table$cell_type == "Plasma_cell_dividing", ]
y_limits <- range(Plasma_cell_dividing$value)
plot_Plasma_cell_dividing <- ggplot(Plasma_cell_dividing, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "Plasma cell dividing", x = "Diagnosis", y= "Percent of Plasma cell dividing") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_Plasma_cell_dividing)

library(ggplot2)
library(gridExtra)
T_cell_CD4 <- final_major_table[final_major_table$cell_type == "T_cell_CD4", ]
y_limits <- range(T_cell_CD4$value)
plot_T_cell_CD4 <- ggplot(T_cell_CD4, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD4", x = "Diagnosis", y= "Percent of T cell CD4") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD4)

library(ggplot2)
library(gridExtra)
T_cell_CD4_dividing <- final_major_table[final_major_table$cell_type == "T_cell_CD4_dividing", ]
y_limits <- range(T_cell_CD4_dividing$value)
plot_T_cell_CD4_dividing <- ggplot(T_cell_CD4_dividing, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD4 dividing", x = "Diagnosis", y= "Percent of T cell CD4 dividing") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD4_dividing)

library(ggplot2)
library(gridExtra)
T_cell_CD8_activated <- final_major_table[final_major_table$cell_type == "T_cell_CD8_activated", ]
y_limits <- range(T_cell_CD8_activated$value)
plot_T_cell_CD8_activated <- ggplot(T_cell_CD8_activated, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD8 activated", x = "Diagnosis", y= "Percent of T cell CD8 activated") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD8_activated)

library(ggplot2)
library(gridExtra)
T_cell_CD8_dividing <- final_major_table[final_major_table$cell_type == "T_cell_CD8_dividing", ]
y_limits <- range(T_cell_CD8_dividing$value)
plot_T_cell_CD8_dividing <- ggplot(T_cell_CD8_dividing, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD8 dividing", x = "Diagnosis", y= "Percent of T cell CD8 dividing") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD8_dividing)

library(ggplot2)
library(gridExtra)
T_cell_CD8_effector_memory <- final_major_table[final_major_table$cell_type == "T_cell_CD8_effector_memory", ]
y_limits <- range(T_cell_CD8_effector_memory$value)
plot_T_cell_CD8_effector_memory <- ggplot(T_cell_CD8_effector_memory, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD8 effector memory", x = "Diagnosis", y= "Percent of T cell CD8 effector memory") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD8_effector_memory)

library(ggplot2)
library(gridExtra)
T_cell_CD8_naive <- final_major_table[final_major_table$cell_type == "T_cell_CD8_naive", ]
y_limits <- range(T_cell_CD8_naive$value)
plot_T_cell_CD8_naive <- ggplot(T_cell_CD8_naive, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD8 naive", x = "Diagnosis", y= "Percent of T cell CD8 naive") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD8_naive)

library(ggplot2)
library(gridExtra)
T_cell_CD8_terminally_exhausted <- final_major_table[final_major_table$cell_type == "T_cell_CD8_terminally_exhausted", ]
y_limits <- range(T_cell_CD8_terminally_exhausted$value)
plot_T_cell_CD8_terminally_exhausted <- ggplot(T_cell_CD8_terminally_exhausted, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell CD8 terminally exhausted", x = "Diagnosis", y= "Percent of T cell CD8 terminally exhausted") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_CD8_terminally_exhausted)

library(ggplot2)
library(gridExtra)
T_cell_NK_like <- final_major_table[final_major_table$cell_type == "T_cell_NK-like", ]
y_limits <- range(T_cell_NK_like$value)
plot_T_cell_NK_like <- ggplot(T_cell_NK_like, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell NK-like", x = "Diagnosis", y= "Percent of T cell NK-like") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_NK_like)

library(ggplot2)
library(gridExtra)
T_cell_regulatory <- final_major_table[final_major_table$cell_type == "T_cell_regulatory", ]
y_limits <- range(T_cell_regulatory$value)
plot_T_cell_regulatory <- ggplot(T_cell_regulatory, aes(x = primary_diagnosis, y = value , fill = merged_stage)) +
geom_boxplot() +
labs(title = "T cell regulatory", x = "Diagnosis", y= "Percent of T cell regulatory") +
theme_minimal() +
ylim(y_limits) +
theme(axis.text.x = element_text(angle = 360))
ggplot2:::print.ggplot(plot_T_cell_regulatory)
