From 594fb4a5472750d0200a3fc7f97532637626d362 Mon Sep 17 00:00:00 2001 From: depristo Date: Wed, 8 Sep 2010 02:56:51 +0000 Subject: [PATCH] More plots in report git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4225 348d0f76-0448-11de-a6fe-93d51630548a --- R/GATKRunReport.R | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/R/GATKRunReport.R b/R/GATKRunReport.R index 418257a56..a809b8aa8 100644 --- a/R/GATKRunReport.R +++ b/R/GATKRunReport.R @@ -1,6 +1,7 @@ args = commandArgs(TRUE); onCMDLine = ! is.na(args[1]) +if (! is.na(args[3]) ) { name = args[3] } else { name = "" } if ( onCMDLine ) { print(paste("Reading data from", args[1])) @@ -27,7 +28,7 @@ myTable <- function(x, y, reqRowNonZero = F) { table <- prop.table(table(x, y), 2) ncols = dim(table)[2] - print(table) + #print(table) if ( reqRowNonZero ) table = table[addmargins(table)[1:dim(table)[1],ncols] > 0,] @@ -40,7 +41,9 @@ plotTable <- function(table, name) { ncols = dim(table)[2] nrows = dim(table)[1] cols = rainbow(nrows) - plot( as.numeric(table[1,]), type="n", ylim=c(0,1), main = name, ylab="Frequency", xlab="Date", xaxt="n") + tableMin = min(apply(table, 2, min)) + tableMax = max(apply(table, 2, max)) + plot( as.numeric(apply(table, 2, sum)), ylim=c(tableMin, tableMax), type="n", main = name, ylab="Frequency", xlab="Date", xaxt="n") axis(1, 1:ncols, labels=colnames(table)) for ( i in 1:nrows ) points(table[i,], type="b", col=cols[i]) @@ -52,6 +55,12 @@ RUNNING_GATK_RUNTIME <- 60 * 5 # 5 minutes => bad failure if ( onCMDLine ) pdf(args[2]) +successfulRuns <- function(d) { + x <- rep("Successful", length(d$exception.msg)) + x[! is.na(d$exception.msg)] <- "Failed" + return(x) +} + generateOneReport <- function(d, header, includeByWeek = T) { head <- function(s) { return(paste("Section:", header, ":", s)) @@ -62,17 +71,21 @@ generateOneReport <- function(d, header, includeByWeek = T) { par("mar", c(5, 4, 4, 2)) frame() - title(paste("Section:", header), cex=2) + title(paste("GATK run report", name, "for", Sys.Date(), "\nwith", dim(d)[1], "run repository records"), cex=2) - reportCountingPlot(d$walker.name, head("Walker invocations")) - reportCountingPlot(d$svn.version, head("GATK SVN version")) - # cuts by time - plotTable(myTable(d$svn.version, d$start.time), head("SVN version by day")) if ( includeByWeek ) { + plotTable(table(rep("GATK Invocations", length(d$start.time)), cut(d$start.time, "weeks")), head("GATK Invocations by week")) + plotTable(myTable(successfulRuns(d), cut(d$start.time, "weeks")), head("Successful and failing GATK invocations per week")) + plotTable(myTable(d$svn.version, cut(d$start.time, "weeks")), head("SVN version by week")) plotTable(myTable(excepted$walker.name, cut(excepted$start.time, "weeks"), reqRowNonZero = T), head("Walkers with exceptions by week")) } + plotTable(table(rep("GATK Invocations", length(d$start.time)), d$start.time), head("GATK Invocations by day")) + plotTable(myTable(d$svn.version, d$start.time), head("SVN version by day")) + + reportCountingPlot(d$walker.name, head("Walker invocations")) + reportCountingPlot(d$svn.version, head("GATK SVN version")) # reportCountingPlot(d$java.tmp.directory, head("Java tmp directory")) reportCountingPlot(d$working.directory, head("Working directory"))