Commit e2e3d2a5 authored by rhpvorderman's avatar rhpvorderman

Defuture flexiprepPage method

parent 1a7a8908
...@@ -51,15 +51,18 @@ object FlexiprepReport extends ReportBuilder { ...@@ -51,15 +51,18 @@ object FlexiprepReport extends ReportBuilder {
override def pageArgs = Map("multisample" -> false) override def pageArgs = Map("multisample" -> false)
/** Index page for a flexiprep report */ /** Index page for a flexiprep report */
def indexPage: Future[ReportPage] = this.flexiprepPage(summary, sampleId.get, libId.get).map { def indexPage: Future[ReportPage] = {
page => val flexiprepPageSummaries = this.flexiprepPageSummaries(summary, sampleId.get, libId.get)
ReportPage( this.flexiprepPage(flexiprepPageSummaries).map {
Nil, page =>
List( ReportPage(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp") Nil,
) ::: page.sections, List(
Map()) "Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp")
} ) ::: page.sections,
Map())
}}
/** Generate a QC report page for 1 single library, sampleId and libId must be defined in the arguments */
def flexiprepPageSummaries(summary: SummaryDb, def flexiprepPageSummaries(summary: SummaryDb,
sampleId: Int, sampleId: Int,
libId: Int): Map[String, Map[String, Any]] = { libId: Int): Map[String, Map[String, Any]] = {
...@@ -81,7 +84,7 @@ object FlexiprepReport extends ReportBuilder { ...@@ -81,7 +84,7 @@ object FlexiprepReport extends ReportBuilder {
"flexiprepBaseSummary" -> flexiprepBaseSummary "flexiprepBaseSummary" -> flexiprepBaseSummary
) )
} }
/** Generate a QC report page for 1 single library, sampleId and libId must be defined in the arguments */
def flexiprepPage(summaries: Map[String, Map[String, Any]]): Future[ReportPage] = { def flexiprepPage(summaries: Map[String, Map[String, Any]]): Future[ReportPage] = {
val flexiprepBaseSummary = summaries("flexiprepBaseSummary") val flexiprepBaseSummary = summaries("flexiprepBaseSummary")
val flexiprepReadSummary = summaries("flexiprepReadSummary") val flexiprepReadSummary = summaries("flexiprepReadSummary")
......
...@@ -344,7 +344,10 @@ object GearsReport extends MultisampleReportBuilder { ...@@ -344,7 +344,10 @@ object GearsReport extends MultisampleReportBuilder {
Duration.Inf) Duration.Inf)
val flexiprepReportPage = val flexiprepReportPage =
if (flexiprepExecuted) Some("QC" -> FlexiprepReport.flexiprepPage(summary, sampleId, libId)) if (flexiprepExecuted) {
val flexiprepPageSummaries = FlexiprepReport.flexiprepPageSummaries(summary,sampleId,libId)
Some("QC" -> FlexiprepReport.flexiprepPage(flexiprepPageSummaries))
}
else None else None
val centrifugePageAllMappingsKronaPlot = GearsKronaPlot.values(summary, val centrifugePageAllMappingsKronaPlot = GearsKronaPlot.values(summary,
......
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