Clever.scala 1.81 KB
Newer Older
Peter van 't Hof's avatar
Peter van 't Hof committed
1 2 3 4 5 6 7 8 9 10
/**
 * 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
 *
11
 * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
Peter van 't Hof's avatar
Peter van 't Hof committed
12 13 14
 * 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
package nl.lumc.sasc.biopet.pipelines.shiva.svcallers

Wai Yi Leung's avatar
Style  
Wai Yi Leung committed
17
import nl.lumc.sasc.biopet.extensions.clever.{ CleverCaller, CleverFixVCF }
18
import nl.lumc.sasc.biopet.extensions.picard.SortVcf
Peter van 't Hof's avatar
Peter van 't Hof committed
19 20 21 22 23 24 25 26 27
import nl.lumc.sasc.biopet.utils.config.Configurable

/** Script for sv caler Clever */
class Clever(val root: Configurable) extends SvCaller {
  def name = "clever"

  def biopetScript() {
    for ((sample, bamFile) <- inputBams) {
      val cleverDir = new File(outputDir, sample)
28 29
      val clever = CleverCaller(this, bamFile, new File(cleverDir, "clever_output"))
      clever.jobOutputFile = new File(cleverDir, ".CleverCaller.out")
Peter van 't Hof's avatar
Peter van 't Hof committed
30
      add(clever)
31

32 33
      val cleverVCF = new CleverFixVCF(this)
      cleverVCF.input = clever.outputvcf
34
      cleverVCF.output = new File(cleverDir, s".${sample}.clever.vcf")
35
      cleverVCF.sampleName = sample + sampleNameSuffix
36
      cleverVCF.isIntermediate = true
37 38
      add(cleverVCF)

Wai Yi Leung's avatar
Wai Yi Leung committed
39 40 41 42
      val compressedVCF = new SortVcf(this)
      compressedVCF.input = cleverVCF.output
      compressedVCF.output = new File(cleverDir, s"${sample}.clever.vcf.gz")
      add(compressedVCF)
43

Wai Yi Leung's avatar
Wai Yi Leung committed
44
      addVCF(sample, compressedVCF.output)
Peter van 't Hof's avatar
Peter van 't Hof committed
45 46 47
    }
  }
}