Commit 6bd92c80 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added base version of centrifuge extension

parent ca6efa52
package nl.lumc.sasc.biopet.extensions.centrifuge
import java.io.File
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
import scala.util.matching.Regex
/**
* Created by pjvanthof on 19/09/16.
*/
class Centrifuge(val root: Configurable) extends BiopetCommandLineFunction with Version {
@Input(doc = "Input: FastQ or FastA", required = true)
var inputR1: File = _
@Input(doc = "Input: FastQ or FastA", required = false)
var inputR2: Option[File] = None
@Input(doc = "Centrifuge index prefix", required = true)
var index: File = _
@Output(doc = "Output with hits per sequence")
var output: File = _
@Output(doc = "Output with hits per sequence")
var report: Option[File] = None
override def defaultThreads = 8
executable = config("exe", default = "centrifuge", freeVar = false)
/** Command to get version of executable */
def versionCommand: String = s"$executable --version"
/** Regex to get version from version command output */
def versionRegex: Regex = ".* version (.*)".r
/**
* This function needs to be implemented to define the command that is executed
*
* @return Command to run
*/
protected[core] def cmdLine: String = executable +
//TODO: Options
optional("--threads", threads)
required("-x", index) +
(inputR2 match {
case Some(r2) => required("-1", inputR1) + required("-2", r2)
case _ => required("-U", inputR1)
}) +
(if (outputAsStsout) "" else required("-S", output)) +
optional("--report-file", report)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment