Commit 6c753678 authored by rhpvorderman's avatar rhpvorderman

rna- and wgs histogram defutured

parent 2adc9bde
...@@ -89,7 +89,7 @@ ...@@ -89,7 +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 results: Map[String, Option[Any]] = insertSizeTableResults(sample.id, libId) val results: Map[String, Option[Any]] = insertSizeTableResults(sample.id, libId)
}# }#
#for (field <- fields) #for (field <- fields)
<td>${results(field)}</td> <td>${results(field)}</td>
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %> <%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %> <%@ 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 { val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList case Some(id) => allSamples.filter(_.id == id).toList
...@@ -39,7 +41,7 @@ ...@@ -39,7 +41,7 @@
#end #end
#if (showPlot) #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"> <div class="panel-body">
<img src="rna.png" class="img-responsive" /> <img src="rna.png" class="img-responsive" />
...@@ -79,8 +81,7 @@ ...@@ -79,8 +81,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("metrics", x.toUpperCase)).toMap val results = rnaHistogramTableResults(sample.id, libId)
val results = summary.getStatKeys(runId, "bammetrics", "rna", 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>
......
...@@ -19,6 +19,8 @@ ...@@ -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 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 allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %> <%@ 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 { val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList case Some(id) => allSamples.filter(_.id == id).toList
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
#end #end
#if (showPlot) #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"> <div class="panel-body">
<img src="wgs.png" class="img-responsive" /> <img src="wgs.png" class="img-responsive" />
...@@ -78,9 +80,8 @@ ...@@ -78,9 +80,8 @@
#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("metrics", x.toUpperCase)).toMap val results = wgsHistogramTableResults(sample.id, libId)
val results = summary.getStatKeys(runId, "bammetrics", "wgs", 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>
#end #end
......
...@@ -144,5 +144,71 @@ object BammetricsReportPage { ...@@ -144,5 +144,71 @@ object BammetricsReportPage {
"libId" -> libId "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