-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheat_map_R_script.R
207 lines (69 loc) · 7.05 KB
/
heat_map_R_script.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
#11932 values removed from this analysis
setwd("/home/PATH_TO/Desktop/Mc_wild")
library(png)
library(gridExtra)
library(ggplot2)
# how I have imported data into R before....
data<-read.table("Mc_info_classes_for_heat_map_WILD.txt",header=TRUE)
p <- ggplot (data, aes(fiveprime, threeprime))
p + geom_bin2d (bins = 50)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_001.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_002.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red", limits = c(0, 2000))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_003.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
#p + geom_point(aes(colour=class, shape=Class, size = 8))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_004.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_point(aes(colour=factor(Class), shape=factor(Class), size=Class))
p + geom_point(aes(colour=factor(Class), shape=factor(Class)))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_005.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
t3 <- data[data$Class==3,]
p <- ggplot (data, aes(log(fiveprime), log(threeprime)))
p + geom_point(aes(colour=factor(Class), shape=factor(Class)))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_007.eps"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_point(aes(colour=factor(Class), shape=factor(Class))) +facet_grid(.~Class)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_008.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, #limitsize = TRUE)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_008.eps"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_point(aes(colour=factor(Class), shape=factor(Class))) +facet_wrap(~Class)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_009.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
######### pete playing#######
#this code is the essential ines
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_010.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_010.eps"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 60)+ scale_fill_gradient (low="blue", high = "red")
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_011.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
### this works
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), shape=factor(Class))))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_actual_result001.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_actual_result001.eps"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
#messing
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class) + geom_point(colour="grey90", size = 4, show_guide = TRUE), shape=factor(Class))))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_actual_result002.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 60)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), size = 3, shape=factor(Class))))
p + geom_bin2d (bins = 60)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), size = 1, shape=factor(Class))))
p + geom_point(aes(colour=factor(Class), shape=factor(Class)))
######## to do facet with scale gradient
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") + geom_point(aes(colour=factor(Class))) +facet_grid(.~Class)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_actual_result003a.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") + geom_point(aes(colour=factor(Class), )) +facet_grid(.~Class)
#p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") + geom_point(aes(colour=factor(Class))), +facet_grid(.~Class)
######### heat map facet grid
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") +facet_grid(.~Class)
#p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") +(geom_point(aes(colour=factor(Class), +facet_grid(.~Class)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_facet001_wild_HCE.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_facet.eps"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
#################################################### to get it to produce heat map
p <- ggplot (data, aes(fiveprime, threeprime))
p + geom_bin2d (bins = 50)
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")
p <- ggplot (data, aes(log(fiveprime), log(threeprime)))
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), shape=factor(Class))))
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") +facet_grid(.~Class)
#p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red") +(geom_point(aes(colour=factor(Class) +facet_grid(.~Class)
######################################## to specifically change to colours of the points
#p + geom_bin2d (bins = 80)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), shape=factor(Class)))) + scale_colour_manual(values = c("yellow","None", "blue", "pink"))
ggsave(filename = ("/home/PATH_TO/Desktop/Mc/Mc_heat_maps_real001a_colours_wild.png"), plot = last_plot(), scale = 1, width = 7, height = 7, dpi = 1200, limitsize = TRUE)
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), shape=factor(Class)))) + scale_colour_manual(values = c("yellow","black", "green", "white", "purple"))
p + geom_bin2d (bins = 50)+ scale_fill_gradient (low="blue", high = "red")+(geom_point(aes(colour=factor(Class), shape=factor(Class)))) + scale_colour_manual(values = c("green","yellow", "black"))