From 7639692e5b4eea3d9d402fb7fb13143754cd2393 Mon Sep 17 00:00:00 2001 From: chartl Date: Fri, 1 Oct 2010 03:28:36 +0000 Subject: [PATCH] Sigh. Fix the source of even more UserErrors in the phone home directory: make sure to gunzip the beagle files before passing them into the conversion walker... git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4399 348d0f76-0448-11de-a6fe-93d51630548a --- scala/qscript/chartl/RefineGenotypesAndMerge.q | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scala/qscript/chartl/RefineGenotypesAndMerge.q b/scala/qscript/chartl/RefineGenotypesAndMerge.q index d9403a00e..ff6593e9a 100755 --- a/scala/qscript/chartl/RefineGenotypesAndMerge.q +++ b/scala/qscript/chartl/RefineGenotypesAndMerge.q @@ -25,6 +25,13 @@ class BeagleGenotypeRefinement extends QScript { this.jarFile = qscript.gatkJar } + class GunzipFile(in: File, out:File ) extends CommandLineFunction { + @Input(doc="file to gunzip") var inp = in + @Output(doc="file to gunzip to") var outp = out + + def commandLine = "gunzip -c %s > %s".format(inp.getAbsolutePath, outp.getAbsolutePath) + } + class BeagleRefinement extends CommandLineFunction { @Input(doc="The beagle input file") var beagleInput: File = _ var beagleOutputBase: String = _ @@ -66,15 +73,20 @@ class BeagleGenotypeRefinement extends QScript { refine.memoryLimit = Some(6) refine.freezeOutputs + var unzipPhased = new GunzipFile(refine.beaglePhasedFile,swapExt(refine.beaglePhasedFile,".gz",".bgl")) + var unzipProbs = new GunzipFile(refine.beagleLikelihoods,swapExt(refine.beagleLikelihoods,".gz",".bgl")) + var vcfConvert = new BeagleOutputToVCF with GATKArgs vcfConvert.variantVCF = inputVCF vcfConvert.rodBind :+= new RodBind("beagleR2","BEAGLE",refine.beagleRSquared) - vcfConvert.rodBind :+= new RodBind("beaglePhased","BEAGLE",refine.beaglePhasedFile) - vcfConvert.rodBind :+= new RodBind("beagleProbs","BEAGLE",refine.beagleLikelihoods) + vcfConvert.rodBind :+= new RodBind("beaglePhased","BEAGLE",unzipPhased.outp) + vcfConvert.rodBind :+= new RodBind("beagleProbs","BEAGLE",unzipProbs.outp) vcfConvert.out = outputVCF commands :+= beagleInput commands :+= refine + commands :+= unzipPhased + commands :+= unzipProbs commands :+= vcfConvert return commands