Commit 94ec5b1a authored by Peter van 't Hof's avatar Peter van 't Hof

Fixed output of centrifuge

parent 83e1c12f
......@@ -3,7 +3,7 @@ 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.Gzip
import nl.lumc.sasc.biopet.extensions.centrifuge.{Centrifuge, CentrifugeKreport}
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
......@@ -27,18 +27,21 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
require(outputName != null)
}
def centrifugeOutput = new File(outputDir, s"$outputName.centrifuge.gz")
def biopetScript(): Unit = {
val centrifugeOutput = new File(outputDir, s"$outputName.centrifuge.gz")
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"))
val cmd = centrifuge | new Gzip(this) > centrifugeOutput
cmd.threadsCorrection = -1
add(cmd)
centrifuge.isIntermediate = true
add(centrifuge)
add(centrifuge.output :<: new Gzip(this) > centrifugeOutput)
makeKreport(List(centrifugeOutput), "centrifuge", unique = false)
makeKreport(List(centrifugeOutput), "centrifuge_unique", unique = true)
makeKreport(List(centrifuge.output), "centrifuge", unique = false)
makeKreport(List(centrifuge.output), "centrifuge_unique", unique = true)
addSummaryJobs()
}
......@@ -65,9 +68,10 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
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()
})
def summaryFiles: Map[String, File] = outputFiles + ("input_R1" -> fastqR1, "centrifuge_output" -> centrifugeOutput) ++
(fastqR2 match {
case Some(file) => Map("input_R2" -> file)
case _ => Map()
})
}
......@@ -18,12 +18,12 @@ import java.io.File
import com.google.common.io.Files
import nl.lumc.sasc.biopet.core.BiopetPipe
import nl.lumc.sasc.biopet.extensions.centrifuge.{Centrifuge, CentrifugeKreport}
import nl.lumc.sasc.biopet.extensions.kraken.{Kraken, KrakenReport}
import nl.lumc.sasc.biopet.extensions.centrifuge.{ Centrifuge, CentrifugeKreport }
import nl.lumc.sasc.biopet.extensions.kraken.{ Kraken, KrakenReport }
import nl.lumc.sasc.biopet.extensions.picard.SamToFastq
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsView
import nl.lumc.sasc.biopet.extensions.tools.KrakenReportToJson
import nl.lumc.sasc.biopet.utils.{ConfigUtils, Logging}
import nl.lumc.sasc.biopet.utils.{ ConfigUtils, Logging }
import nl.lumc.sasc.biopet.utils.config.Config
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
......
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