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

Extended flexiprep summaries

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