-
Notifications
You must be signed in to change notification settings - Fork 0
/
GBM_LGGsampleStachPlot.R
266 lines (255 loc) · 11.1 KB
/
GBM_LGGsampleStachPlot.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
install.packages("colourpicker")
install.packages("pacman")
library(pacman)
pacman::p_load(colourpicker,ggplot2,dplyr,viridis,ggpointdensity,ggthemes,ggsci)
######The figure shows the sample numbers in different glioma phenotypes
mypal3=c("#003399","#CC3333","#CC6633")
#IDH status
IDH_GBMLGG<-ggplot(IDH_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=mypal3[c(1,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#MGMT promoter status
MGMT_GBMLGG<-ggplot(MGMT_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=mypal3[c(1,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#histology status
hist_GBMLGG<-ggplot(hist_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=c(mypal3[c(1,3,2)],"#CC99CC"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#original phenotype status
orig_GBMLGG<-
ggplot(orig_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=c(mypal3[c(1,3,2)],"#CC99CC"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#TERT promoter status
TERT_GBMLGG<-
ggplot(TERT_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=mypal3[c(1,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#G-CIMP phenotype status
CGIMP_GBMLGG<-
ggplot(CGIMP_dui, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=mypal3[c(1,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#tumor grade
grade_GBMLGG<-ggplot(GL_cancerGrade, aes(x = Var.2, y = value, group = Var.1)) +
geom_col(aes(fill=Var.1)) +
scale_fill_manual(values=mypal3[c(1,3,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
#sample type
response_GBMLGG<-ggplot(GL_yuanfu, aes(x = Var.2, y = value, group = Var.1)) +
geom_col(aes(fill=Var.1)) +
scale_fill_manual(values=mypal3[c(1,2)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
######The figure shows the number of CpG sites or CpGct for their methylaton pattern
CMHC_siteduizhan<-ggplot(CM_celltype, aes(x = cell, y = number, group = type)) +
geom_col(aes(fill=type)) +
scale_fill_manual(values=mypal3[c(1,3)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = number), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="top",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
CMHC_siteduizhan
beta_siteduizhan<-ggplot(beta_celltype, aes(x = cell, y = number, group = type)) +
geom_col(aes(fill=type)) +
scale_fill_manual(values=mypal3[c(1,3)])+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = number), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="none",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
beta_siteduizhan
library(cowplot)
plot_grid(beta_siteduizhan,CMHC_siteduizhan,beta_geneposDui,CMHC_geneposDui,
ncol=2,align="hv",rel_widths = c(1,1))
######The figure shows the genomic location of CpG sites
CMHC_geneposDui<-ggplot(CMHC_poscount, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=c(mypal3[1],"#FF9933","#0099CC","#FF9999","#336699","#9999CC"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="top",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
CMHC_geneposDui
beta_geneposDui<-ggplot(beta_poscount, aes(x = Var.1, y = value, group = Var.2)) +
geom_col(aes(fill=Var.2)) +
scale_fill_manual(values=c(mypal3[1],"#FF9933","#0099CC","#FF9999","#336699","#9999CC"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.25)) +
geom_text(aes(label = value), position = position_stack(vjust = .5), size = 3)+
scale_y_continuous(expand = expansion(mult = c(0,0.1)))+
coord_flip()+
theme_bw()+
theme_classic()+theme(legend.position = 0)+
theme_bw()+
theme(
legend.title = element_blank(),
legend.position="top",
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x = element_blank(),
plot.title = element_text(family="Arail",size=16,face="bold",hjust = 0.5,lineheight=0.2),
axis.line = element_line(color = "black"),
)
beta_geneposDui
save(IDH_GBMLGG,MGMT_GBMLGG,hist_GBMLGG,orig_GBMLGG,TERT_GBMLGG,CGIMP_GBMLGG,grade_GBMLGG,response_GBMLGG,file="phenotypeStackPlor.Rdata")