-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFigure 3-AB.R
123 lines (108 loc) · 7.21 KB
/
Figure 3-AB.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# library
library(ggplot2)
library(cowplot)
##################################### barplot ###############################
AD <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 2)
PV <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 3)
AP <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 4)
AD_pct <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 5)
PV_pct <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 6)
AP_pct <- read.xlsx("F:/4-7-20m-Final-1030/Figure 3/different DEGs/DEG numbers for barplot-1103.xlsx", sheetIndex = 7)
# Grouped
AD$Cluster <- factor(AD$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
PV$Cluster <- factor(PV$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
AP$Cluster <- factor(AP$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
AD_pct$Cluster <- factor(AD_pct$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
PV_pct$Cluster <- factor(PV_pct$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
AP_pct$Cluster <- factor(AP_pct$Cluster, levels=c("Tcm", "Trm1", "eTreg1", "Trm2", "CTLex", "CTLem", "Tet", "Tmm1", "ILC/NK", "NK", "Trm3",
"cmTreg", "Tmm2", "eTreg2", "Tmm3", "ILC2", "Tn", "moDC1", "LC1", "InfMono", "Mac1", "Mono",
"LC2", "moDC2", "moDC3", "DC1", "DC2", "LC3", "Mac2", "Plasma", "B", "Mac3", "DC3",
"migDC", "Mac4", "Mast", "Trm-c", "Treg-c", "Mast-c", "ILC/NK-c", "CTL-c"))
p1 <- ggplot(AD, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="palevioletred2")+
scale_x_discrete(labels = unique(AD$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("AD-total")
p2 <- ggplot(PV, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="dodgerblue")+
scale_x_discrete(labels = unique(PV$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("PV-total")
p3 <- ggplot(AP, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="mediumorchid3")+
scale_x_discrete(labels = unique(AP$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("AP-total")
p4 <- ggplot(AD_pct, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="palevioletred2")+
scale_x_discrete(labels = unique(AD_pct$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("AD-80%")
p5 <- ggplot(PV_pct, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="dodgerblue")+
scale_x_discrete(labels = unique(PV_pct$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("PV-80%")
p6 <- ggplot(AP_pct, aes(fill=Comparison, y=number, x=Cluster)) +
geom_bar(position="dodge", stat="identity", fill="dodgerblue")+
scale_x_discrete(labels = unique(AP_pct$Cluster)) + labs(x = "")+
theme(#axis.title.x=element_blank(),
axis.text.x=element_text(angle = 90),
axis.ticks.x=element_blank(),
axis.line = element_line(colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank())+
ggtitle("AP-80%")
plot_grid(p1, p2, p3, p4, p5, p6,ncol=3)