From 209f2a61aa7e8f1e2903c0e25261edcee948507a Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 29 Oct 2013 10:33:51 -0400 Subject: [PATCH] Updated the GATK bundle script to: 1. Include exome target list for b37 2. Not delete the 'current' link unless -run is applied to the command line! (sorry, Ryan) --- .../queue/qscripts/GATKResourcesBundle.scala | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/GATKResourcesBundle.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/GATKResourcesBundle.scala index 1736adc17..d3e94d306 100644 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/GATKResourcesBundle.scala +++ b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/GATKResourcesBundle.scala @@ -95,6 +95,7 @@ class GATKResourcesBundle extends QScript { def isBAM(file: File) = file.getName.endsWith(".bam") def isOUT(file: File) = file.getName.endsWith(".out") def isFASTA(file: File) = file.getName.endsWith(".fasta") + def isIntervalList(file: File) = file.getName.endsWith(".interval_list") var RESOURCES: List[Resource] = Nil def addResource(comp: Resource) { RESOURCES = comp :: RESOURCES } @@ -180,11 +181,17 @@ class GATKResourcesBundle extends QScript { "NA12878.HiSeq.WGS.bwa.cleaned.raw.subset", b37, true, true)) // - // Test BAM file, specific to each reference + // Test BAM file, only for the b37 reference // addResource(new Resource("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WGS.b37.NA12878.bam", "IGNORE", b37, false, false)) + // + // Exome targets file, only for the b37 reference + // + addResource(new Resource("/seq/references/HybSelOligos/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", + "Broad.human.exome", b37, true, false, false)) + // // refGene files specific to each reference // @@ -217,7 +224,7 @@ class GATKResourcesBundle extends QScript { val currentLink = new File(BUNDLE_ROOT + "/current") - if ( currentLink.exists ) currentLink.delete() + if ( currentLink.exists ) add(new deleteLink(currentLink)) add(new linkFile(bundleDir, currentLink)) } @@ -275,6 +282,9 @@ class GATKResourcesBundle extends QScript { } } } + } else if ( isIntervalList(resource.file) ) { + val out = destFile(BUNDLE_DIR, resource.ref, resource.destname(resource.ref)) + add(new cpFile(resource.file, out)) } else { //throw new ReviewedStingException("Unknown file type: " + resource) } @@ -354,6 +364,10 @@ class GATKResourcesBundle extends QScript { def commandLine = "cp %s %s".format(in.getAbsolutePath, out.getAbsolutePath) } + class deleteLink(@Input val in: File) extends CommandLineFunction { + def commandLine = "rm %s".format(in.getAbsolutePath) + } + class linkFile(@Input val in: File, @Output val out: File) extends CommandLineFunction { def commandLine = "ln -s %s %s".format(in.getAbsolutePath, out.getAbsolutePath) }