CentrifugeKreport.scala 1.45 KB
Newer Older
1
2
3
4
5
6
package nl.lumc.sasc.biopet.extensions.centrifuge

import java.io.File

import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.utils.config.Configurable
Peter van 't Hof's avatar
Peter van 't Hof committed
7
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
8
9

/**
10
11
 * Created by pjvanthof on 19/09/16.
 */
12
13
14
15
16
17
18
19
class CentrifugeKreport(val root: Configurable) extends BiopetCommandLineFunction {
  @Input(doc = "Output files centrifuge", required = true)
  var centrifugeOutputFiles: List[File] = Nil

  @Output(doc = "Output report")
  var output: File = _

  @Input(doc = "Centrifuge index prefix", required = true)
20
  var index: File = config("centrifuge_index", namespace = "centrifuge")
21

Peter van 't Hof's avatar
Peter van 't Hof committed
22
23
24
  var onlyUnique: Boolean = config("only_unique", default = false)
  var showZeros: Boolean = config("show_zeros", default = false)
  var isCounts: Boolean = config("is_counts", default = false)
25
26
27
28

  var minScore: Option[Double] = config("min_score")
  var minLength: Option[Int] = config("min_length")

Peter van 't Hof's avatar
Peter van 't Hof committed
29
30
  override def defaultCoreMemory = 4.0

31
32
33
  executable = config("exe", default = "centrifuge-kreport", freeVar = false)

  def cmdLine = executable +
34
35
    conditional(onlyUnique, "--only-unique") +
    conditional(showZeros, "--show-zeros") +
Peter van 't Hof's avatar
Peter van 't Hof committed
36
    conditional(isCounts, "--is-counts") +
37
38
    optional("--min-score=", minScore, spaceSeparated = false) +
    optional("--min-length=", minLength, spaceSeparated = false) +
39
    required("-x", index) +
Peter van 't Hof's avatar
Peter van 't Hof committed
40
41
    repeat(centrifugeOutputFiles) +
    " > " + required(output)
42
}