From 54adbd258187574c121a5fd551f96d9c724740c5 Mon Sep 17 00:00:00 2001 From: depristo Date: Mon, 3 Jan 2011 13:33:35 +0000 Subject: [PATCH] Added instantaneous rate plotting routine to performance log plotter git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4926 348d0f76-0448-11de-a6fe-93d51630548a --- R/plot_GATK_performance_log.R | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/R/plot_GATK_performance_log.R b/R/plot_GATK_performance_log.R index d71531221..f63768b14 100644 --- a/R/plot_GATK_performance_log.R +++ b/R/plot_GATK_performance_log.R @@ -13,10 +13,35 @@ if ( onCMDLine ) { if ( onCMDLine ) pdf(OUTPUT_PDF) +vec.margin <- function(x) { + l = length(x) + d = x[-1] - x[1:(l-1)] + c(x[1], d[1:(l-1)]) +} + +l = length(d$units.processed) +d$units.processed.margin = vec.margin(d$units.processed) +#prev = 0 +#for ( i in 1:l ) { +# cur = d$units.processed[i] +# d[i,]$units.processed.margin = cur - prev +# prev = cur +#} + generateOneReport <- function(d) { - qs = quantile(d$processing.speed, probs = c(0.05, 0.5, 0.95)) + qs = quantile(d$processing.speed, probs = c(0.01, 0.5, 0.99)) + + # unit processing time plot(d$elapsed.time, d$processing.speed, main=DESCRIPTION, xlab="Elapsed time (sec)", ylab="Processing speed (seconds per 1M units)", ylim=c(qs[1], qs[3]), type="b", col="cornflowerblue", lwd=2) abline(h=qs[2], lty=2) + + # instantaneous processing speed + running_median_window = 101 + rm = runmed(d$units.processed.margin, running_median_window) + POINT_COL = "#0000AA33" + plot(d$elapsed.time, d$units.processed.margin, main=DESCRIPTION, xlab="Elapsed time (sec)", ylab="Units processed in last timing interval", type="p", cex = 0.5, col=POINT_COL) + lines(d$elapsed.time, rm, lwd=3, col="red") + legend("topleft", c("Observations", "101-elt running median"), fill=c(POINT_COL, "red")) } if ( RUNME ) {