ApplyRecalibration.scala 1.67 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 java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable

class ApplyRecalibration(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.ApplyRecalibration with GatkGeneral {
12
13
  scatterCount = config("scattercount", default = 0)

14
15
  override def beforeGraph {
    super.beforeGraph
16
17
18

    nt = Option(getThreads(3))
    memoryLimit = Option(nt.getOrElse(1) * 2)
19
20
21
22

    import org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode
    if (mode == Mode.INDEL) ts_filter_level = config("ts_filter_level", default = 99.0)
    else if (mode == Mode.SNP) ts_filter_level = config("ts_filter_level", default = 99.5)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    ts_filter_level = config("ts_filter_level")
  }
}

object ApplyRecalibration {
  def apply(root: Configurable, input: File, output: File, recal_file: File, tranches_file: File, indel: Boolean = false): ApplyRecalibration = {
    val ar = if (indel) new ApplyRecalibration(root) {
      mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL
    }
    else new ApplyRecalibration(root) {
      mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.SNP
    }
    ar.input :+= input
    ar.recal_file = recal_file
    ar.tranches_file = tranches_file
    ar.out = output
    return ar
  }
}