modified: Makefile
[GalaxyCodeBases.git] / perl / etc / justonce / oyk / bin / ggplot_bar.depth.forPCR.R
blobb7e7fdd2676d5db628c1b7bc04cb12c0cf7784e5
1 library(ggplot2)
2 library(splines)
3 args <- commandArgs(trailingOnly = TRUE)
5 input <- args[1]
6 output <- args[2]
8 #pdf(file=output,height=6.18,width=10)
9 pdf(output)
10 raw.tab <- read.table(file=input,sep ="\t",header = T)
11 input.tab <- subset(raw.tab, select = -1 )
12 name <- names(input.tab)
15 for (i in 1:ncol(input.tab)){
16 #       input.tab[is.na(input.tab)] <- -1
17         invalues <- log10(input.tab[,i])
18 #       invalues <- input.tab[,i]
19         print(
20                 ggplot(data=input.tab,aes(x=invalues)) +
21                 geom_histogram(position="dodge", bins = 200,na.rm = TRUE, color="darkblue", fill="lightblue") +
22                 labs(title=name[i],x="log10(Depth)",y="Number of SNP",size=20) +
23 #               theme_bw() +
24 #               theme(panel.grid.major = element_blank(),panel.grid.minor = element_blank()) +
25                 theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black")) +
26                 scale_y_continuous(breaks=seq(0,10000,100)) +
27                 theme(axis.title.x = element_text(size = 10, color = "black", face = "italic", vjust = 0.5, hjust = 0.5)) +
28                 theme(axis.title.y = element_text(size = 10, color = "black", face = "italic", vjust = 0.5, hjust = 0.5)) +
29                 theme(axis.text.x = element_text(size = 8, color = "black", face = "bold", vjust = 0.5, hjust = 0.5)) +
30                 theme(axis.text.y = element_text(size = 8, color = "black", face = "bold", vjust = 0.5, hjust = 0.5)) +
31                 theme(legend.text = element_text(size = 8, color = "black", face = "bold", vjust = 0.5, hjust = 0.5))
32         )
34 dev.off()