Commit 6c753678 authored by rhpvorderman's avatar rhpvorderman

rna- and wgs histogram defutured

parent 2adc9bde
......@@ -20,6 +20,8 @@
<%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<%@ var rnaHistogramPlotTables: Option[Array[Map[String, Array[Any]]]] %>
<%@ var rnaHistogramTableResults: Map[(Int, Int), Map[String, Option[Any]]] %>
#{
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
......@@ -39,7 +41,7 @@
#end
#if (showPlot)
#{ BammetricsReport.rnaHistogramPlot(outputDir, "rna", summary, !sampleLevel, sampleId = sampleId, libraryId = libId) }#
#{ BammetricsReport.rnaHistogramPlot(outputDir, "rna", rnaHistogramPlotTables.getOrElse(Array(Map("x" -> Array(""))))) }#
<div class="panel-body">
<img src="rna.png" class="img-responsive" />
......@@ -79,8 +81,7 @@
#if (libs.head != libId) <tr> #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("metrics", x.toUpperCase)).toMap
val results = summary.getStatKeys(runId, "bammetrics", "rna", sample = sample.id, library = libId.map(LibraryId).getOrElse(NoLibrary), keyValues = statsPaths)
val results = rnaHistogramTableResults(sample.id, libId)
}#
#for (field <- fields)
<td>${results(field)}</td>
......
......@@ -19,6 +19,8 @@
<%@ var fields: List[String] = List("mean_coverage", "pct_5x", "pct_10x", "pct_15x", "pct_20x", "pct_25x", "pct_30x", "pct_40x", "pct_50x", "pct_60x", "pct_70x", "pct_80x", "pct_90x", "pct_100x")%>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<%@ var wgsHistogramPlotTables: Option[Array[Map[String, Array[Any]]]] %>
<%@ var wgsHistogramTableResults: Map[(Int, Int), Map[String, Option[Any]]] %>
#{
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
......@@ -38,7 +40,7 @@
#end
#if (showPlot)
#{ BammetricsReport.wgsHistogramPlot(outputDir, "wgs", summary, !sampleLevel, sampleId = sampleId, libraryId = libId) }#
#{ BammetricsReport.wgsHistogramPlot(outputDir, "rna", wgsHistogramPlotTables.getOrElse(Array(Map("x" -> Array(""))))) }#
<div class="panel-body">
<img src="wgs.png" class="img-responsive" />
......@@ -78,8 +80,7 @@
#if (libs.head != libId) <tr> #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("metrics", x.toUpperCase)).toMap
val results = summary.getStatKeys(runId, "bammetrics", "wgs", sample = sample.id, library = libId.map(LibraryId).getOrElse(NoLibrary), keyValues = statsPaths)
val results = wgsHistogramTableResults(sample.id, libId)
}#
#for (field <- fields)
<td>${results(field)}</td>
......
......@@ -144,5 +144,71 @@ object BammetricsReportPage {
"libId" -> libId
)
}
def rnaHistogramValues(summary: SummaryDb,
runId: Int,
allSamples: Seq[Sample],
allLibraries: Seq[Library],
sampleId: Option[Int],
libId: Option[Int],
fields: List[String] = List("PF_ALIGNED_BASES", "MEDIAN_5PRIME_BIAS", "MEDIAN_3PRIME_BIAS", "MEDIAN_5PRIME_TO_3PRIME_BIAS"),
sampleLevel: Boolean = false,
showPlot: Boolean = false,
showIntro: Boolean = true,
showTable: Boolean = true): Map[String, Any] = {
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
val rnaHistogramPlotTables: Option[Array[Map[String, Array[Any]]]] =
if (showPlot)
Some(BammetricsReport.rnaHistogramPlotTables(summary, !sampleLevel, sampleId, libId))
else None
val statsPaths = fields.map(x => x -> List("metrics", x.toUpperCase)).toMap
val rnaHistogramTableResults = summary.getStatsForLibraries(runId, "bammetrics", "rna", sampleId, statsPaths)
Map(
"rnaHistogramPlotTables" -> rnaHistogramPlotTables,
"rnaHistogramTableResults" -> rnaHistogramTableResults,
"showIntro" -> showIntro,
"showTable" -> showTable,
"showPlot" -> showPlot,
"sampleId" -> sampleId,
"libId" -> libId
)
}
def wgsHistogramValues(summary: SummaryDb,
runId: Int,
allSamples: Seq[Sample],
allLibraries: Seq[Library],
sampleId: Option[Int],
libId: Option[Int],
fields: List[String] = List("mean_coverage", "pct_5x", "pct_10x", "pct_15x", "pct_20x", "pct_25x", "pct_30x", "pct_40x", "pct_50x", "pct_60x", "pct_70x", "pct_80x", "pct_90x", "pct_100x"),
sampleLevel: Boolean = false,
showPlot: Boolean = false,
showIntro: Boolean = true,
showTable: Boolean = true): Map[String, Any] = {
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
val wgsHistogramPlotTables: Option[Array[Map[String, Array[Any]]]] =
if (showPlot)
Some(BammetricsReport.wgsHistogramPlotTables(summary, !sampleLevel, sampleId, libId))
else None
val statsPaths = fields.map(x => x -> List("metrics", x.toUpperCase)).toMap
val wgsHistogramTableResults = summary.getStatsForLibraries(runId, "bammetrics", "wgs", sampleId, statsPaths)
Map(
"wgsHistogramPlotTables" -> wgsHistogramPlotTables,
"wgsHistogramTableResults" -> wgsHistogramTableResults,
"showIntro" -> showIntro,
"showTable" -> showTable,
"showPlot" -> showPlot,
"sampleId" -> sampleId,
"libId" -> libId
)
}
}
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