Commit 3df673e7 authored by rhpvorderman's avatar rhpvorderman

formatting

parent af6b885e
...@@ -75,15 +75,15 @@ object BammetricsReport extends ReportBuilder { ...@@ -75,15 +75,15 @@ object BammetricsReport extends ReportBuilder {
libId: Option[Int], libId: Option[Int],
metricsTag: String = "bammetrics"): Map[String, Any] = { metricsTag: String = "bammetrics"): Map[String, Any] = {
val wgsExecuted = summary.getStatsSize(runId, val wgsExecuted = summary.getStatsSize(runId,
metricsTag, metricsTag,
"wgs", "wgs",
sample = sampleId.map(SampleId), sample = sampleId.map(SampleId),
library = libId.map(LibraryId)) >= 1 library = libId.map(LibraryId)) >= 1
val rnaExecuted = summary.getStatsSize(runId, val rnaExecuted = summary.getStatsSize(runId,
metricsTag, metricsTag,
"rna", "rna",
sample = sampleId.map(SampleId), sample = sampleId.map(SampleId),
library = libId.map(LibraryId)) >= 1 library = libId.map(LibraryId)) >= 1
val insertsizeMetrics = summary val insertsizeMetrics = summary
.getStatKeys( .getStatKeys(
...@@ -113,9 +113,11 @@ object BammetricsReport extends ReportBuilder { ...@@ -113,9 +113,11 @@ object BammetricsReport extends ReportBuilder {
case _ => Nil case _ => Nil
} }
val covstatsPlotValuesArray = ArrayBuffer[(String, Map[String,Any])]() val covstatsPlotValuesArray = ArrayBuffer[(String, Map[String, Any])]()
for (t <- targets) { for (t <- targets) {
covstatsPlotValuesArray += Tuple2(t,BammetricsReportPage.covstatsPlotValues(summary, runId, sampleId, libId, Some(t))) covstatsPlotValuesArray += Tuple2(
t,
BammetricsReportPage.covstatsPlotValues(summary, runId, sampleId, libId, Some(t)))
} }
val covstatsPlotValuesList = covstatsPlotValuesArray.toList val covstatsPlotValuesList = covstatsPlotValuesArray.toList
...@@ -143,7 +145,7 @@ object BammetricsReport extends ReportBuilder { ...@@ -143,7 +145,7 @@ object BammetricsReport extends ReportBuilder {
libraries, libraries,
sampleId, sampleId,
libId, libId,
showPlot= true showPlot = true
) )
val insertSizeReportValues = BammetricsReportPage.insertSizeValues( val insertSizeReportValues = BammetricsReportPage.insertSizeValues(
summary, summary,
...@@ -152,15 +154,28 @@ object BammetricsReport extends ReportBuilder { ...@@ -152,15 +154,28 @@ object BammetricsReport extends ReportBuilder {
libraries, libraries,
sampleId, sampleId,
libId, libId,
showPlot= true showPlot = true
) )
val wgsHistogramReportValues = BammetricsReportPage.wgsHistogramValues( val wgsHistogramReportValues = BammetricsReportPage.wgsHistogramValues(
summary,runId, samples, libraries, sampleId, libId, showPlot = true summary,
runId,
samples,
libraries,
sampleId,
libId,
showPlot = true
) )
val rnaHistogramReportValues = BammetricsReportPage.rnaHistogramValues( val rnaHistogramReportValues = BammetricsReportPage.rnaHistogramValues(
summary,runId, samples, libraries, sampleId, libId, showPlot = true summary,
runId,
samples,
libraries,
sampleId,
libId,
showPlot = true
) )
Map("wgsExecuted" -> wgsExecuted, Map(
"wgsExecuted" -> wgsExecuted,
"rnaExecuted" -> rnaExecuted, "rnaExecuted" -> rnaExecuted,
"insertsizeMetrics" -> insertsizeMetrics, "insertsizeMetrics" -> insertsizeMetrics,
"targetSettings" -> targetSettings, "targetSettings" -> targetSettings,
...@@ -181,15 +196,15 @@ object BammetricsReport extends ReportBuilder { ...@@ -181,15 +196,15 @@ object BammetricsReport extends ReportBuilder {
metricsTag: String = "bammetrics"): Future[ReportPage] = { metricsTag: String = "bammetrics"): Future[ReportPage] = {
val wgsExecuted: Boolean = summary.getStatsSize(runId, val wgsExecuted: Boolean = summary.getStatsSize(runId,
metricsTag, metricsTag,
"wgs", "wgs",
sample = sampleId.map(SampleId), sample = sampleId.map(SampleId),
library = libId.map(LibraryId)) >= 1 library = libId.map(LibraryId)) >= 1
val rnaExecuted: Boolean = summary.getStatsSize(runId, val rnaExecuted: Boolean = summary.getStatsSize(runId,
metricsTag, metricsTag,
"rna", "rna",
sample = sampleId.map(SampleId), sample = sampleId.map(SampleId),
library = libId.map(LibraryId)) >= 1 library = libId.map(LibraryId)) >= 1
val insertsizeMetrics: Boolean = summary val insertsizeMetrics: Boolean = summary
.getStatKeys( .getStatKeys(
...@@ -219,21 +234,33 @@ object BammetricsReport extends ReportBuilder { ...@@ -219,21 +234,33 @@ object BammetricsReport extends ReportBuilder {
case _ => Nil case _ => Nil
} }
val covstatsPlotValuesArray = ArrayBuffer[(String, Map[String,Any])]() val covstatsPlotValuesArray = ArrayBuffer[(String, Map[String, Any])]()
for (t <- targets) { for (t <- targets) {
covstatsPlotValuesArray += Tuple2(t,BammetricsReportPage.covstatsPlotValues(summary, runId, sampleId, libId, Some(t))) covstatsPlotValuesArray += Tuple2(
} t,
BammetricsReportPage.covstatsPlotValues(summary, runId, sampleId, libId, Some(t)))
}
val covstatsPlotValuesList: List[(String, Map[String, Any])] = covstatsPlotValuesArray.toList val covstatsPlotValuesList: List[(String, Map[String, Any])] = covstatsPlotValuesArray.toList
val alignmentSummaryReportValues: Map[String, Any] = BammetricsReportPage.alignmentSummaryValues( val alignmentSummaryReportValues: Map[String, Any] =
BammetricsReportPage.alignmentSummaryValues(
summary,
runId,
samples,
libraries,
sampleId,
libId
)
val mappingQualityReportValues: Map[String, Any] = BammetricsReportPage.mappingQualityValues(
summary, summary,
runId, runId,
samples, samples,
libraries, libraries,
sampleId, sampleId,
libId libId,
showPlot = true
) )
val mappingQualityReportValues: Map[String, Any] = BammetricsReportPage.mappingQualityValues( val clippingReportValues: Map[String, Any] = BammetricsReportPage.clippingValues(
summary, summary,
runId, runId,
samples, samples,
...@@ -242,50 +269,55 @@ object BammetricsReport extends ReportBuilder { ...@@ -242,50 +269,55 @@ object BammetricsReport extends ReportBuilder {
libId, libId,
showPlot = true showPlot = true
) )
val clippingReportValues: Map[String, Any] = BammetricsReportPage.clippingValues( val insertSizeReportValues: Map[String, Any] = BammetricsReportPage.insertSizeValues(
summary, summary,
runId, runId,
samples, samples,
libraries, libraries,
sampleId, sampleId,
libId, libId,
showPlot= true showPlot = true
) )
val insertSizeReportValues: Map[String, Any] = BammetricsReportPage.insertSizeValues( val wgsHistogramReportValues: Map[String, Any] = BammetricsReportPage.wgsHistogramValues(
summary, summary,
runId, runId,
samples, samples,
libraries, libraries,
sampleId, sampleId,
libId, libId,
showPlot= true showPlot = true
)
val wgsHistogramReportValues: Map[String, Any] = BammetricsReportPage.wgsHistogramValues(
summary,runId, samples, libraries, sampleId, libId, showPlot = true
) )
val rnaHistogramReportValues: Map[String, Any] = BammetricsReportPage.rnaHistogramValues( val rnaHistogramReportValues: Map[String, Any] = BammetricsReportPage.rnaHistogramValues(
summary,runId, samples, libraries, sampleId, libId, showPlot = true summary,
runId,
samples,
libraries,
sampleId,
libId,
showPlot = true
) )
Future { Future {
ReportPage( ReportPage(
if (targets.isEmpty) List() if (targets.isEmpty) List()
else else
List( List(
"Targets" -> Future.successful( "Targets" -> Future.successful(ReportPage(
ReportPage( List(),
List(), covstatsPlotValuesList.map(covstats =>
covstatsPlotValuesList.map(covstats => covstats._1 -> ReportSection(
covstats._1 -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsPlot.ssp", "/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsPlot.ssp",
covstats._2)), covstats._2)),
Map()))), Map()
))),
List( List(
"Summary" -> ReportSection( "Summary" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",alignmentSummaryReportValues), "/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",
alignmentSummaryReportValues),
"Mapping Quality" -> ReportSection( "Mapping Quality" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/mappingQuality.ssp", "/nl/lumc/sasc/biopet/pipelines/bammetrics/mappingQuality.ssp",
mappingQualityReportValues), mappingQualityReportValues),
"Clipping" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/clipping.ssp", "Clipping" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/clipping.ssp",
clippingReportValues) clippingReportValues)
) ++ ) ++
(if (insertsizeMetrics) (if (insertsizeMetrics)
List( List(
......
...@@ -271,8 +271,6 @@ object BammetricsReportPage { ...@@ -271,8 +271,6 @@ object BammetricsReportPage {
sampleId.map(SampleId).get, sampleId.map(SampleId).get,
libId.map(LibraryId).getOrElse(NoLibrary), libId.map(LibraryId).getOrElse(NoLibrary),
statsPaths) statsPaths)
Map("plotFile" -> plotFile, "values" -> values, Map("plotFile" -> plotFile, "values" -> values, "target" -> target, "metricsTag" -> metricsTag)
"target" -> target,
"metricsTag" -> metricsTag)
} }
} }
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