Merge pull request #411 from broadinstitute/eb_add_exome_intervals_to_bundle_script

Updated the GATK bundle script to:
This commit is contained in:
Eric Banks 2013-10-29 07:38:44 -07:00
commit cafcb34855
1 changed files with 16 additions and 2 deletions

View File

@ -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)
}