Commit 2adc9bde authored by rhpvorderman's avatar rhpvorderman

Insertsize.ssp defutured

parent 544d0585
......@@ -9,7 +9,6 @@
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var rootPath: String %>
<%@ var metricsTag: String = "bammetrics" %>
<%@ var sampleLevel: Boolean = false %>
<%@ var outputDir: File %>
<%@ var fields: List[String] = List("mean_insert_size", "standard_deviation", "median_insert_size")%>
......@@ -19,8 +18,8 @@
<%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<%@ var insertSizePlotLines: Option[Seq[String]] %>
<%@ var alignmentSummaryResults: Map[(Int, Int), Map[String, Option[Any]]] %>
<%@ var insertSizePlotTables: Option[Array[Map[String, Array[Any]]]] %>
<%@ var insertSizeTableResults: Map[(Int, Int), Map[String, Option[Any]]] %>
#{
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
......@@ -47,7 +46,7 @@
#end
#if (showPlot)
#{ BammetricsReport.insertSizePlot(outputDir, "insertsize", summary, !sampleLevel, sampleId = sampleId, libraryId = libId) }#
#{ BammetricsReport.insertSizePlot(outputDir, "insertsize", insertSizePlotTables.getOrElse(Array(Map("x" -> Array(""))))) }#
<div class="panel-body">
<img src="insertsize.png" class="img-responsive" />
......@@ -90,8 +89,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", "CollectInsertSizeMetrics", sample = sample.id, library = libId.map(LibraryId).getOrElse(NoLibrary), keyValues = statsPaths)
val results: Map[String, Option[Any]] = insertSizeTableResults(sample.id, libId)
}#
#for (field <- fields)
<td>${results(field)}</td>
......
......@@ -95,11 +95,11 @@ object BammetricsReportPage {
}
val clippingPlotTables: Option[Array[Map[String, Array[Any]]]] =
if (showPlot)
Some(BammetricsReport.clippingPlotTables(summary,!sampleLevel, sampleId, libId))
Some(BammetricsReport.clippingPlotTables(summary, !sampleLevel, sampleId, libId))
else None
val statsPaths = fields.map(x => x -> List("clipping", "general", x)).toMap
val clippingTableResults = summary.getStatsForLibraries(runId, "bammetrics", "bamstats",sampleId, statsPaths)
val clippingTableResults = summary.getStatsForLibraries(runId, "bammetrics", "bamstats", sampleId, statsPaths)
Map(
"clippingPlotTables" -> clippingPlotTables,
"clippingTableResults" -> clippingTableResults,
......@@ -110,4 +110,39 @@ object BammetricsReportPage {
"libId" -> libId
)
}
def insertSizeValues(summary: SummaryDb,
runId: Int,
allSamples: Seq[Sample],
allLibraries: Seq[Library],
sampleId: Option[Int],
libId: Option[Int],
fields: List[String] = List("mean_insert_size", "standard_deviation", "median_insert_size"),
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 insertSizePlotTables: Option[Array[Map[String, Array[Any]]]] =
if (showPlot)
Some(BammetricsReport.clippingPlotTables(summary, !sampleLevel, sampleId, libId))
else None
val statsPaths = fields.map(x => x -> List("metrics", x.toUpperCase)).toMap
val insertSizeTableResults = summary.getStatsForLibraries(runId, "bammetrics", "CollectInsertSizeMetrics", sampleId, statsPaths)
Map(
"insertSizePlotTables" -> insertSizePlotTables,
"insertSizeTableResults" -> insertSizeTableResults,
"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