Commit 67b9334f authored by rhpvorderman's avatar rhpvorderman

Completely defutured mappingQuality.ssp

parent 10d4ca79
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._) #import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Library)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
<%@ var allSamples: Seq[Sample] %> <%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %> <%@ var allLibraries: Seq[Library] %>
<%@ var mappingQualityPlotTables: Array[Map[String, Array[Any]]] %> <%@ var mappingQualityPlotTables: Array[Map[String, Array[Any]]] %>
<%@ var mappingQualityTableResults: Map[(Int, Int), Map[String, Option[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
...@@ -87,8 +89,7 @@ ...@@ -87,8 +89,7 @@
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
val statsPaths = fields.map(x => x -> List("mapping_quality", "general", x)).toMap val results: Map[String, Option[Any]] = mappingQualityTableResults(sample.id, libId)
val results = summary.getStatKeys(runId, "bammetrics", "bamstats", sample = sample.id, library = libId.map(LibraryId).getOrElse(NoLibrary), keyValues = statsPaths)
}# }#
#for (field <- fields) #for (field <- fields)
<td>${results(field)}</td> <td>${results(field)}</td>
......
...@@ -569,10 +569,11 @@ object BammetricsReport extends ReportBuilder { ...@@ -569,10 +569,11 @@ object BammetricsReport extends ReportBuilder {
allLibraries: Seq[Library], allLibraries: Seq[Library],
sampleId: Option[Int], sampleId: Option[Int],
libId: Option[Int], libId: Option[Int],
fields: List[String] = List("min", "max", "mean", "median", "modal"),
sampleLevel: Boolean = false, sampleLevel: Boolean = false,
showPlot: Boolean = false, showPlot: Boolean = false,
showIntro: Boolean = true, showIntro: Boolean = true,
showTable: Boolean = true showTable: Boolean = true)
: Map[String, Any] = { : Map[String, Any] = {
val samples = sampleId match { val samples = sampleId match {
...@@ -580,7 +581,11 @@ object BammetricsReport extends ReportBuilder { ...@@ -580,7 +581,11 @@ object BammetricsReport extends ReportBuilder {
case _ => allSamples.toList case _ => allSamples.toList
} }
val mapQualityPlotTables = mappingQualityPlotTables(summary,!sampleLevel,sampleId,libId) val mapQualityPlotTables = mappingQualityPlotTables(summary,!sampleLevel,sampleId,libId)
val statsPaths = fields.map(x => x -> List("mapping_quality", "general", x)).toMap
val mappingQualityTableResults: Map[(Int, Int), Map[String, Option[Any]]]: = summary.getStatsForLibraries(runId, "bammetrics", "bamstats", sampleId, statsPaths)
Map("mappingQualityPlotTables" -> mapQualityPlotTables, Map("mappingQualityPlotTables" -> mapQualityPlotTables,
"mappingQualityTableResults" -> mappingQualityTableResults,
"showIntro" -> showIntro, "showIntro" -> showIntro,
"showTable" -> showTable, "showTable" -> showTable,
"showPlot" -> showPlot, "showPlot" -> showPlot,
......
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