Commit 91b0b5f5 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge pull request #62 from biopet/fix-BIOPET-639

Fixing fastqc plots
parents 19f463b7 9fd0a2f5
...@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.core.report ...@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.core.report
import java.io._ import java.io._
import nl.lumc.sasc.biopet.core.ToolCommandFunction import nl.lumc.sasc.biopet.core.ToolCommandFunction
import nl.lumc.sasc.biopet.utils.summary.db.Schema.{ Library, Module, Pipeline, Sample } import nl.lumc.sasc.biopet.utils.summary.db.Schema.{ Library, Module, Pipeline, Sample, Run }
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.{ LibraryId, SampleId } import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.{ LibraryId, SampleId }
import nl.lumc.sasc.biopet.utils.{ IoUtils, Logging, ToolCommand } import nl.lumc.sasc.biopet.utils.{ IoUtils, Logging, ToolCommand }
...@@ -40,7 +40,7 @@ trait ReportBuilderExtension extends ToolCommandFunction { ...@@ -40,7 +40,7 @@ trait ReportBuilderExtension extends ToolCommandFunction {
/** Report builder object */ /** Report builder object */
def builder: ReportBuilder def builder: ReportBuilder
def toolObject = builder def toolObject: ReportBuilder = builder
@Input(required = true) @Input(required = true)
var summaryDbFile: File = _ var summaryDbFile: File = _
...@@ -114,20 +114,24 @@ trait ReportBuilder extends ToolCommand { ...@@ -114,20 +114,24 @@ trait ReportBuilder extends ToolCommand {
private var setSummary: SummaryDb = _ private var setSummary: SummaryDb = _
/** Retrival of summary, read only */ /** Retrival of summary, read only */
final def summary = setSummary final def summary: SummaryDb = setSummary
private var setRunId: Int = 0 private var setRunId: Int = 0
final def runId = setRunId final def runId: Int = setRunId
private var _setRun: Run = _
final def run: Run = _setRun
private var _setPipelines = Seq[Pipeline]() private var _setPipelines = Seq[Pipeline]()
final def pipelines = _setPipelines final def pipelines: Seq[Pipeline] = _setPipelines
private var _setModules = Seq[Module]() private var _setModules = Seq[Module]()
final def modules = _setModules final def modules: Seq[Module] = _setModules
private var _setSamples = Seq[Sample]() private var _setSamples = Seq[Sample]()
final def samples = _setSamples final def samples: Seq[Sample] = _setSamples
private var _setLibraries = Seq[Library]() private var _setLibraries = Seq[Library]()
final def libraries = _setLibraries final def libraries: Seq[Library] = _setLibraries
/** default args that are passed to all page withing the report */ /** default args that are passed to all page withing the report */
def pageArgs: Map[String, Any] = Map() def pageArgs: Map[String, Any] = Map()
...@@ -136,13 +140,13 @@ trait ReportBuilder extends ToolCommand { ...@@ -136,13 +140,13 @@ trait ReportBuilder extends ToolCommand {
private var total = 0 private var total = 0
private var _sampleId: Option[Int] = None private var _sampleId: Option[Int] = None
protected[report] def sampleId = _sampleId protected[report] def sampleId: Option[Int] = _sampleId
private var _libId: Option[Int] = None private var _libId: Option[Int] = None
protected[report] def libId = _libId protected[report] def libId: Option[Int] = _libId
case class ExtFile(resourcePath: String, targetPath: String) case class ExtFile(resourcePath: String, targetPath: String)
def extFiles = List( def extFiles: List[ExtFile] = List(
"css/bootstrap_dashboard.css", "css/bootstrap_dashboard.css",
"css/bootstrap.min.css", "css/bootstrap.min.css",
"css/bootstrap-theme.min.css", "css/bootstrap-theme.min.css",
...@@ -183,6 +187,7 @@ trait ReportBuilder extends ToolCommand { ...@@ -183,6 +187,7 @@ trait ReportBuilder extends ToolCommand {
case _ => case _ =>
} }
_setRun = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
_setPipelines = Await.result(summary.getPipelines(runId = Some(runId)), Duration.Inf) _setPipelines = Await.result(summary.getPipelines(runId = Some(runId)), Duration.Inf)
_setModules = Await.result(summary.getModules(runId = Some(runId)), Duration.Inf) _setModules = Await.result(summary.getModules(runId = Some(runId)), Duration.Inf)
_setSamples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf) _setSamples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf)
...@@ -264,6 +269,7 @@ trait ReportBuilder extends ToolCommand { ...@@ -264,6 +269,7 @@ trait ReportBuilder extends ToolCommand {
val rootPath = "./" + Array.fill(path.size)("../").mkString val rootPath = "./" + Array.fill(path.size)("../").mkString
args ++ page.args ++ args ++ page.args ++
Map("page" -> page, Map("page" -> page,
"run" -> run,
"path" -> path, "path" -> path,
"outputDir" -> pageOutputDir, "outputDir" -> pageOutputDir,
"rootPath" -> rootPath, "rootPath" -> rootPath,
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
...@@ -10,6 +11,7 @@ ...@@ -10,6 +11,7 @@
#import(nl.lumc.sasc.biopet.core.report.ReportBuilder.ec) #import(nl.lumc.sasc.biopet.core.report.ReportBuilder.ec)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var run: Run %>
<%@ var sampleId: Option[Int] %> <%@ var sampleId: Option[Int] %>
<%@ var libId: Option[Int] %> <%@ var libId: Option[Int] %>
<%@ var plot: String %> <%@ var plot: String %>
......
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