From 4d0e34109fbc61875a98d9ee9a27a0183c5fbb6d Mon Sep 17 00:00:00 2001 From: Khalid Shakir Date: Thu, 27 Oct 2011 14:51:56 -0400 Subject: [PATCH] Compacting pdfs when running under R 2.13+. --- .../plot_residualError_OtherCovariate.R | 13 +++++++++++++ .../plot_residualError_QualityScoreCovariate.R | 14 ++++++++++++++ .../walkers/variantrecalibration/plot_Tranches.R | 6 ++++++ 3 files changed, 33 insertions(+) diff --git a/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_OtherCovariate.R b/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_OtherCovariate.R index a1385ff3f..15c6fc8f0 100644 --- a/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_OtherCovariate.R +++ b/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_OtherCovariate.R @@ -1,5 +1,7 @@ #!/bin/env Rscript +library(tools) + args <- commandArgs(TRUE) verbose = TRUE @@ -47,6 +49,9 @@ if( is.numeric(c$Covariate) ) { } dev.off() +if (exists('compactPDF')) { + compactPDF(outfile) +} # # Plot mean quality versus the covariate @@ -69,6 +74,10 @@ if( is.numeric(c$Covariate) ) { } dev.off() +if (exists('compactPDF')) { + compactPDF(outfile) +} + # # Plot histogram of the covariate # @@ -106,3 +115,7 @@ if( is.numeric(c$Covariate) ) { axis(2,axTicks(2), format(axTicks(2), scientific=F)) } dev.off() + +if (exists('compactPDF')) { + compactPDF(outfile) +} diff --git a/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_QualityScoreCovariate.R b/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_QualityScoreCovariate.R index 81bc9460d..33eeb1f16 100644 --- a/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_QualityScoreCovariate.R +++ b/public/R/scripts/org/broadinstitute/sting/analyzecovariates/plot_residualError_QualityScoreCovariate.R @@ -1,5 +1,7 @@ #!/bin/env Rscript +library(tools) + args <- commandArgs(TRUE) input = args[1] @@ -33,6 +35,10 @@ points(f$Qreported, f$Qempirical, type="p", col="maroon1", pch=16) abline(0,1, lty=2) dev.off() +if (exists('compactPDF')) { + compactPDF(outfile) +} + # # Plot Q empirical histogram # @@ -52,6 +58,10 @@ points(hst2$f.Qempirical, hst2$f.nBases, type="h", lwd=4, col="maroon1") axis(2,axTicks(2), format(axTicks(2), scientific=F)) dev.off() +if (exists('compactPDF')) { + compactPDF(outfile) +} + # # Plot Q reported histogram # @@ -68,3 +78,7 @@ plot(hst$e.Qreported, hst$e.nBases, type="h", lwd=4, xlim=c(0,maxQ), ylim=c(0,yM points(hst2$f.Qreported, hst2$f.nBases, type="h", lwd=4, col="maroon1") axis(2,axTicks(2), format(axTicks(2), scientific=F)) dev.off() + +if (exists('compactPDF')) { + compactPDF(outfile) +} diff --git a/public/R/scripts/org/broadinstitute/sting/gatk/walkers/variantrecalibration/plot_Tranches.R b/public/R/scripts/org/broadinstitute/sting/gatk/walkers/variantrecalibration/plot_Tranches.R index a79ddd3ab..d96add768 100755 --- a/public/R/scripts/org/broadinstitute/sting/gatk/walkers/variantrecalibration/plot_Tranches.R +++ b/public/R/scripts/org/broadinstitute/sting/gatk/walkers/variantrecalibration/plot_Tranches.R @@ -1,5 +1,7 @@ #!/bin/env Rscript +library(tools) + args <- commandArgs(TRUE) verbose = TRUE @@ -85,3 +87,7 @@ if ( ! is.null(sensitivity) ) { } dev.off() + +if (exists('compactPDF')) { + compactPDF(outfile) +}