HaplotypeCaller.scala 2.44 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
11

import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.variant.GATKVCFIndexType

class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.HaplotypeCaller with GatkGeneral {
Peter van 't Hof's avatar
Peter van 't Hof committed
12
  min_mapping_quality_score = config("minMappingQualityScore", default = 20)
Peter van 't Hof's avatar
Peter van 't Hof committed
13
  scatterCount = config("scattercount", default = 1)
Peter van 't Hof's avatar
Peter van 't Hof committed
14
15
16
  if (config.contains("dbsnp")) this.dbsnp = config("dbsnp")
  this.sample_ploidy = config("ploidy")
  if (config.contains("bamOutput")) bamOutput = config("bamOutput")
Peter van 't Hof's avatar
Peter van 't Hof committed
17
  if (config.contains("allSitePLs")) allSitePLs = config("allSitePLs")
Peter van 't Hof's avatar
Peter van 't Hof committed
18
19
20
21
22
23
24
  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")
25
    }
Peter van 't Hof's avatar
Peter van 't Hof committed
26
  }
27

Peter van 't Hof's avatar
Peter van 't Hof committed
28
29
30
31
32
33
34
35
36
37
  if (config("inputtype", default = "dna").asString == "rna") {
    dontUseSoftClippedBases = config("dontusesoftclippedbases", default = true)
    stand_call_conf = config("stand_call_conf", default = 5)
    stand_emit_conf = config("stand_emit_conf", default = 0)
  } else {
    dontUseSoftClippedBases = config("dontusesoftclippedbases", default = false)
    stand_call_conf = config("stand_call_conf", default = 5)
    stand_emit_conf = config("stand_emit_conf", default = 0)
  }

38
39
  override def beforeGraph {
    super.beforeGraph
40
    if (bamOutput != null && nct.getOrElse(1) > 1) {
Peter van 't Hof's avatar
Peter van 't Hof committed
41
      threads = 1
42
43
      logger.warn("BamOutput is on, nct/threads is forced to set on 1, this option is only for debug")
    }
Peter van 't Hof's avatar
Peter van 't Hof committed
44
    nct = Some(getThreads(1))
Peter van 't Hof's avatar
Peter van 't Hof committed
45
    memoryLimit = Option(memoryLimit.getOrElse(2.0) * nct.getOrElse(1))
46
47
48
49
50
51
52
53
  }

  def useGvcf() {
    emitRefConfidence = org.broadinstitute.gatk.tools.walkers.haplotypecaller.ReferenceConfidenceMode.GVCF
    variant_index_type = GATKVCFIndexType.LINEAR
    variant_index_parameter = config("variant_index_parameter", default = 128000)
  }
}