From 6037443e55870f50c1322ee722f655aa269678d4 Mon Sep 17 00:00:00 2001 From: kiran Date: Wed, 11 Aug 2010 02:38:53 +0000 Subject: [PATCH] Handle interactive and non-interactive modes more elegantly. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4009 348d0f76-0448-11de-a6fe-93d51630548a --- R/VariantReport/VariantReport.R | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/R/VariantReport/VariantReport.R b/R/VariantReport/VariantReport.R index 36290ce3b..f2f65409c 100644 --- a/R/VariantReport/VariantReport.R +++ b/R/VariantReport/VariantReport.R @@ -1,13 +1,15 @@ source(paste(Sys.getenv("STING_DIR"), "/R/gsacommons.R", sep="")); -args = commandArgs(TRUE); +if (interactive()) { + if (!exists("plotRoot")) { + plotRoot = "test.plot"; + } +} else { + args = commandArgs(TRUE); -evalRoot = args[1]; -#if (is.na(evalRoot)) { evalRoot = "/home/radon01/kiran/scr1/projects/ESPGabrielDownsampling/results/v1/merged.vcf.eval120/eval"; } -if (is.na(evalRoot)) { evalRoot = "/home/radon01/kiran/scr1/projects/ESPGabrielDownsampling/results/v1/merged.vcf.eval.v2/eval"; } - -plotRoot = args[2]; -if (is.na(plotRoot)) { plotRoot = "plot"; } + evalRoot = args[1]; + plotRoot = args[2]; +} eval = read.eval(evalRoot); @@ -56,6 +58,6 @@ plot.titvSpectrum(eval, novelty_name="novel"); plot.end(plotRoot); # Per-sample -plot.begin(plotRoot, "variants_per_sample", width=12, height=8); -plot.variantsPerSample(eval); -plot.end(plotRoot); +#plot.begin(plotRoot, "variants_per_sample", width=12, height=8); +#plot.variantsPerSample(eval); +#plot.end(plotRoot);