Clever.scala 1.78 KB
Newer Older
Peter van 't Hof's avatar
Peter van 't Hof committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * 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 that are
 * not part of GATK Queue 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
16
17
package nl.lumc.sasc.biopet.pipelines.shiva.svcallers

18
19
import nl.lumc.sasc.biopet.extensions.clever.{CleverCaller, CleverFixVCF}
import nl.lumc.sasc.biopet.extensions.picard.SortVcf
Peter van 't Hof's avatar
Peter van 't Hof committed
20
21
22
23
24
25
26
27
28
29
30
31
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() {
    //TODO: check double directories
    for ((sample, bamFile) <- inputBams) {
      val cleverDir = new File(outputDir, sample)
      val clever = CleverCaller(this, bamFile, cleverDir)
      add(clever)
32

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

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

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