Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -16,11 +16,13 @@ ...@@ -16,11 +16,13 @@
package nl.lumc.sasc.biopet.core.report 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.Summary 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.broadinstitute.gatk.utils.commandline.Input
import org.fusesource.scalate.{ TemplateEngine, TemplateSource } import org.fusesource.scalate.{TemplateEngine, TemplateSource}
import scala.collection.mutable import scala.collection.mutable
/** /**
...@@ -95,6 +97,19 @@ trait ReportBuilder extends ToolCommand { ...@@ -95,6 +97,19 @@ trait ReportBuilder extends ToolCommand {
private var _libId: Option[String] = None private var _libId: Option[String] = None
protected def libId = _libId protected def libId = _libId
def extFiles = List(
"css/bootstrap_dashboard.css",
"css/bootstrap.min.css",
"css/bootstrap-theme.min.css",
"css/sortable-theme-bootstrap.css",
"js/jquery.min.js",
"js/sortable.min.js",
"js/bootstrap.min.js",
"fonts/glyphicons-halflings-regular.woff",
"fonts/glyphicons-halflings-regular.ttf",
"fonts/glyphicons-halflings-regular.woff2"
).map("/nl/lumc/sasc/biopet/core/report/ext/" + _)
/** Main function to for building the report */ /** Main function to for building the report */
def main(args: Array[String]): Unit = { def main(args: Array[String]): Unit = {
logger.info("Start") logger.info("Start")
...@@ -123,23 +138,9 @@ trait ReportBuilder extends ToolCommand { ...@@ -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 // 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 extOutputDir: File = new File(cmdArgs.outputDir, "ext")
val resourceDir: String = "/nl/lumc/sasc/biopet/core/report/ext/"
val extFiles = List(
"css/bootstrap_dashboard.css",
"css/bootstrap.min.css",
"css/bootstrap-theme.min.css",
"css/sortable-theme-bootstrap.css",
"js/jquery.min.js",
"js/sortable.min.js",
"js/bootstrap.min.js",
"js/gears.js",
"fonts/glyphicons-halflings-regular.woff",
"fonts/glyphicons-halflings-regular.ttf",
"fonts/glyphicons-halflings-regular.woff2"
)
for (resource <- extFiles.par) { 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)
} }
logger.info("Parsing summary") logger.info("Parsing summary")
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<tr><th>Version</th><td>${summary.getValue("meta", "pipeline_version")}</td></tr> <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>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>Output directory</th><td>${summary.getValue("meta", "output_dir")}</td></tr>
<tr><th>Number of samples</th><td>${summary.samples.size}</td></tr>
</tbody> </tbody>
</table> </table>
<br/> <br/>
......
...@@ -14,6 +14,10 @@ object GearsReport extends ReportBuilder { ...@@ -14,6 +14,10 @@ object GearsReport extends ReportBuilder {
// TODO: Add dustbin analysis (aggregated) // TODO: Add dustbin analysis (aggregated)
// TODO: Add alignment stats per sample for the dustbin analysis // TODO: Add alignment stats per sample for the dustbin analysis
override def extFiles = super.extFiles ++ List(
"js/gears.js"
).map("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + _)
def indexPage = { def indexPage = {
ReportPage( ReportPage(
List() ++ List() ++
......
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