-
Notifications
You must be signed in to change notification settings - Fork 0
/
step3-heatmap.R
executable file
·110 lines (79 loc) · 2.68 KB
/
step3-heatmap.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
##############################
# before and after blockwise standardization (BWSTD)
##############################
library(biclust)
drawHeatmap(d1)
drawHeatmap(d.std)
####################
memb.o<-as.character(sample.tis.sel$dis.cat[])
##############################
# (1) before and after blockwise standardization (BWSTD)
# ordered by platform
##############################
ord<-order(platforms)
drawHeatmap(d1[ord,ord])
drawHeatmap(d.std[ord,ord])
d3<-(abs(d1))^(1/2)*sign(d1)
drawHeatmap(d3[ord,ord])
d3<-(abs(d.std))^(1/2)*sign(d.std)
drawHeatmap(d3[ord,ord])
##############################
tab.pl<-table(platforms)#[unique(platforms)]
col.bar<-rep(sample(length(tab.pl)),tab.pl)
drawHeatmap(t(as.matrix(col.bar)))
abline(v=cumsum(tab.pl),col="white")
##############################
# (2) before BWSTD
# ordered by tissue labels
##############################
d3<-(abs(d1))^(1/1.2)*sign(d1)
plot(apply(d3,1,sum),apply(d3,1,sd))
ind.out<- c(which(apply(d3,1,sum)< 50 & apply(d3,1,sd) < 0.1),1e6)
ord<-order(memb.o[-ind.out])
d4<-d3[-ind.out,-ind.out][ord,ord]
tab.o<-table(sort(memb.o[-ind.out]))
drawHeatmap(d4)
##############################
# (3) after BWSTD
# ordered by tissue labels
##############################
d3<-(abs(d.std))^(1/2)*sign(d.std)
plot(apply(d3,1,sum),apply(d3,1,sd))
ind.out<- which(apply(d3,1,sum)< -0200 & apply(d3,1,sd) < 0.4)
tab.o<-table(memb.o[-ind.out])
ord<-order(memb.o[-ind.out])
d4<-d3[-ind.out,-ind.out][ord,ord]
drawHeatmap(d4)
##############################
# (4) before BWSTD, platform GPL 570 only
# ordered by tissue labels
##############################
ind.pl<-platforms=="GPL570"
d.gpl570<-d1[ind.pl,ind.pl]
d3<-(abs(d.gpl570))^(1/2)*sign(d.gpl570)
plot(apply(d3,1,sum),apply(d3,1,sd))
ind.out<- which(apply(d3,1,sum)< 0& apply(d3,1,sd) < 0.2)
tab.o<-table(memb.o[ind.pl][-ind.out])
ord<-order(memb.o[ind.pl][-ind.out])
d4<-d3[-ind.out,-ind.out][ord,ord]
drawHeatmap(d4)
##############################
# (5) after BWSTD, platform GPL 570 only
# ordered by tissue labels
##############################
ind.pl<-platforms=="GPL570"
d.gpl570<-d.std[ind.pl,ind.pl]
d3<-(abs(d.gpl570))^(1/2)*sign(d.gpl570)
plot(apply(d3,1,sum),apply(d3,1,sd))
ind.out<- which(apply(d3,1,sum)< -400 & apply(d3,1,sd) < 0.4)
tab.o<-table(memb.o[ind.pl][-ind.out])
ord<-order(memb.o[ind.pl][-ind.out])
d4<-d3[-ind.out,-ind.out][ord,ord]
drawHeatmap(d4)
##############################
##############################
col.bar<-rep(sample(length(tab.o)),tab.o)
drawHeatmap(t(as.matrix(col.bar)))
abline(v=cumsum(tab.o)+0.5,col="white")
as.matrix((tab.o))
##############################