LinePlot.scala 1.96 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
18
19
package nl.lumc.sasc.biopet.extensions.rscript

import java.io.File

20
import nl.lumc.sasc.biopet.core.extensions.RscriptCommandLineFunction
Peter van 't Hof's avatar
Peter van 't Hof committed
21
import nl.lumc.sasc.biopet.utils.config.Configurable
Peter van 't Hof's avatar
Peter van 't Hof committed
22
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
Peter van 't Hof's avatar
Peter van 't Hof committed
23
24

/**
Peter van 't Hof's avatar
Peter van 't Hof committed
25
26
 * Extension for en general line plot with R
 *
Peter van 't Hof's avatar
Peter van 't Hof committed
27
28
 * Created by pjvan_thof on 4/29/15.
 */
Peter van 't Hof's avatar
Peter van 't Hof committed
29
class LinePlot(val root: Configurable) extends RscriptCommandLineFunction {
Peter van 't Hof's avatar
Peter van 't Hof committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  protected var script: File = config("script", default = "plotXY.R")

  @Input
  var input: File = _

  @Output
  var output: File = _

  var width: Option[Int] = config("width")
  var height: Option[Int] = config("height")
  var xlabel: Option[String] = config("xlabel")
  var ylabel: Option[String] = config("ylabel")
  var llabel: Option[String] = config("llabel")
  var title: Option[String] = config("title")
44
  var removeZero: Boolean = config("removeZero", default = false)
Peter van 't Hof's avatar
Peter van 't Hof committed
45
46
47
48
49
50
51
52
53

  override def cmdLine: String = super.cmdLine +
    required("--input", input) +
    required("--output", output) +
    optional("--width", width) +
    optional("--height", height) +
    optional("--xlabel", xlabel) +
    required("--ylabel", ylabel) +
    optional("--llabel", llabel) +
54
55
    optional("--title", title) +
    optional("--removeZero", removeZero)
Peter van 't Hof's avatar
Peter van 't Hof committed
56
}