Commit 776769bf authored by Peter van 't Hof's avatar Peter van 't Hof

Extended flexiprep summaries

parent a8ebd299
......@@ -92,6 +92,7 @@ footer {
table, td, th {
border: 1px solid green;
border-collapse: collapse;
padding: 2px;
}
th {
background-color: green;
......
......@@ -39,7 +39,7 @@
</head>
<body>
<header><h1>${reportName}</h1></header>
<!-- <header><h1>${reportName}</h1></header> -->
<nav id="menu">
<ul>
#for (t <- 0 to path.size)
......
......@@ -12,12 +12,10 @@
<table>
<thead><tr>
<th>Sample</th>
<th>Library</th>
<th>Read</th>
<th>Reads before QC</th>
<th>Bases before QC</th>
<th>Reads after QC</th>
<th>Bases after QC</th>
<th colspan="2">Library</th>
<th>Before QC</th>
<th colspan="2">Discarded</th>
<th>After QC</th>
</tr></thead>
<tbody>
#for (sample <- samples.toList.sorted)
......@@ -37,19 +35,19 @@
#if (libs.head != libId) <tr> #end
#{ val paired = summary.getLibraryValue(sample, libId, "flexiprep", "settings", "paired").getOrElse(false) }#
<td #if (paired == true) rowspan="2" #end>${libId}</td>
<td>R1</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R1", "reads", "num_total")} </td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R1", "bases", "num_total")}
</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R1_after", "reads", "num_total")}</td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R1_after", "bases", "num_total")}</td>
#if (paired == true)
</tr><tr>
<td>R2</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R2", "reads", "num_total")}</td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R2", "bases", "num_total")}</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R2_after", "reads", "num_total")} </td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_R2_after", "bases", "num_total")}</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
#{
val beforeTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read, "bases", "num_total").getOrElse(0).asInstanceOf[Long]
val afterTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_after", "bases", "num_total").getOrElse(0).asInstanceOf[Long]
}#
<td>${read}</td>
<td>${beforeTotal}</td>
<td>${beforeTotal - afterTotal}</td>
<td>${(beforeTotal - afterTotal).toDouble / beforeTotal * 100}%</td>
<td>${afterTotal}</td>
#end
</tr>
#end
......
......@@ -28,7 +28,7 @@
<tbody>
<tr><td></td>
<th>Before QC</th>
#if (!skipTrim || !skipClip) <th>after QC</th> #end
#if (!skipTrim || !skipClip) <th>After QC</th> #end
</tr>
<tr><th>R1</th>
<td><img src="${getPlot("fastqc_R1")}" width="75%"></td>
......
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
#{
val samples = sampleId match {
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
}
}#
<table>
<thead><tr>
<th>Sample</th>
<th colspan="2">Library</th>
<th>Before QC</th>
<th>After QC</th>
</tr></thead>
<tbody>
#for (sample <- samples.toList.sorted)
#{
val libs = libId match {
case Some(libId) => List(libId.toString)
case _ => summary.libraries(sample).toList
}
val sampleRowspan = {
libs.size +
libs.count(summary.getLibraryValue(sample, _, "flexiprep", "settings", "paired").getOrElse(false) == true)
}
}#
<tr><td rowspan="${sampleRowspan}">${sample}</td>
#for (libId <- libs)
#if (libs.head != libId) <tr> #end
#{ val paired = summary.getLibraryValue(sample, libId, "flexiprep", "settings", "paired").getOrElse(false) }#
<td #if (paired == true) rowspan="2" #end>${libId}</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
<td>${read}</td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read, "reads", "num_total")}
</td>
<td> ${summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_after", "reads", "num_total")}</td>
#end
</tr>
#end
#end
</tbody>
</table>
\ No newline at end of file
......@@ -10,7 +10,8 @@ object FlexiprepReport extends ReportBuilder {
def indexPage = {
ReportPage(Map(), List(
"Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepSummary.ssp"),
"Read Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"Base Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"),
fastqcPlotSection("Base quality", "plot_per_base_quality"),
fastqcPlotSection("Sequence quality", "plot_per_sequence_quality"),
fastqcPlotSection("Base GC content", "plot_per_base_gc_content"),
......
......@@ -9,19 +9,25 @@ import nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
object ShivaReport extends MultisampleReportBuilder {
def samplePage(sampleId: String, args: Map[String, Any]) = {
ReportPage(Map("Libraries" -> generateLibraryPage(args)), List(
"Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp")
"Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp"),
"QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
), args)
}
def libraryPage(libId: String, args: Map[String, Any]) = {
ReportPage(Map("Flexiprep" -> FlexiprepReport.indexPage), List(), args)
ReportPage(Map("Flexiprep" -> FlexiprepReport.indexPage), List(
"QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
), args)
}
def reportName = "Title Test"
def generalPage = ReportPage(Map(), List(
"Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp"),
"Flexiprep" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepSummary.ssp")
"QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
), Map())
// FIXME: Not yet finished
......
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