gatk-3.8/scala/qscript/oneoffs/kshakir/UGMemoryTests.scala

53 lines
2.0 KiB
Scala
Raw Normal View History

import org.broadinstitute.sting.datasources.pipeline.Pipeline
import org.broadinstitute.sting.queue.QScript
import org.broadinstitute.sting.queue.extensions.gatk._
import org.broadinstitute.sting.utils.yaml.YamlUtils
import collection.JavaConversions._
class UGMemoryTests extends QScript {
qscript =>
@Argument(doc="the YAML file specifying inputs, interval lists, reference sequence, etc.", shortName="Y")
var yamlFile: File = _
@Input(doc="The path to the GenomeAnalysisTK.jar file.", shortName="gatk")
var gatkJar: File = null
@Input(doc="per-sample downsampling level",shortName="dcov",required=false)
var downsampling_coverage = 300
def script = {
val pipeline = YamlUtils.load(classOf[Pipeline], qscript.yamlFile)
val memoryLimits = List(1,2,4,6,8,10,12,16)
val recalibratedSamples = pipeline.getSamples.map(_.getBamFiles.get("recalibrated")).toList
val squid1 = "C315"
val squid2 = "C338"
val numBamsList = List(10, 20, 50, 70, 100, 120, 150)
val squid1Bams = recalibratedSamples.filter(_.getAbsolutePath.contains(squid1))
val squid2Bams = recalibratedSamples.filter(_.getAbsolutePath.contains(squid2))
for (memoryLimit <- memoryLimits) {
for (numBams <- numBamsList) {
val dir = "%03d_bams_%02dg".format(numBams, memoryLimit)
val snps = new UnifiedGenotyper
snps.jobOutputFile = new File(dir, "UnifiedGenotyper.out")
snps.out = new File(dir, "UnifiedGenotyper.vcf")
snps.input_file = squid1Bams.take(numBams/2) ++ squid2Bams.take(numBams/2)
Walkers can now specify a class extending from Gatherer to merge custom output formats. Add @Gather(MyGatherer.class) to the walker @Output. JavaCommandLineFunctions can now specify the classpath+mainclass as an alternative to specifying a path to an executable jar. JCLF by default pass on the current classpath and only require the mainclass be specified by the developer extending the JCLF, relieving the QScript author from having to explicitly specify the jar. Like the Picard MergeSamFiles, GATK engine by default is now run from the current classpath. The GATK can still be overridden via .jarFile or .javaClasspath. Walkers from the GATK package are now also embedded into the Queue package. Updated AnalyzeCovariates to make it easier to guess the main class, AnalyzeCovariates instead of AnalyzeCovariatesCLP. Removed the GATK jar argument from the example QScripts. Removed one of the most FAQ when getting started with Scala/Queue, the use of Option[_] in QScripts: 1) Fixed mistaken assumption with java enums. In java enums can be null so they don't need nullable wrappers. 2) Added syntactic sugar for Nullable primitives to the QScript trait. Any variable defined as Option[Int] can just be assigned an Int value or None, ex: myFunc.memoryLimit = 3 Removed other unused code. Re-fixed dry run function ordering. Re-ordered the QCommandline companion object so that IntelliJ doesn't complain about missing main methods. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5504 348d0f76-0448-11de-a6fe-93d51630548a
2011-03-24 22:03:51 +08:00
snps.memoryLimit = memoryLimit
snps.jarFile = qscript.gatkJar
snps.reference_sequence = pipeline.getProject.getReferenceFile
snps.intervals = List(pipeline.getProject.getIntervalList)
snps.rodBind :+= new RodBind("dbsnp", pipeline.getProject.getGenotypeDbsnpType, pipeline.getProject.getGenotypeDbsnp)
Walkers can now specify a class extending from Gatherer to merge custom output formats. Add @Gather(MyGatherer.class) to the walker @Output. JavaCommandLineFunctions can now specify the classpath+mainclass as an alternative to specifying a path to an executable jar. JCLF by default pass on the current classpath and only require the mainclass be specified by the developer extending the JCLF, relieving the QScript author from having to explicitly specify the jar. Like the Picard MergeSamFiles, GATK engine by default is now run from the current classpath. The GATK can still be overridden via .jarFile or .javaClasspath. Walkers from the GATK package are now also embedded into the Queue package. Updated AnalyzeCovariates to make it easier to guess the main class, AnalyzeCovariates instead of AnalyzeCovariatesCLP. Removed the GATK jar argument from the example QScripts. Removed one of the most FAQ when getting started with Scala/Queue, the use of Option[_] in QScripts: 1) Fixed mistaken assumption with java enums. In java enums can be null so they don't need nullable wrappers. 2) Added syntactic sugar for Nullable primitives to the QScript trait. Any variable defined as Option[Int] can just be assigned an Int value or None, ex: myFunc.memoryLimit = 3 Removed other unused code. Re-fixed dry run function ordering. Re-ordered the QCommandline companion object so that IntelliJ doesn't complain about missing main methods. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5504 348d0f76-0448-11de-a6fe-93d51630548a
2011-03-24 22:03:51 +08:00
snps.downsample_to_coverage = qscript.downsampling_coverage
snps.annotation ++= List("AlleleBalance")
snps.group :+= "Standard"
add(snps)
}
}
}
}