From 3392c67e0f3977e876d154c9c52c4c823f0bc4ba Mon Sep 17 00:00:00 2001 From: droazen Date: Wed, 22 Jun 2011 22:55:05 +0000 Subject: [PATCH] Support for command-line arguments. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@6055 348d0f76-0448-11de-a6fe-93d51630548a --- R/exomePreQC.R | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/R/exomePreQC.R b/R/exomePreQC.R index 6400490d4..b6315c148 100644 --- a/R/exomePreQC.R +++ b/R/exomePreQC.R @@ -1,6 +1,14 @@ require('ggplot2') -data <- read.table('GoT2D_exomes_batch_005.tsv',header=T) +args = commandArgs(TRUE) +onCMDLine = ! is.na(args[1]) + +if ( onCMDLine ) { + inputTSV = args[1] + outputPDF = args[2] +} + +data <- read.table(inputTSV,header=T) fingerprint_lods = list() for(i in 1:nrow(data)) { @@ -9,7 +17,7 @@ for(i in 1:nrow(data)) { fingerprint_lod_order = order(unlist(lapply(fingerprint_lods,median),use.names=F)) -pdf('T2D.pdf') +pdf(outputPDF) boxplot(fingerprint_lods[fingerprint_lod_order],las=3,main='Fingerprint LOD Scores By Sample',xlab='Sample',ylab='LOD Score Distribution',cex.axis=0.65) qplot(sample,GENOME_SIZE,data=data) + opts(title='Genome Size per Sample') qplot(sample,PCT_SELECTED_BASES,data=data) + opts(title='On+Near Bait Bases/PF Bases Aligned per Sample')