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

Add a split to unique reports

parent 86572f26
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,21 @@ class CentrifugeKreport(val root: Configurable) extends BiopetCommandLineFunctio
@Input(doc = "Centrifuge index prefix", required = true)
var index: File = config("centrifuge_index", namespace = "centrifuge")
var onlyUnique: Boolean = config ("only_unique", default = false)
var showZeros: Boolean = config ("show_zeros", default = false)
var isCounts: Boolean = config ("is_counts", default = false)
var minScore: Option[Double] = config("min_score")
var minLength: Option[Int] = config("min_length")
executable = config("exe", default = "centrifuge-kreport", freeVar = false)
def cmdLine = executable +
//TODO: Options
conditional(onlyUnique, "--only-unique") +
conditional(showZeros, "--show-zeros") +
conditional(showZeros, "--is-counts") +
optional("--min-score=", minScore, spaceSeparated = false) +
optional("--min-length=", minLength, spaceSeparated = false) +
required("-x", index) +
repeat(centrifugeOutputFiles) +
" > " + required(output)
......
......@@ -18,6 +18,8 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
var outputName: String = _
override def fixedValues = Map("centrifugekreport" -> Map("only_unique" -> false))
def init(): Unit = {
require(fastqR1 != null)
if (outputName == null) outputName = fastqR1.getName
......@@ -34,19 +36,25 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
centrifuge.report = Some(new File(outputDir, s"$outputName.centrifuge.report"))
add(centrifuge)
makeKreport(List(centrifuge.output), "centrifuge", unique = false)
makeKreport(List(centrifuge.output), "centrifuge_unique", unique = true)
addSummaryJobs()
}
protected def makeKreport(inputFiles: List[File], name: String, unique: Boolean): Unit = {
val centrifugeKreport = new CentrifugeKreport(this)
centrifugeKreport.centrifugeOutputFiles :+= centrifuge.output
centrifugeKreport.output = new File(outputDir, s"$outputName.centrifuge.kreport")
centrifugeKreport.centrifugeOutputFiles = inputFiles
centrifugeKreport.output = new File(outputDir, s"$outputName.$name.kreport")
centrifugeKreport.onlyUnique = unique
add(centrifugeKreport)
val krakenReportJSON = new KrakenReportToJson(this)
krakenReportJSON.inputReport = centrifugeKreport.output
krakenReportJSON.output = new File(outputDir, s"$outputName.krkn.json")
krakenReportJSON.output = new File(outputDir, s"$outputName.$name.krkn.json")
krakenReportJSON.skipNames = config("skipNames", default = false)
add(krakenReportJSON)
addSummarizable(krakenReportJSON, "centrifuge_report")
addSummaryJobs()
addSummarizable(krakenReportJSON, s"${name}_report")
}
/** Location of summary file */
......
......@@ -46,8 +46,11 @@ object GearsReport extends MultisampleReportBuilder {
ReportPage(
(if (centrifugeExecuted) List("Centriguge analysis" -> ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map("summaryStatsTag" -> "centrifuge_report", "summaryModuleTag" -> "gearscentrifuge")))
"Unique Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
), "All Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map("summaryModuleTag" -> "gearscentrifuge")))
else Nil) ::: (if (krakenExecuted) List("Kraken analysis" -> ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map()))
......
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