UnifiedGenotyper.scala 1.64 KB
Newer Older
1 2 3 4 5
/**
 * Due to the license issue with GATK, this part of Biopet can only be used inside the
 * LUMC. Please refer to https://git.lumc.nl/biopet/biopet/wikis/home for instructions
 * on how to use this protected part of biopet or contact us at sasc@lumc.nl
 */
Peter van 't Hof's avatar
Peter van 't Hof committed
6
package nl.lumc.sasc.biopet.extensions.gatk.broad
7 8 9 10

import nl.lumc.sasc.biopet.core.config.Configurable

class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.UnifiedGenotyper with GatkGeneral {
Peter van 't Hof's avatar
Peter van 't Hof committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  if (config.contains("scattercount")) scatterCount = config("scattercount")
  if (config.contains("dbsnp")) this.dbsnp = config("dbsnp")
  sample_ploidy = config("ploidy")
  if (config.contains("allSitePLs")) this.allSitePLs = config("allSitePLs")

  stand_call_conf = config("stand_call_conf", default = 5)
  stand_emit_conf = config("stand_emit_conf", default = 0)

  if (config.contains("output_mode")) {
    import org.broadinstitute.gatk.tools.walkers.genotyper.OutputMode._
    config("output_mode").asString match {
      case "EMIT_ALL_CONFIDENT_SITES" => output_mode = EMIT_ALL_CONFIDENT_SITES
      case "EMIT_ALL_SITES"           => output_mode = EMIT_ALL_SITES
      case "EMIT_VARIANTS_ONLY"       => output_mode = EMIT_VARIANTS_ONLY
      case e                          => logger.warn("output mode '" + e + "' does not exist")
    }
  }

Peter van 't Hof's avatar
Peter van 't Hof committed
29 30
  override val defaultThreads = 1

Peter van 't Hof's avatar
Peter van 't Hof committed
31 32
  override def beforeGraph() {
    super.beforeGraph()
33 34

    genotype_likelihoods_model = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.BOTH
Peter van 't Hof's avatar
Peter van 't Hof committed
35
    nct = Some(getThreads)
Peter van 't Hof's avatar
Peter van 't Hof committed
36
    memoryLimit = Option(nct.getOrElse(1) * memoryLimit.getOrElse(2.0))
37 38
  }
}