Skip to content

Commit

Permalink
added main param to libsize.barplot
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanheld committed Mar 22, 2017
1 parent 2274559 commit a1a1f99
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/R-scripts/deg_lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand Down

0 comments on commit a1a1f99

Please sign in to comment.