-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvespula.comparison.recombination.map.R
406 lines (319 loc) · 18.3 KB
/
vespula.comparison.recombination.map.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
#!/bin/R
# A helpful R script to plot interspecies comparisons for Wasp paper.
# Load some libraries:
library(tidyr)
library(ggplot2)
library(stringr)
library(gridExtra)
library(grid)
library(cowplot)
library(dplyr)
# Bring in pensylvanica first:
setwd("~/Desktop/WASPS/vespula_pensylvanica/scaffs/scaffs/")
# Import the scaffolds:
vp.scaff3<-read.table("Scaffold03.pruned.txt", stringsAsFactors = F, header = TRUE)
vp.scaff4<-read.table("Scaffold04.pruned.txt", stringsAsFactors = F, header = TRUE)
vp.scaff5<-read.table("Scaffold05.pruned.txt", stringsAsFactors = F, header = TRUE)
vp.scaff7<-read.table("Scaffold07.pruned.txt", stringsAsFactors = F, header = TRUE)
# Turn off scientific notation
options(scipen = 999)
## SCAFFOLD 03 ##
vp.scaff3$title <- "Scaffold 3"
vp.Plot3 <- ggplot(data=vp.scaff3, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumpurple4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Plot3
## SCAFFOLD 04 ##
vp.scaff4$title <- "Scaffold 4"
vp.Plot4 <- ggplot(data=vp.scaff4, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "skyblue4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Plot4
## SCAFFOLD 05 ##
vp.scaff5$title <- "Scaffold 5"
vp.Plot5 <- ggplot(data=vp.scaff5, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "steelblue2", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Plot5
## SCAFFOLD 07 ##
vp.scaff7$title <- "Scaffold 7"
vp.Plot7 <- ggplot(data=vp.scaff7, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumseagreen", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Plot7
# Chang working directory to the appropriate directory:
setwd("~/Desktop/WASPS/vespula_pensylvanica/new_recombination/")
# Read in the tripleStats.txt file produced from SlopeCalc.py on HPCC:
vp.recomb3 <- read.table("Scaffold03.recombination.txt", stringsAsFactors = F, header = TRUE)
vp.recomb4 <- read.table("Scaffold04.recombination.txt", stringsAsFactors = F, header = TRUE)
vp.recomb5 <- read.table("Scaffold05.recombination.txt", stringsAsFactors = F, header = TRUE)
vp.recomb7 <- read.table("Scaffold07.recombination.txt", stringsAsFactors = F, header = TRUE)
# Make a list of all the dataframes;
vp.recombination <- list(vp.recomb3, vp.recomb4, vp.recomb5, vp.recomb7)
# Remove NaNs from all the dataframes in the list
#vp.recombination_clean <- lapply(vp.recombination, function(x) { na.omit(x)})
# Take absolute value of all the slopes:
#vp.positive_slopes <- lapply(vp.recombination_clean, function(x) {x$absSlope <- abs(x$slope); return(x) })
# Log transform the slope values:
vp.logtransform <- lapply(vp.recombination, function(x) { x$logSlope <- log10(x$slope); return(x) })
# Very small positive values generally turn into larger negative values.
# Zeros turn into -Inf values.
names(vp.logtransform) <- c("rcmb3","rcmb4", "rcmb5", "rcmb7")
## RECOMBINATION 03 ##
vp.logtransform[['rcmb3']]$title <- "Scaffold 3"
vp.Rplot3 <- ggplot(data=vp.logtransform[['rcmb3']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumpurple4")+
geom_point(colour = "mediumpurple4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Rplot3
## RECOMBINATION 04 ##
vp.logtransform[['rcmb4']]$title <- "Scaffold 4"
vp.Rplot4 <- ggplot(data=vp.logtransform[['rcmb4']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "skyblue4")+
geom_point(colour = "skyblue4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Rplot4
## RECOMBINATION 05 ##
vp.logtransform[['rcmb5']]$title <- "Scaffold 5"
vp.Rplot5 <- ggplot(data=vp.logtransform[['rcmb5']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "steelblue2")+
geom_point(colour = "steelblue2") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Rplot5
## RECOMBINATION 07 ##
vp.logtransform[['rcmb7']]$title <- "Scaffold 7"
vp.Rplot7 <- ggplot(data=vp.logtransform[['rcmb7']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumseagreen")+
geom_point(colour = "mediumseagreen") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vp.Rplot7
# Now, Consobrina:
# Set working directory:
setwd("~/Desktop/WASPS/vespula_consobrina/scaffs/")
vc.scaff3 <- read.table("Scaffold03.pruned.txt", stringsAsFactors = F, header = TRUE)
vc.scaff4 <- read.table("Scaffold04.pruned.txt", stringsAsFactors = F, header = TRUE)
vc.scaff5 <- read.table("Scaffold05.pruned.txt", stringsAsFactors = F, header = TRUE)
vc.scaff7 <- read.table("Scaffold07.pruned.txt", stringsAsFactors = F, header = TRUE)
## SCAFFOLD 03 ##
vc.scaff3$title <- "Scaffold 3"
vc.Plot3 <- ggplot(data=vc.scaff3, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumpurple4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Plot3
## SCAFFOLD 04 ##
vc.scaff4$title <- "Scaffold 4"
vc.Plot4 <- ggplot(data=vc.scaff4, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "skyblue4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Plot4
## SCAFFOLD 05 ##
vc.scaff5$title <- "Scaffold 5"
vc.Plot5 <- ggplot(data=vc.scaff5, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "steelblue2", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Plot5
## SCAFFOLD 07 ##
vc.scaff7$title <- "Scaffold 7"
vc.Plot7 <- ggplot(data=vc.scaff7, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumseagreen", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Plot7
# Set working directory:
setwd("~/Desktop/WASPS/vespula_consobrina/new_recombination/")
# Import the scaffold01 centimorgan x physical distance data:
vc.recomb3 <- read.table("Scaffold03.recombination.txt", stringsAsFactors = F, header = TRUE)
vc.recomb4 <- read.table("Scaffold04.recombination.txt", stringsAsFactors = F, header = TRUE)
vc.recomb5 <- read.table("Scaffold05.recombination.txt", stringsAsFactors = F, header = TRUE)
vc.recomb7 <- read.table("Scaffold07.recombination.txt", stringsAsFactors = F, header = TRUE)
# Make a list of all the dataframes;
vc.recombination <- list(vc.recomb3, vc.recomb4, vc.recomb5, vc.recomb7)
# Remove NaNs from all the dataframes in the list
#vc.recombination_clean <- lapply(vc.recombination, function(x) { na.omit(x)})
# Take absolute value of all the slopes:
#vc.positive_slopes <- lapply(vc.recombination_clean, function(x) {x$absSlope <- abs(x$slope); return(x) })
# Log transform the slope values:
vc.logtransform <- lapply(vc.recombination, function(x) { x$logSlope <- log10(x$slope); return(x) })
# Very small positive values generally turn into larger negative values.
# Zeros turn into -Inf values.
names(vc.logtransform) <- c("rcmb3","rcmb4", "rcmb5", "rcmb7")
## RECOMBINATION 03 ##
vc.logtransform[['rcmb3']]$title <- "Scaffold 3"
vc.Rplot3 <- ggplot(data=vc.logtransform[['rcmb3']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumpurple4")+
geom_point(colour = "mediumpurple4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(39e+06, 42e+06, 45e+06, 48e+06, 51e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Rplot3
## RECOMBINATION 04 ##
vc.logtransform[['rcmb4']]$title <- "Scaffold 4"
vc.Rplot4 <- ggplot(data=vc.logtransform[['rcmb4']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "skyblue4")+
geom_point(colour = "skyblue4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Rplot4
## RECOMBINATION 05 ##
vc.logtransform[['rcmb5']]$title <- "Scaffold 5"
vc.Rplot5 <- ggplot(data=vc.logtransform[['rcmb5']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "steelblue2")+
geom_point(colour = "steelblue2") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Rplot5
## RECOMBINATION 07 ##
vc.logtransform[['rcmb7']]$title <- "Scaffold 7"
vc.Rplot7 <- ggplot(data=vc.logtransform[['rcmb7']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumseagreen")+
geom_point(colour = "mediumseagreen") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vc.Rplot7
# Now Vidua!
# Set working directory:
setwd("~/Desktop/WASPS/vespula_vidua/scaffs/")
# Import the scaffolds:
vv.scaff3 <- read.table("Scaffold03.pruned.txt", stringsAsFactors = F, header = TRUE)
vv.scaff4 <- read.table("Scaffold04.pruned.txt", stringsAsFactors = F, header = TRUE)
vv.scaff5 <- read.table("Scaffold05.pruned.txt", stringsAsFactors = F, header = TRUE)
vv.scaff7 <- read.table("Scaffold07.pruned.txt", stringsAsFactors = F, header = TRUE)
## SCAFFOLD 03 ##
vv.scaff3$title <- "Scaffold 3"
vv.Plot3 <- ggplot(data=vv.scaff3, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumpurple4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Plot3
## SCAFFOLD 04 ##
vv.scaff4$title <- "Scaffold 4"
vv.Plot4 <- ggplot(data=vv.scaff4, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "skyblue4", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Plot4
## SCAFFOLD 05 ##
vv.scaff5$title <- "Scaffold 5"
vv.Plot5 <- ggplot(data=vv.scaff5, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "steelblue2", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Plot5
## SCAFFOLD 07 ##
vv.scaff7$title <- "Scaffold 7"
vv.Plot7 <- ggplot(data=vv.scaff7, aes(x=Position, y=centiMorgan, group=1)) +
geom_point(colour = "mediumseagreen", size=1) + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6, accuracy = 1.0),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Plot7
# Chang working directory to the appropriate directory:
setwd("~/Desktop/WASPS/vespula_vidua/new_recombination/melee_calc/")
# Read in the tripleStats.txt file produced from SlopeCalc.py on HPCC:
vv.recomb3 <- read.table("Scaffold03.recombination.txt", stringsAsFactors = F, header = TRUE)
vv.recomb4 <- read.table("Scaffold04.recombination.txt", stringsAsFactors = F, header = TRUE)
vv.recomb5 <- read.table("Scaffold05.recombination.txt", stringsAsFactors = F, header = TRUE)
vv.recomb7 <- read.table("Scaffold07.recombination.txt", stringsAsFactors = F, header = TRUE)
# Make a list of all the dataframes;
vv.recombination <- list(vv.recomb3, vv.recomb4, vv.recomb5, vv.recomb7)
# Remove NaNs from all the dataframes in the list
#vv.recombination_clean <- lapply(vv.recombination, function(x) { na.omit(x)})
# Take absolute value of all the slopes:
#vv.positive_slopes <- lapply(vv.recombination_clean, function(x) {x$absSlope <- abs(x$slope); return(x) })
# Log transform the slope values:
vv.logtransform <- lapply(vv.recombination, function(x) { x$logSlope <- log10(x$slope); return(x) })
# Very small positive values generally turn into larger negative values.
# Zeros turn into -Inf values.
names(vv.logtransform) <- c("rcmb3","rcmb4", "rcmb5", "rcmb7")
## RECOMBINATION 03 ##
vv.logtransform[['rcmb3']]$title <- "Scaffold 3"
vv.Rplot3 <- ggplot(data=vv.logtransform[['rcmb3']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumpurple4")+
geom_point(colour = "mediumpurple4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6),
breaks = c(39e+06, 42e+06, 45e+06, 48e+06, 51e+06), limits = c(38.5e+06,51.1e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Rplot3
## RECOMBINATION 04 ##
vv.logtransform[['rcmb4']]$title <- "Scaffold 4"
vv.Rplot4 <- ggplot(data=vv.logtransform[['rcmb4']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "skyblue4")+
geom_point(colour = "skyblue4") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6),
breaks = c(52e+06, 54e+06, 56e+06, 58e+06, 60e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Rplot4
## RECOMBINATION 05 ##
vv.logtransform[['rcmb5']]$title <- "Scaffold 5"
vv.Rplot5 <- ggplot(data=vv.logtransform[['rcmb5']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "steelblue2")+
geom_point(colour = "steelblue2") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6),
breaks = c(62e+06, 64e+06, 66e+06, 68e+06, 70e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Rplot5
## RECOMBINATION 07 ##
vv.logtransform[['rcmb7']]$title <- "Scaffold 7"
vv.Rplot7 <- ggplot(data=vv.logtransform[['rcmb7']], aes(x=midpoint, y=logSlope, group=1)) +
geom_line(colour = "mediumseagreen")+
geom_point(colour = "mediumseagreen") + theme_bw() +
scale_x_continuous(labels = scales::unit_format(unit = NULL, scale = 1e-6),
breaks = c(79e+06, 81e+06, 83e+06, 85e+06, 87e+06)) +
theme(axis.title = element_text(face="plain",size=15)) +
theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + facet_grid(. ~ title)
vv.Rplot7
# For 24 line plots, in a 4x6 grid:
grid <- plot_grid(vp.Plot3, vp.Plot4, vp.Plot5, vp.Plot7,
vp.Rplot3, vp.Rplot4, vp.Rplot5, vp.Rplot7,
vc.Plot3, vc.Plot4, vc.Plot5, vc.Plot7,
vc.Rplot3, vc.Rplot4, vc.Rplot5, vc.Rplot7,
vv.Plot3, vv.Plot4, vv.Plot5, vv.Plot7,
vv.Rplot3, vv.Rplot4, vv.Rplot5, vv.Rplot7,
ncol = 4, nrow = 6, labels=c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y"),
align = "v")
grid.arrange(grid, left = textGrob("Recombination rate (-log(cM/Mb))", rot = 90),
bottom = textGrob("physical position (Mb)"))
# Set working directory:
setwd("~/Desktop/WASPS/final_figures/")
# Set the high-resolution png file
png(filename = "~/Desktop/WASPS/Vespula.comparison.recombination.map.png",
width = 15, height = 15, res = 400, units = 'in',
type = c("quartz")) # for high resolution figure
dev.off()