diff --git a/scripts/R-scripts/deg_lib.R b/scripts/R-scripts/deg_lib.R index 7a04b14b..d3ae45c4 100644 --- a/scripts/R-scripts/deg_lib.R +++ b/scripts/R-scripts/deg_lib.R @@ -553,8 +553,10 @@ calc.stats.per.sample <- function(sample.descriptions, ################################################################ ## Draw a barplot with the number of reads per sample libsize.barplot <- function(stats.per.sample, - plot.file=NULL) { - + main="Read library sizes (libsum per sample)", + plot.file=NULL, + ...) { + ## Adapt boxplot size to the number of samples and label sizes boxplot.lmargin <- max(nchar(sample.desc$label))/3+5 boxplot.height <- length(sample.ids)/3+2 @@ -566,10 +568,11 @@ libsize.barplot <- function(stats.per.sample, } par(mar=c(5,boxplot.lmargin,4,1)) ## adapt axes - bplt <- barplot(stats.per.sample$Mreads, names.arg = stats.per.sample$label, horiz = TRUE, las=1, + bplt <- barplot(stats.per.sample$Mreads, names.arg = stats.per.sample$label, + main=main, + horiz = TRUE, las=1, xlab="libsum (Million reads per sample)", - main="Read library sizes (libsum per sample)", - col=stats.per.sample$color) + col=stats.per.sample$color, ...) grid(col="white", lty="solid",ny = 0) text(x=pmax(stats.per.sample$Mreads, 3), labels=stats.per.sample$Mreads, y=bplt,pos=2, font=2) if (!is.null(plot.file)) {