-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChunk08-Convertion the probe IDs to gene symbols.R
67 lines (39 loc) · 1.99 KB
/
Chunk08-Convertion the probe IDs to gene symbols.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
################################################################################
# &&&....&&& % 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 08: Convertion the probe IDs to gene symbols in top 5000.
### ****************************************************************************
top5000list <- get(load("J:/top5000list.RData"))
gpl200anno <- get(load("J:/gpl200anno.RData"))
for (n in 1:length(top5000list)) {
for (i in 1:ncol(top5000list[[n]])) {
probe.len <- length(top5000list[[n]][, i])
at.pos <- grep("_at", top5000list[[n]][, i])
at2sym <- NULL
for (g in at.pos) {
tp <- gpl200anno$`Gene Symbol`[match(top5000list[[n]][g, i], 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)
}
top5000list[[n]][at.pos, i] <- at2sym
}
}
save(top5000list, file = "top5000list_symbol.RData")
library(openxlsx)
# write.xlsx(top5000list, "S4-top5000_gene_symbol.xlsx", row.names = TRUE)
# End of this line.