Commit e2e3d2a5 authored by rhpvorderman's avatar rhpvorderman

Defuture flexiprepPage method

parent 1a7a8908
......@@ -51,7 +51,9 @@ object FlexiprepReport extends ReportBuilder {
override def pageArgs = Map("multisample" -> false)
/** Index page for a flexiprep report */
def indexPage: Future[ReportPage] = this.flexiprepPage(summary, sampleId.get, libId.get).map {
def indexPage: Future[ReportPage] = {
val flexiprepPageSummaries = this.flexiprepPageSummaries(summary, sampleId.get, libId.get)
this.flexiprepPage(flexiprepPageSummaries).map {
page =>
ReportPage(
Nil,
......@@ -59,7 +61,8 @@ object FlexiprepReport extends ReportBuilder {
"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,
sampleId: Int,
libId: Int): Map[String, Map[String, Any]] = {
......@@ -81,7 +84,7 @@ object FlexiprepReport extends ReportBuilder {
"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] = {
val flexiprepBaseSummary = summaries("flexiprepBaseSummary")
val flexiprepReadSummary = summaries("flexiprepReadSummary")
......
......@@ -344,7 +344,10 @@ object GearsReport extends MultisampleReportBuilder {
Duration.Inf)
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
val centrifugePageAllMappingsKronaPlot = GearsKronaPlot.values(summary,
......
......@@ -138,15 +138,15 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
showPlot = true,
showTable = false)
val clippingReportValues = BammetricsReportPage.clippingValues(summary, runId, samples,
libraries, sampleId, libId,sampleLevel = true, showPlot = true, showTable = false)
libraries, sampleId, libId, sampleLevel = true, showPlot = true, showTable = false)
val insertSizeReportValues = BammetricsReportPage.insertSizeValues(summary, runId, samples,
libraries, sampleId, libId,sampleLevel = true, showPlot = true, showTable = false)
libraries, sampleId, libId, sampleLevel = true, showPlot = true, showTable = false)
val wgsHistogramReportValues = BammetricsReportPage.wgsHistogramValues(summary, runId, samples,
libraries, sampleId, libId,sampleLevel = true, showPlot = true, showTable = false)
libraries, sampleId, libId, sampleLevel = true, showPlot = true, showTable = false)
val rnaHistogramReportValues = BammetricsReportPage.rnaHistogramValues(summary, runId, samples,
libraries, sampleId, libId,sampleLevel = true, showPlot = true, showTable = false)
val flexiprepReadSummary = FlexiprepReadSummary.values(summary, runId, samples, libraries,sampleId,libId,showPlot=true, showTable = false)
val flexiprepBaseSummary = FlexiprepBaseSummary.values(summary, runId, samples, libraries,sampleId,libId,showPlot=true, showTable = false)
libraries, sampleId, libId, sampleLevel = true, showPlot = true, showTable = false)
val flexiprepReadSummary = FlexiprepReadSummary.values(summary, runId, samples, libraries, sampleId, libId, showPlot = true, showTable = false)
val flexiprepBaseSummary = FlexiprepBaseSummary.values(summary, runId, samples, libraries, sampleId, libId, showPlot = true, showTable = false)
Future {
ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++
......@@ -250,16 +250,16 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val centrifugeAllMappingsReportValues = GearsKronaPlot.values(summary, runId, "gearscentrifuge",
"centrifuge_report", samples, libraries, sampleId, libId, Some("centrifuge"))
val centrifugeUniqueMappingsReportValues = GearsKronaPlot.values(summary,runId,"gearscentrifuge",
val centrifugeUniqueMappingsReportValues = GearsKronaPlot.values(summary, runId, "gearscentrifuge",
"centrifuge_unique_report", samples, libraries, sampleId, libId)
val dustbinAnalysisReportValues = GearsKronaPlot.values(summary,runId, "gearskraken", "krakenreport",
samples,libraries,sampleId,libId)
val dustbinAnalysisReportValues = GearsKronaPlot.values(summary, runId, "gearskraken", "krakenreport",
samples, libraries, sampleId, libId)
val alignmentSummaryReportValues = BammetricsReportPage.alignmentSummaryValues(summary, runId,
samples, libraries, sampleId, libId, showPlot = true)
val preprocessingReportValues = BammetricsReportPage.alignmentSummaryValues(summary, runId,
samples, libraries, sampleId, libId, sampleLevel = true)
val flexiprepReadSummary = FlexiprepReadSummary.values(summary,runId,samples,libraries,sampleId,libId)
val flexiprepBaseSummary = FlexiprepBaseSummary.values(summary,runId,samples,libraries,sampleId,libId)
val flexiprepReadSummary = FlexiprepReadSummary.values(summary, runId, samples, libraries, sampleId, libId)
val flexiprepBaseSummary = FlexiprepBaseSummary.values(summary, runId, samples, libraries, sampleId, libId)
Future {
ReportPage(
......@@ -286,7 +286,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
"Dustbin analysis" -> Future.successful(
ReportPage(List(),
List("Krona Plot" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",dustbinAnalysisReportValues)),
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp", dustbinAnalysisReportValues)),
Map())))
else Nil),
List(
......@@ -310,7 +310,9 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
}
/** Library page */
def libraryPage(sampleId: Int, libId: Int, args: Map[String, Any]): Future[ReportPage] = Future {
def libraryPage(sampleId: Int,
libId: Int,
args: Map[String, Any]): Future[ReportPage] = {
val krakenExecuted = Await.result(summary.getStatsSize(runId,
"gearskraken",
"krakenreport",
......@@ -331,6 +333,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
mustHaveLibrary = true),
Duration.Inf) >= 1
Future {
ReportPage(
("Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), Some(libId))) ::
(if (flexiprepExecuted)
......@@ -372,3 +375,4 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
}
}
}
}
\ No newline at end of file
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