Commit a9eae104 authored by Peter van 't Hof's avatar Peter van 't Hof

Switching to Future.successful

parent dcb9fd03
......@@ -51,8 +51,8 @@ object GearsReport extends MultisampleReportBuilder {
val qiimeClosesOtuTable = summary.getFile(runId, "gears", key = "qiime_closed_otu_table")
val qiimeOpenOtuTable = summary.getFile(runId, "gears", key = "qiime_open_otu_table")
val centrifugePage = (if (centrifugeExecuted) Some("Centriguge analysis" -> Future(ReportPage(List("Non-unique" ->
Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
val centrifugePage = (if (centrifugeExecuted) Some("Centriguge analysis" -> Future.successful(ReportPage(List("Non-unique" ->
Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
......@@ -60,17 +60,17 @@ object GearsReport extends MultisampleReportBuilder {
)), Map("summaryModuleTag" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")))))
else None)
val krakenPage = (if (krakenExecuted) Some("Kraken analysis" -> Future(ReportPage(List(), List(
"Krona plot" -> Future(ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
val krakenPage = (if (krakenExecuted) Some("Kraken analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> Future.successful(ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
))), Map())))
else None)
val qiimeClosedPage = (if (qiimeClosesOtuTable.isDefined) Some("Qiime closed reference analysis" -> Future(ReportPage(List(), List(
"Krona plot" -> Future(ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
val qiimeClosedPage = (if (qiimeClosesOtuTable.isDefined) Some("Qiime closed reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> Future.successful(ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
))), Map("biomFile" -> new File(run.outputDir + File.separator + qiimeClosesOtuTable.get.path)))))
else None)
val qiimeOpenPage = (if (qiimeOpenOtuTable.isDefined) Some("Qiime open reference analysis" -> Future(ReportPage(List(), List(
val qiimeOpenPage = (if (qiimeOpenOtuTable.isDefined) Some("Qiime open reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)), Map("biomFile" -> new File(run.outputDir + File.separator + qiimeOpenOtuTable.get.path)))))
else None)
......@@ -99,20 +99,20 @@ object GearsReport extends MultisampleReportBuilder {
val qiimeClosesOtuTable = Await.result(summary.getFile(runId, "gearssingle", NoModule, sampleId, NoLibrary, "qiime_closed_otu_table"), Duration.Inf)
val qiimeOpenOtuTable = Await.result(summary.getFile(runId, "gearssingle", NoModule, sampleId, NoLibrary, "qiime_open_otu_table"), Duration.Inf)
ReportPage((if (centrifugeExecuted) List("Centriguge analysis" -> Future(ReportPage(List(
"Non-unique" -> Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
ReportPage((if (centrifugeExecuted) List("Centriguge analysis" -> Future.successful(ReportPage(List(
"Non-unique" -> Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
)), Map("summaryModuleTag" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")))))
else Nil) ::: (if (krakenExecuted) List("Kraken analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (krakenExecuted) List("Kraken analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map())))
else Nil) ::: (if (qiimeClosesOtuTable.isDefined) List("Qiime closed reference analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (qiimeClosesOtuTable.isDefined) List("Qiime closed reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)), Map("biomFile" -> new File(run.outputDir + File.separator + qiimeClosesOtuTable.get.path)))))
else Nil) ::: (if (qiimeOpenOtuTable.isDefined) List("Qiime open reference analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (qiimeOpenOtuTable.isDefined) List("Qiime open reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)), Map("biomFile" -> new File(run.outputDir + File.separator + qiimeOpenOtuTable.get.path)))))
else Nil) ::: List(
......@@ -136,20 +136,20 @@ object GearsReport extends MultisampleReportBuilder {
ReportPage(
(if (flexiprepExecuted) List("QC" -> FlexiprepReport.flexiprepPage) else Nil
) ::: (if (centrifugeExecuted) List("Centriguge analysis" -> Future(ReportPage(List(
"Non-unique" -> Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
) ::: (if (centrifugeExecuted) List("Centriguge analysis" -> Future.successful(ReportPage(List(
"Non-unique" -> Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
)), Map("summaryModuleTag" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")))))
else Nil) ::: (if (krakenExecuted) List("Kraken analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (krakenExecuted) List("Kraken analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map())))
else Nil) ::: (if (qiimeClosesOtuTable.isDefined) List("Qiime closed reference analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (qiimeClosesOtuTable.isDefined) List("Qiime closed reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)), Map("biomFile" -> new File(qiimeClosesOtuTable.get.path)))))
else Nil) ::: (if (qiimeOpenOtuTable.isDefined) List("Qiime open reference analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (qiimeOpenOtuTable.isDefined) List("Qiime open reference analysis" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)), Map("biomFile" -> new File(qiimeOpenOtuTable.get.path)))))
else Nil), List(
......
......@@ -34,6 +34,7 @@ object GearsSingleReport extends ReportBuilder {
.map(x => ExtFile("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + x, x))
def indexPage: Future[ReportPage] = Future {
sampleId.map
val sampleName = sampleId.flatMap(x => Await.result(summary.getSampleName(x), Duration.Inf))
val libraryName = libId.flatMap(x => Await.result(summary.getLibraryName(x), Duration.Inf))
......
......@@ -56,7 +56,7 @@ object MappingReport extends ReportBuilder {
} else None
ReportPage((if (skipFlexiprep) Nil else List("QC" -> FlexiprepReport.flexiprepPage)) :::
bamMetricsPage.map(_.subPages).getOrElse(Nil) :::
(if (krakenExecuted) List("Gears - Metagenomics" -> Future(ReportPage(List(), List(
(if (krakenExecuted) List("Gears - Metagenomics" -> Future.successful(ReportPage(List(), List(
"Sunburst analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp"
)), Map())))
else Nil), List(
......
......@@ -66,18 +66,18 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++
(if (krakenExecuted) List("Dustbin analysis - Kraken" -> Future(ReportPage(List(), List(
(if (krakenExecuted) List("Dustbin analysis - Kraken" -> Future.successful(ReportPage(List(), List(
"Krona plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map())))
else Nil) ++ (if (centrifugeExecuted) List("Centriguge analysis" -> Future(ReportPage(List(
"Non-unique" -> Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
else Nil) ++ (if (centrifugeExecuted) List("Centriguge analysis" -> Future.successful(ReportPage(List(
"Non-unique" -> Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
)), Map("summaryModuleTag" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")))))
else Nil) ++
List("Reference" -> Future(ReportPage(List(), List(
List("Reference" -> Future.successful(ReportPage(List(), List(
"Reference" -> ReportSection("/nl/lumc/sasc/biopet/core/report/reference.ssp", Map("pipeline" -> pipelineName))
), Map()))
),
......@@ -122,14 +122,14 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
ReportPage(List(
"Libraries" -> generateLibraryPage(args),
"Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), None)) ++
(if (centrifugeExecuted) List("Centriguge analysis" -> Future(ReportPage(List(
"Non-unique" -> Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
(if (centrifugeExecuted) List("Centriguge analysis" -> Future.successful(ReportPage(List(
"Non-unique" -> Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report", "centrifugeTag" -> Some("centrifuge"))
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
)), Map("summaryModuleTag" -> "gearscentrifuge"))))
else Nil) ::: (if (krakenExecuted) List("Dustbin analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (krakenExecuted) List("Dustbin analysis" -> Future.successful(ReportPage(List(), List(
"Krona Plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map())))
else Nil), List(
......@@ -154,14 +154,14 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
ReportPage(
("Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), Some(libId))) ::
(if (flexiprepExecuted) List("QC" -> FlexiprepReport.flexiprepPage) else Nil) :::
(if (centrifugeExecuted) List("Centriguge analysis" -> Future(ReportPage(List(
"Non-unique" -> Future(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
(if (centrifugeExecuted) List("Centriguge analysis" -> Future.successful(ReportPage(List(
"Non-unique" -> Future.successful(ReportPage(List(), List("All mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_report")
)), Map()))), List(
"Unique mappings" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
Map("summaryStatsTag" -> "centrifuge_unique_report")
)), Map("summaryModuleTag" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")))))
else Nil) ::: (if (krakenExecuted) List("Dustbin analysis" -> Future(ReportPage(List(), List(
else Nil) ::: (if (krakenExecuted) List("Dustbin analysis" -> Future.successful(ReportPage(List(), List(
"Krona Plot" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map())))
else Nil),
......
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