From 4d611e53e73f8902c51ef58bb4caee9a6012d095 Mon Sep 17 00:00:00 2001 From: kshakir Date: Thu, 20 Jan 2011 06:08:45 +0000 Subject: [PATCH] Passing the ADPR R script to FCPTest. Changed the FCP.q to use an InProcessFunction work around the -runDir issue GSA-420. Tested the FCPTest using the following dotkits and "ant clean pipelinetest -Dpipeline.run=run": - R-2.11 - Oracle-full-client - .cx-oracle-5.0.2-python-2.6.5-oracle-full-client-11.1 git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5029 348d0f76-0448-11de-a6fe-93d51630548a --- .../qscript/playground/fullCallingPipeline.q | 37 +++++++++++++------ .../pipeline/FullCallingPipelineTest.scala | 4 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/scala/qscript/playground/fullCallingPipeline.q b/scala/qscript/playground/fullCallingPipeline.q index 62a3d7bdf..df76a8f46 100755 --- a/scala/qscript/playground/fullCallingPipeline.q +++ b/scala/qscript/playground/fullCallingPipeline.q @@ -48,7 +48,7 @@ class fullCallingPipeline extends QScript { var skip_cleaning = false @Input(doc="ADPR script", shortName ="tearScript", required=true) - var adprthing: File = _ + var tearScript: File = _ //@Input(doc="Sequencing maching name (for use by adpr)") //var machine: String = _ @@ -200,18 +200,10 @@ class fullCallingPipeline extends QScript { } } - //def endToEnd(base: String, bamType: String, adprthing: File, seqinfo: String, exptype: String) = { def endToEnd(base: String, bamType: String) = { val samples = qscript.pipeline.getSamples.filter(_.getBamFiles.contains(bamType)).toList val bamFiles = samples.map(_.getBamFiles.get(bamType)) - val listOfBams = new File(base +".BamFiles.list") - - val writer = new PrintWriter(listOfBams) - for (bamFile <- bamFiles){ - writer.println(bamFile.toString) - } - writer.close() // step through the un-indel-cleaned graph: // 1a. call snps and indels @@ -385,7 +377,28 @@ class fullCallingPipeline extends QScript { } add(snps) - // 5. Run the ADPR and make pretty stuff + // 5. Make the bam list + val listOfBams = new File(base +".BamFiles.list") + + class BamListWriter extends InProcessFunction { + @Input(doc="bamFiles") var bamFiles: List[File] = Nil + @Output(doc="bamList") var bamList: File = _ + + def run { + val writer = new PrintWriter(bamList) + for (bamFile <- bamFiles) + writer.println(bamFile.toString) + writer.close() + } + } + + val writeBamList = new BamListWriter + writeBamList.bamFiles = bamFiles + writeBamList.bamList = listOfBams + writeBamList.analysisName = base + "_BamList" + writeBamList.jobOutputFile = new File(".queue/logs/SNPCalling/bamlist.out") + + // 6. Run the ADPR and make pretty stuff class rCommand extends CommandLineFunction{ @Argument(doc="R script") @@ -404,7 +417,7 @@ class fullCallingPipeline extends QScript { val adpr = new rCommand adpr.bamlist = listOfBams - adpr.script = adprthing + adpr.script = tearScript adpr.evalroot = eval.reportLocation adpr.jobOutputFile = new File(".queue/logs/SNPCalling/adpr.out") adpr.tearsheet = new File("SnpCalls", base + ".tearsheet.pdf") @@ -416,6 +429,6 @@ class fullCallingPipeline extends QScript { add(igv2) } - add(mergeIndels,annotated,masker,handFilter,eval,adpr) + add(mergeIndels,annotated,masker,handFilter,eval,writeBamList,adpr) } } diff --git a/scala/test/org/broadinstitute/sting/queue/pipeline/FullCallingPipelineTest.scala b/scala/test/org/broadinstitute/sting/queue/pipeline/FullCallingPipelineTest.scala index 6eb1f4cd6..6d3e4d63d 100644 --- a/scala/test/org/broadinstitute/sting/queue/pipeline/FullCallingPipelineTest.scala +++ b/scala/test/org/broadinstitute/sting/queue/pipeline/FullCallingPipelineTest.scala @@ -90,10 +90,12 @@ class FullCallingPipelineTest extends BaseTest { var cleanType = "cleaned" // Run the pipeline with the expected inputs. + val currentDir = new File(".").getAbsolutePath var pipelineCommand = ("-retry 1 -S scala/qscript/playground/fullCallingPipeline.q" + " -jobProject %s -Y %s -refseqTable %s" + + " -tearScript %s/R/DataProcessingReport/GetTearsheetStats.R" + " --gatkjar %s/dist/GenomeAnalysisTK.jar") - .format(projectName, yamlFile, dataset.refseq, new File(".").getAbsolutePath) + .format(projectName, yamlFile, dataset.refseq, currentDir, currentDir) if (!dataset.runIndelRealigner) { pipelineCommand += " -skipCleaning"