11library(ggplot2 );
2- library(ggpubr )
3-
2+ library(svglite );
3+ library( ggpubr );
44arguments <- commandArgs(TRUE );
55INPUT <- arguments [1 ];
66OUTPUT <- arguments [2 ];
@@ -22,21 +22,21 @@ BRHcov <- read.table(file=INPUT, header=F, comment.char = "");
2222
2323
2424 trans <- ggplot(BRHcov , aes(x = V3 )) +
25- geom_bar (fill = " #3d9fac" , alpha = 0.8 , binwidth = 1 , position = " identity" ) +
25+ geom_histogram (fill = " #3d9fac" , alpha = 0.8 , binwidth = 1 , position = " identity" ) +
2626 xlab(paste(" \n " , QUERY , " Coverage\n " )) + ylab(" Count\n " ) + xlim(0 ,100 ) +
2727 geom_vline(xintercept = median(BRHcov $ V3 ), linetype = " dashed" ) +
2828 theme_bw();
2929
3030 subj <- ggplot(BRHcov , aes(x = V4 )) +
31- geom_bar (fill = " #ef5030" , alpha = 0.8 , binwidth = 1 , position = " identity" ) +
31+ geom_histogram (fill = " #ef5030" , alpha = 0.8 , binwidth = 1 , position = " identity" ) +
3232 xlab(paste(SUBJECT , " Coverage\n " )) + ylab(" \n Count" ) + xlim(0 ,100 ) +
3333 geom_vline(xintercept = median(BRHcov $ V4 ), linetype = " dashed" ) +
3434 theme_bw() + coord_flip();
3535
3636 title <- ggparagraph(text = paste(" BRHs " , PROGRAM , " \n n = " , nrow(BRHcov )),
3737 color = " black" , face = " bold" , size = 12 , );
3838 arranged <- ggarrange(trans + rremove(" x.title" ), title , scatt , subj + rremove(" y.title" ), ncol = 2 , nrow = 2 , align = " hv" );
39- ggexport(arranged , filename = OUTPUT );
39+ ggexport(arranged , filename = OUTPUT , width = 500 , height = 500 );
4040 # png(filename=OUTPUT);
4141 # arrangeGrob(trans + rremove("x.title"), junk, scatt, subj + rremove("y.title"), ncol=2);
4242 # dev.off();
0 commit comments