HaplotypeCallerGvcf.scala 1.87 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
23
import nl.lumc.sasc.biopet.utils.config.Configurable
24 25

/** Gvcf mode for haplotypecaller */
Peter van 't Hof's avatar
Peter van 't Hof committed
26
class HaplotypeCallerGvcf(val parent: Configurable) extends Variantcaller {
27 28 29
  val name = "haplotypecaller_gvcf"
  protected def defaultPrio = 5

Sander Bollen's avatar
Sander Bollen committed
30
  /**
Sander Bollen's avatar
Sander Bollen committed
31 32
   * Map of sample name -> gvcf. May be empty.
   */
Sander Bollen's avatar
Sander Bollen committed
33 34 35 36
  protected var gVcfFiles: Map[String, File] = Map()

  def getGvcfs = gVcfFiles

Peter van 't Hof's avatar
Peter van 't Hof committed
37 38
  override def fixedValues = Map("haplotypecaller" -> Map("emitRefConfidence" -> "GVCF"))

39
  def biopetScript() {
Sander Bollen's avatar
Sander Bollen committed
40
    gVcfFiles = for ((sample, inputBam) <- inputBams) yield {
Peter van 't Hof's avatar
Peter van 't Hof committed
41
      val hc = gatk.HaplotypeCaller(this, List(inputBam), new File(outputDir, sample + ".gvcf.vcf.gz"))
42
      hc.BQSR = inputBqsrFiles.get(sample)
43
      add(hc)
Sander Bollen's avatar
Sander Bollen committed
44
      sample -> hc.out
45 46
    }

Sander Bollen's avatar
Sander Bollen committed
47
    val genotypeGVCFs = gatk.GenotypeGVCFs(this, gVcfFiles.values.toList, outputFile)
48 49 50
    add(genotypeGVCFs)
  }
}