HaplotypeCallerAllele.scala 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/**
 * Biopet is built on top of GATK Queue for building bioinformatic
 * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
 * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
 * should also be able to execute Biopet tools and pipelines.
 *
 * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
 *
 * Contact us at: sasc@lumc.nl
 *
 * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
 * license; For commercial users or users who do not want to follow the AGPL
 * license, please contact us to obtain a separate license.
 */
Peter van 't Hof's avatar
Peter van 't Hof committed
15 16 17 18 19
/**
 * 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
 */
20
package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers
21

Peter van 't Hof's avatar
Peter van 't Hof committed
22
import nl.lumc.sasc.biopet.extensions.gatk
Peter van 't Hof's avatar
Peter van 't Hof committed
23
import nl.lumc.sasc.biopet.extensions.gatk.BqsrGather
24
import nl.lumc.sasc.biopet.utils.config.Configurable
25 26

/** Allele mode for Haplotypecaller */
Peter van 't Hof's avatar
Peter van 't Hof committed
27
class HaplotypeCallerAllele(val parent: Configurable) extends Variantcaller {
28 29 30
  val name = "haplotypecaller_allele"
  protected def defaultPrio = 5

Peter van 't Hof's avatar
Peter van 't Hof committed
31
  lazy val alleles: File = config("input_alleles")
32

33
  def biopetScript() {
Peter van 't Hof's avatar
Peter van 't Hof committed
34
    val hc = gatk.HaplotypeCaller(this, inputBams.values.toList, outputFile)
35
    hc.alleles = Some(alleles)
Peter van 't Hof's avatar
Peter van 't Hof committed
36 37 38 39 40 41 42
    hc.BQSR = if (inputBqsrFiles.isEmpty) None else {
      val gather = new BqsrGather
      gather.inputBqsrFiles = inputBqsrFiles.values.toList
      gather.outputBqsrFile = new File(outputDir, "bqsr.merge")
      add(gather)
      Some(gather.outputBqsrFile)
    }
Peter van 't Hof's avatar
Peter van 't Hof committed
43
    hc.genotyping_mode = Some("GENOTYPE_GIVEN_ALLELES")
44 45 46
    add(hc)
  }
}