Skip to content
Snippets Groups Projects
Commit deced04c authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added centrifuge to Gears

parent 901b11d9
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ 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 org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.util.matching.Regex
......
......@@ -4,7 +4,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Created by pjvanthof on 19/09/16.
......
package nl.lumc.sasc.biopet.pipelines.gears
import nl.lumc.sasc.biopet.core.SampleLibraryTag
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.centrifuge.{ Centrifuge, CentrifugeKreport }
import nl.lumc.sasc.biopet.extensions.tools.KrakenReportToJson
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
/**
* Created by pjvanthof on 19/09/16.
*/
class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag {
var fastqR1: File = _
var fastqR2: Option[File] = None
var outputName: String = _
def init(): Unit = {
require(fastqR1 != null)
if (outputName == null) outputName = fastqR1.getName
.stripSuffix(".gz")
.stripSuffix(".fq")
.stripSuffix(".fastq")
}
def biopetScript(): Unit = {
val centrifuge = new Centrifuge(this)
centrifuge.inputR1 = fastqR1
centrifuge.inputR2 = fastqR2
centrifuge.output = new File(outputDir, s"$outputName.centrifuge")
centrifuge.report = Some(new File(outputDir, s"$outputName.centrifuge.report"))
add(centrifuge)
val centrifugeKreport = new CentrifugeKreport(this)
centrifugeKreport.centrifugeOutputFiles += centrifuge.output
centrifugeKreport.output = new File(outputDir, s"$outputName.centrifuge.kreport")
add(centrifugeKreport)
val krakenReportJSON = new KrakenReportToJson(this)
krakenReportJSON.inputReport = centrifugeKreport.output
krakenReportJSON.output = new File(outputDir, s"$outputName.krkn.json")
krakenReportJSON.skipNames = config("skipNames", default = false)
add(krakenReportJSON)
addSummarizable(krakenReportJSON, "centrifugereport")
}
/** Location of summary file */
def summaryFile = new File(outputDir, sampleId.getOrElse("sampleName_unknown") + ".kraken.summary.json")
/** Pipeline settings shown in the summary file */
def summarySettings: Map[String, Any] = Map()
/** Statistics shown in the summary file */
def summaryFiles: Map[String, File] = outputFiles + ("input_R1" -> fastqR1) ++ (fastqR2 match {
case Some(file) => Map("input_R2" -> file)
case _ => Map()
})
}
......@@ -107,7 +107,7 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
def summaryFile = new File(outputDir, sampleId.getOrElse("sampleName_unknown") + ".kraken.summary.json")
/** Pipeline settings shown in the summary file */
def summarySettings: Map[String, Any] = Map.empty
def summarySettings: Map[String, Any] = Map()
/** Statistics shown in the summary file */
def summaryFiles: Map[String, File] = outputFiles + ("input_R1" -> fastqR1) ++ (fastqR2 match {
......
......@@ -41,6 +41,7 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
var outputName: String = _
lazy val krakenScript = if (config("gears_use_kraken", default = true)) Some(new GearsKraken(this)) else None
lazy val centrifugeScript = if (config("gears_use_centrifuge", default = false)) Some(new GearsCentrifuge(this)) else None
lazy val qiimeRatx = if (config("gears_use_qiime_rtax", default = false)) Some(new GearsQiimeRtax(this)) else None
lazy val qiimeClosed = if (config("gears_use_qiime_closed", default = false)) Some(new GearsQiimeClosed(this)) else None
lazy val qiimeOpen = if (config("gears_use_qiime_open", default = false)) Some(new GearsQiimeOpen(this)) else None
......@@ -126,6 +127,14 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
add(kraken)
}
centrifugeScript foreach { centrifuge =>
centrifuge.outputDir = new File(outputDir, "centrifuge")
centrifuge.fastqR1 = r1
centrifuge.fastqR2 = r2
centrifuge.outputName = outputName
add(centrifuge)
}
qiimeRatx foreach { qiimeRatx =>
qiimeRatx.outputDir = new File(outputDir, "qiime_rtax")
qiimeRatx.fastqR1 = r1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment