Commit 5a27f767 authored by Peter van 't Hof's avatar Peter van 't Hof

Added report to bammetrics

parent c150b417
#{ //TODO: Need content }#
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var rootPath: String %>
<%@ var sampleId: Option[String] %>
<%@ var libId: Option[String] = None %>
Todo
\ No newline at end of file
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>BamMetrics</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>Output directory</th><td>${summary.getValue("meta", "output_dir")}</td></tr>
<tr><th>Sample ID</th><td>${sampleId}</td></tr>
#if (libId.isDefined) <tr><th>Library ID</th><td>${libId}</td></tr> #end
</tbody>
</table>
<br/>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-6">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc risus est, volutpat quis enim sit amet, lacinia posuere ante. Mauris eget massa efficitur, luctus nisl ut, placerat nibh. Pellentesque id nulla maximus, rutrum dui nec, lobortis odio. Fusce eu enim ac sem auctor congue. Ut ac ullamcorper quam, eget sollicitudin felis. Maecenas posuere sagittis blandit. Proin mollis magna lectus, id gravida est consectetur vitae. Nulla id risus at tellus laoreet finibus in id lacus. Duis lobortis commodo nisl viverra tempor. Curabitur sit amet pretium dui, sit amet tincidunt mauris. Duis volutpat eu purus ut molestie.
</p>
</div>
</div>
\ No newline at end of file
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] %>
<%@ var libId: Option[String] = None %>
<%@ var metricsTag: String = "bammetrics" %>
<table class="table sortable-theme-bootstrap">
<thead><tr>
<th>Path</th>
<th>MD5</th>
</tr></thead>
<tbody>
<tr>
<td>${summary.getLibraryValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "path")}</td>
<td>${summary.getLibraryValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "md5")}</td>
</tr>
</tbody>
</table>
\ No newline at end of file
......@@ -17,7 +17,21 @@ object BammetricsReport extends ReportBuilder {
val reportName = "Bam Metrics"
/** Root page for single BamMetrcis report */
def indexPage = ReportPage(List(), List(), Map())
def indexPage = {
val bamMetricsPage = this.bamMetricsPage(summary, sampleId, libId)
ReportPage(bamMetricsPage.subPages ::: List(
"Versions" -> ReportPage(List(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
))), Map()),
"Files" -> ReportPage(List(), List(
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bammetricsInputFile.ssp")
), Map())
), List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bamMetricsFront.ssp")
) ::: bamMetricsPage.sections,
Map()
)
}
/** Generates a page with alignment stats */
def bamMetricsPage(summary: Summary,
......
......@@ -71,6 +71,11 @@ trait ReportBuilder extends ToolCommand {
private var done = 0
private var total = 0
private var _sampleId: Option[String] = None
protected def sampleId = _sampleId
private var _libId: Option[String] = None
protected def libId = _libId
/** Main function to for building the report */
def main(args: Array[String]): Unit = {
logger.info("Start")
......@@ -82,12 +87,18 @@ trait ReportBuilder extends ToolCommand {
require(cmdArgs.outputDir.isDirectory, "Output dir is not a directory")
cmdArgs.pageArgs.get("sampleId") match {
case Some(s: String) => cmdArgs.pageArgs += "sampleId" -> Some(s)
case Some(s: String) => {
cmdArgs.pageArgs += "sampleId" -> Some(s)
_sampleId = Some(s)
}
case _ =>
}
cmdArgs.pageArgs.get("libId") match {
case Some(s: String) => cmdArgs.pageArgs += "libId" -> Some(s)
case Some(l: String) => {
cmdArgs.pageArgs += "libId" -> Some(l)
_libId = Some(l)
}
case _ =>
}
......
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