5 indat <- read.delim('e5.snp.txt', encoding="UTF-8")
6 for (ncol in 1:nrow(indat)) {
7 for (nrow in 5:ncol(indat)) {
8 tmp <- unlist(strsplit(indat[ncol,nrow],','))
9 indat[ncol,nrow] <- tmp[length(tmp)]
12 write.csv(indat,'e5.depth.csv')
15 snpdat <- read.csv('e5.depth.csv', encoding="UTF-8")
16 plotdat <- pivot_longer(snpdat, cols = starts_with("rs"), names_to = "SNPs",values_to = "Depth")
19 cairo_pdf('boxType.pdf', pointsize = PlotPointsize) # Not working on macOS, either cairo_pdf or CairoPDF.
20 ggplot(plotdat, aes(TypeCN, Depth)) + geom_boxplot(colour = rainbow(length(unique(plotdat$Type))))
23 pdf('boxSample.pdf', pointsize = PlotPointsize, width=32, height=16)
24 ggplot(plotdat, aes(ID, Depth)) + geom_boxplot(colour = rainbow(length(unique(plotdat$ID))))
27 pdf('boxTypeL10.pdf', pointsize = PlotPointsize)
28 ggplot(plotdat, aes(Type, Depth)) + geom_boxplot(colour = rainbow(length(unique(plotdat$Type)))) + scale_y_continuous(trans='log10')
31 pdf('boxSampleL10.pdf', pointsize = PlotPointsize, width=32, height=16)
32 ggplot(plotdat, aes(ID, Depth)) + geom_boxplot(colour = rainbow(length(unique(plotdat$ID)))) + scale_y_continuous(trans='log10')