Commit 10d4ca79 authored by rhpvorderman's avatar rhpvorderman

Started defuturing mappingQuality.ssp

parent a868004e
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%> <%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%>
<%@ var allSamples: Seq[Sample] %> <%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %> <%@ var allLibraries: Seq[Library] %>
<%@ var mappingQualityPlotTables: Array[Map[String, Array[Any]]] %>
#{ #{
val samples = sampleId match { val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList case Some(id) => allSamples.filter(_.id == id).toList
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
#end #end
#if (showPlot) #if (showPlot)
#{ BammetricsReport.mappingQualityPlot(outputDir, "mapping_quality", summary, !sampleLevel, sampleId = sampleId, libraryId = libId) }# #{ BammetricsReport.mappingQualityPlot(outputDir, "mapping_quality", mappingQualityPlotTables)}#
<div class="panel-body"> <div class="panel-body">
<img src="mapping_quality.png" class="img-responsive" /> <img src="mapping_quality.png" class="img-responsive" />
......
...@@ -17,12 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics ...@@ -17,12 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics
import java.io.{File, PrintWriter} import java.io.{File, PrintWriter}
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.report.{ import nl.lumc.sasc.biopet.core.report.{ReportBuilder, ReportBuilderExtension, ReportPage, ReportSection}
ReportBuilder,
ReportBuilderExtension,
ReportPage,
ReportSection
}
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.utils.rscript.{LinePlot, StackedBarPlot} import nl.lumc.sasc.biopet.utils.rscript.{LinePlot, StackedBarPlot}
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
...@@ -534,19 +529,16 @@ object BammetricsReport extends ReportBuilder { ...@@ -534,19 +529,16 @@ object BammetricsReport extends ReportBuilder {
} }
writer.close() writer.close()
} }
} def alignmentReportValues(summary: SummaryDb,
runId: Int,
object BamMetricsAlignmentReport { allSamples: Seq[Sample],
def values(summary: SummaryDb, allLibraries: Seq[Library],
runId: Int, sampleId: Option[Int] = None,
allSamples: Seq[Sample], libId: Option[Int] = None,
allLibraries: Seq[Library], sampleLevel: Boolean = false,
sampleId: Option[Int] = None, showPlot: Boolean = false,
libId: Option[Int] = None, showIntro: Boolean = true,
sampleLevel: Boolean = false, showTable: Boolean = true): Map[String, Any] = {
showPlot: Boolean = false,
showIntro: Boolean = true,
showTable: Boolean = true): Map[String, Any] = {
val statsPaths = Map( val statsPaths = Map(
"All" -> List("flagstats", "All"), "All" -> List("flagstats", "All"),
...@@ -571,9 +563,7 @@ object BamMetricsAlignmentReport { ...@@ -571,9 +563,7 @@ object BamMetricsAlignmentReport {
"libId" -> libId "libId" -> libId
) )
} }
} def mappingQualityValues(summary: SummaryDb,
object BamMetricsMappingQuality {
def values(summary: SummaryDb,
runId: Int, runId: Int,
allSamples: Seq[Sample], allSamples: Seq[Sample],
allLibraries: Seq[Library], allLibraries: Seq[Library],
...@@ -582,11 +572,19 @@ object BamMetricsMappingQuality { ...@@ -582,11 +572,19 @@ object BamMetricsMappingQuality {
sampleLevel: Boolean = false, sampleLevel: Boolean = false,
showPlot: Boolean = false, showPlot: Boolean = false,
showIntro: Boolean = true, showIntro: Boolean = true,
showTable: Boolean = true): Map[String, Any] = { showTable: Boolean = true
: Map[String, Any] = {
val samples = sampleId match { val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList case _ => allSamples.toList
} }
val mapQualityPlotTables = mappingQualityPlotTables(summary,!sampleLevel,sampleId,libId)
Map("mappingQualityPlotTables" -> mapQualityPlotTables,
"showIntro" -> showIntro,
"showTable" -> showTable,
"showPlot" -> showPlot,
"sampleId" -> sampleId,
"libId" -> libId)
} }
} }
\ No newline at end of file
...@@ -124,7 +124,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -124,7 +124,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
libraries, libraries,
sampleId, sampleId,
libId) libId)
val alignmentSummary = BamMetricsAlignmentReport.values(summary, val alignmentSummary = BammetricsReport.alignmentReportValues(summary,
runId, runId,
samples, samples,
libraries, libraries,
......
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