Clever.scala 2.02 KB
Newer Older
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.
 */
16
package nl.lumc.sasc.biopet.extensions.clever
17
18
19

import java.io.File

20
import nl.lumc.sasc.biopet.core.config.Configurable
21
22
import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
import org.broadinstitute.gatk.queue.QScript
23

24
class Clever(val root: Configurable) extends QScript with BiopetQScript {
25
  def this() = this(null)
Peter van 't Hof's avatar
Peter van 't Hof committed
26

27
28
29
30
31
  @Input(doc = "Input file (bam)")
  var input: File = _

  @Input(doc = "Reference")
  var reference: File = _
Peter van 't Hof's avatar
Peter van 't Hof committed
32

33
34
  @Argument(doc = "Work directory")
  var workdir: String = _
Peter van 't Hof's avatar
Peter van 't Hof committed
35

36
37
  @Argument(doc = "Current working directory")
  var cwd: String = _
Peter van 't Hof's avatar
Peter van 't Hof committed
38

39
40
41
42
43
44
  override def init() {
  }

  def biopetScript() {
    // write the pipeline here
    logger.info("Starting Clever Pipeline")
Peter van 't Hof's avatar
Peter van 't Hof committed
45

46
    /// start clever and then copy the vcf into the root directory "<sample>.clever/"
47
    val clever = CleverCaller(this, input, reference, cwd, workdir)
Peter van 't Hof's avatar
Peter van 't Hof committed
48
49
    outputFiles += ("clever_vcf" -> clever.outputvcf)
    add(clever)
50
51
52
  }
}

53
object Clever extends PipelineCommand {
54
  override val pipeline = "/nl/lumc/sasc/biopet/extensions/svcallers/Clever/Clever.class"
Peter van 't Hof's avatar
Peter van 't Hof committed
55

56
57
  def apply(root: Configurable, input: File, runDir: String): Clever = {
    val cleverpipeline = new Clever(root)
58
59
    cleverpipeline.input = input
    cleverpipeline.workdir = runDir
Peter van 't Hof's avatar
Peter van 't Hof committed
60
61
62
    cleverpipeline.init()
    cleverpipeline.biopetScript()
    cleverpipeline
63
  }
Peter van 't Hof's avatar
Peter van 't Hof committed
64

65
}