Commit 4c405315 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Refactor the report generation a bit. Move pipeline specific report components...

Refactor the report generation a bit. Move pipeline specific report components into the pipeline itself (not hosted in core anymore)
parent 1b673dfa
......@@ -16,11 +16,13 @@
import nl.lumc.sasc.biopet.core.ToolCommandFunction
import nl.lumc.sasc.biopet.utils.summary.Summary
import nl.lumc.sasc.biopet.utils.{ ToolCommand, Logging, IoUtils }
import nl.lumc.sasc.biopet.utils.{IoUtils, Logging, ToolCommand}
import org.broadinstitute.gatk.utils.commandline.Input
import org.fusesource.scalate.{ TemplateEngine, TemplateSource }
import org.fusesource.scalate.{TemplateEngine, TemplateSource}
import scala.collection.mutable
......@@ -95,6 +97,19 @@ trait ReportBuilder extends ToolCommand {
private var _libId: Option[String] = None
protected def libId = _libId
def extFiles = List(
).map("/nl/lumc/sasc/biopet/core/report/ext/" + _)
/** Main function to for building the report */
def main(args: Array[String]): Unit = {"Start")
......@@ -123,23 +138,9 @@ trait ReportBuilder extends ToolCommand {
// Static files that will be copied to the output folder, then file is added to [resourceDir] it's need to be added here also
val extOutputDir: File = new File(cmdArgs.outputDir, "ext")
val resourceDir: String = "/nl/lumc/sasc/biopet/core/report/ext/"
val extFiles = List(
for (resource <- extFiles.par) {
IoUtils.copyStreamToFile(getClass.getResourceAsStream(resourceDir + resource), new File(extOutputDir, resource), createDirs = true)
IoUtils.copyStreamToFile(getClass.getResourceAsStream(resource), new File(extOutputDir, resource), createDirs = true)
}"Parsing summary")
......@@ -9,7 +9,6 @@
<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>
<tr><th>Number of samples</th><td>${summary.samples.size}</td></tr>
......@@ -14,6 +14,10 @@ object GearsReport extends ReportBuilder {
// TODO: Add dustbin analysis (aggregated)
// TODO: Add alignment stats per sample for the dustbin analysis
override def extFiles = super.extFiles ++ List(
).map("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + _)
def indexPage = {
List() ++
Supports Markdown
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