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