From 9ac622a99781914031e5f968b26a57168647d12c Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 31 Oct 2015 10:14:14 +0100
Subject: [PATCH] Added sample / lib to report

---
 .../nl/lumc/sasc/biopet/pipelines/gears/gearsFront.ssp       | 4 ++++
 .../nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp    | 5 +----
 .../scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala    | 2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsFront.ssp b/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsFront.ssp
index 67d011009..20ca43285 100644
--- a/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsFront.ssp
+++ b/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsFront.ssp
@@ -2,6 +2,8 @@
 #import(nl.lumc.sasc.biopet.core.report.ReportPage)
 <%@ var summary: Summary %>
 <%@ var rootPath: String %>
+<%@ var sampleId: Option[String] = None %>
+<%@ var libId: Option[String] = None %>
 
 <table class="table">
 <tbody>
@@ -9,6 +11,8 @@
     <tr><th>Version</th><td>${summary.getValue("meta", "pipeline_version")}</td></tr>
     <tr><th>Last commit hash</th><td>${summary.getValue("meta", "last_commit_hash")}</td></tr>
     <tr><th>Output directory</th><td>${summary.getValue("meta", "output_dir")}</td></tr>
+    #if(sampleId.isDefined) <tr><th>Sample</th><td>${sampleId}</td></tr> #end
+    #if(libId.isDefined) <tr><th>Library</th><td>${libId}</td></tr> #end
 </tbody>
 </table>
 <br/>
diff --git a/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp b/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp
index 6d10089e3..0915decbe 100644
--- a/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp
+++ b/public/gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp
@@ -5,11 +5,8 @@
 <%@ var sampleId: Option[String] = None %>
 <%@ var libId: Option[String] = None %>
 <%@ var rootPath: String %>
-<%@ var outputDir: File %>
 <%@ var showPlot: Boolean = true %>
-<%@ var showTable: Boolean = true %>
 <%@ var showIntro: Boolean = true %>
-<%@ var multisample: Boolean = false %>
 #{
     val samples = sampleId match {
         case Some(sample) => List(sample.toString)
@@ -59,7 +56,7 @@
     <script type="application/ecmascript">
 
     #{
-        val rawreport = Map("kraken" -> summary.getValue("gears", "stats", "krakenreport"))
+        val rawreport = Map("kraken" -> summary.getValue(sampleId, libId, "gears", "stats", "krakenreport"))
         val bla = ConfigUtils.mapToJson(rawreport)
     }#
 
diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
index b2af00dd2..780f983d5 100644
--- a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
@@ -69,6 +69,8 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript with Sam
     val gears = new GearsReport(this)
     gears.outputDir = new File(outputDir, "report")
     gears.summaryFile = summaryFile
+    sampleId.foreach(gears.args += "sampleId" -> _)
+    libId.foreach(gears.args += "libId" -> _)
     Some(gears)
   }
 
-- 
GitLab