-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chunk09-Investigate the top100 of six SGLs.R
176 lines (126 loc) · 5.99 KB
/
Chunk09-Investigate the top100 of six SGLs.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
################################################################################
# &&&....&&& % Project: Identification of HKG candidates in C. elegans #
# &&&&&&..&&&&&& % Author: Bo Li, Jingxin Tao, Youjin Hao #
# &&&&&&&&&&&&&& % Date: Dec. 24th, 2019 #
# &&&&&&&&&&&& % #
# &&&&&&&& % Environment: R version 3.5.3; #
# &&&& % Platform: x86_64-pc-linux-gnu (64-bit) #
# & % #
################################################################################
###==========================================================================###
### ****************************************************************************
### code chunk number 09: Investigation of top 100 genes of SGLs.
### ****************************************************************************
setwd("J:\\00-Paper Publication\\A2-HKG identification (Tao Jing-xin)\\Manuscript")
top50HKG <- get(load("Data/rank50_top5000_v2.RData"))
top100HKG <- get(load("Data/rank100_top5000_v2.RData"))
gpl200anno <- get(load("Data/gpl200anno.RData"))
for (n in 1:length(top100HKG)) {
probe.len <- length(top100HKG[[n]])
at.pos <- grep("_at", top100HKG[[n]])
at2sym <- NULL
for (g in at.pos) {
tp <- gpl200anno$`Gene Symbol`[match(top100HKG[[n]][g], gpl200anno$ID)]
print(g)
print(tp)
tmp <- strsplit(tp, " /// ")[[1]][1]
if (length(grep("WBGene", tmp)) != 0) {
x <- strsplit(tp, " /// ")[[1]][2]
tmp <- x
}
print(tmp)
at2sym <- c(at2sym, tmp)
}
top100HKG[[n]][at.pos] <- at2sym
}
names(top50HKG)[4] <- names(top100HKG)[4] <- "Li-Wong_exprs"
save(top50HKG, file = "rank50_top5000_v2.RData")
save(top100HKG, file = "rank100_top5000_v2.RData")
library(UpSetR)
# help(package = "UpSetR")
## ---------------- Venn plot for top 50 genes in six SGLs ------------------ ##
listInput <- list(RMA = top50HKG$RMA_exprs,
MAS5 = top50HKG$MAS_exprs,
gcRMA = top50HKG$GCRMA_exprs,
Li_Wong = top50HKG$`Li-Wong_exprs`,
PLIER = top50HKG$PLIER_exprs,
VSN = top50HKG$VSN_exprs)
df.listInput <- fromList(listInput)
col_seq <- c("#376092","#77933C","#993735","#604A7B","#31859C","#E46C0A" )
# #F08080 standing for the color named by LightCoral
hkgs50 <- upset(df.listInput,
sets = c ("RMA", "MAS5","gcRMA","Li_Wong", "PLIER","VSN"),
main.bar.color = "grey20",
queries = list(list(query = intersects,
params = list("PLIER", "Li_Wong", "MAS5", "RMA"),
color = "#F08080", active = TRUE),
list(query = intersects,
params = list("PLIER", "Li_Wong", "RMA"),
color = "#F08080", active = TRUE)
),
sets.bar.color = col_seq,
order.by = "degree")
hk4.top50 <- Reduce(intersect,
list(top50HKG$PLIER_exprs,
top50HKG$`Li-Wong_exprs`,
top50HKG$MAS_exprs,
top50HKG$RMA_exprs)
)
## ---------------- Venn plot for top 100 genes in six SGLs ----------------- ##
listInput <- list(RMA = top100HKG$RMA_exprs,
MAS5 = top100HKG$MAS_exprs,
gcRMA = top100HKG$GCRMA_exprs,
Li_Wong = top100HKG$`Li-Wong_exprs`,
PLIER = top100HKG$PLIER_exprs,
VSN = top100HKG$VSN_exprs)
df.listInput <- fromList(listInput)
col_seq <- c( "#376092","#77933C","#993735","#604A7B","#31859C","#E46C0A" )
upset(df.listInput,
sets = c ("RMA", "MAS5","gcRMA","Li_Wong", "PLIER","VSN"),
main.bar.color = "grey20",
queries = list(list(query = intersects,
params = list("PLIER", "Li_Wong", "MAS5", "RMA"),
color = "#F08080", active = TRUE),
list(query = intersects,
params = list("VSN", "Li_Wong", "RMA"),
color = "#F08080", active = TRUE),
list(query = intersects,
params = list("PLIER", "Li_Wong", "RMA"),
color = "#F08080", active = TRUE),
list(query = intersects,
params = list("PLIER", "MAS5", "RMA"),
color = "#F08080", active = TRUE), # coral red
list(query = intersects,
params = list("PLIER", "RMA"),
color = "violet", active = TRUE) # violet
),
sets.bar.color = col_seq,
order.by = "degree")
hk4.top100 <- Reduce(intersect,
list(top100HKG$PLIER_exprs,
top100HKG$`Li-Wong_exprs`,
top100HKG$MAS_exprs,
top100HKG$RMA_exprs)
)
hk3.1.top100 <- Reduce(intersect,
list(top100HKG$VSN_exprs,
top100HKG$`Li-Wong_exprs`,
top100HKG$RMA_exprs)
)
hk3.2.top100 <- Reduce(intersect,
list(top100HKG$PLIER_exprs,
top100HKG$`Li-Wong_exprs`,
top100HKG$RMA_exprs)
)
hk3.3.top100 <- Reduce(intersect,
list(top100HKG$PLIER_exprs,
top100HKG$MAS_exprs,
top100HKG$RMA_exprs)
)
hk2.top100 <- Reduce(intersect,
list(top100HKG$PLIER_exprs,
top100HKG$RMA_exprs)
)
hk2.top100 # rps-17
hk.3_4.100 <- unique(c(hk4.top100, hk3.1.top100, hk3.2.top100, hk3.3.top100))
# End of this line.