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

Fixing capture of failures

parent 916fe0d4
......@@ -224,10 +224,11 @@ trait ReportBuilder extends ToolCommand {
def wait(futures: List[Future[Any]]): Unit = {
try {
Await.ready(Future.sequence(futures), Duration.fromNanos(30000000000L))
Await.result(Future.sequence(futures), Duration.fromNanos(30000000000L))
} catch {
case e: TimeoutException =>
}
val dones = futures.filter(_.isCompleted)
val notDone = futures.filter(!_.isCompleted)
done += futures.size - notDone.size
if (notDone.nonEmpty) {
......@@ -236,8 +237,11 @@ trait ReportBuilder extends ToolCommand {
}
}
//jobsFutures.foreach(f => f.onFailure{ case e => throw new RuntimeException(e) })
wait(jobsFutures)
Await.ready(baseFilesFuture, Duration.Inf)
Await.result(Future.sequence(jobsFutures), Duration.Inf)
Await.result(baseFilesFuture, Duration.Inf)
logger.info(s"Done, $done pages generated")
}
......@@ -262,7 +266,7 @@ trait ReportBuilder extends ToolCommand {
pageFuture: Future[ReportPage],
outputDir: File,
path: List[String] = Nil,
args: Map[String, Any] = Map()): List[Future[_]] = {
args: Map[String, Any] = Map()): List[Future[ReportPage]] = {
val pageOutputDir = new File(outputDir, path.mkString(File.separator))
def pageArgs(page: ReportPage) = {
......@@ -301,6 +305,7 @@ trait ReportBuilder extends ToolCommand {
writer.close()
logger.info(s"Done rendering: $file")
page
}
renderFuture :: Await.result(subPageJobs, Duration.Inf)
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
<%@ var run: Run %>
<%@ var allSamples: List[Sample] %>
<%@ var allSamples: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Carp</td></tr>
......
......@@ -19,8 +19,8 @@
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>
<%@ var multisample: Boolean = true %>
<%@ var allSamples: List[Sample] %>
<%@ var allLibraries: List[Library] %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{
val samples = sampleId.map(id => allSamples.filter(_.id == id)).getOrElse(allSamples)
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
......
......@@ -4,8 +4,8 @@
<%@ var sampleId: Option[Int] %>
<%@ var libId: Option[Int] %>
<%@ var run: Run %>
<%@ var allSamples: List[Sample] %>
<%@ var allLibraries: List[Library] %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Flexiprep</td></tr>
......
......@@ -18,8 +18,8 @@
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>
<%@ var multisample: Boolean = true %>
<%@ var allSamples: List[Sample] %>
<%@ var allLibraries: List[Library] %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{
val samples = sampleId.map(id => allSamples.filter(_.id == id)).getOrElse(allSamples)
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
<%@ var run: Run %>
<%@ var allSamples: List[Sample] %>
<%@ var allSamples: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Gears</td></tr>
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
<%@ var run: Run %>
<%@ var allSamples: List[Sample] %>
<%@ var allSamples: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Gentrap</td></tr>
......
......@@ -5,8 +5,6 @@
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var rootPath: String %>
<%@ var runId: Int %>
......
......@@ -11,7 +11,7 @@
<%@ var pipeline: String %>
<%@ var runId: Int %>
<%@ var run: Run %>
<%@ var allSamples: List[Sample] %>
<%@ var allSamples: Seq[Sample] %>
#{
val samples = allSamples
val settings = summary.getSettingKeys(runId, pipeline,
......
......@@ -19,7 +19,7 @@
<%@ var target: Option[String] = None %>
<%@ var caller: String = "final" %>
<%@ var runId: Int %>
<%@ var allSamples: List[Sample] %>
<%@ var allSamples: Seq[Sample] %>
#{
val fields = List("Hom", "HomVar", "Het", "HomRef", "NoCall", "Variant", "Total")
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
......@@ -8,8 +9,8 @@
<%@ var summary: SummaryDb %>
<%@ var runId: Int %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
#{
val samples = Await.result(summary.getSamples(Some(runId)), Duration.Inf)
val settings = summary.getSettingKeys(runId, run.name,
keyValues = Map(
"contigs" -> List("reference", "contigs"),
......@@ -33,7 +34,7 @@
<td>${settings.get("variantcallers")}</td>
</tr>
<tr><th>Reference</th><td>${settings.get("species")} - ${settings.get("name")}</td></tr>
<tr><th>Number of samples</th><td>${samples.size}</td></tr>
<tr><th>Number of samples</th><td>${allSamples.size}</td></tr>
<tr><th>Annotation</th><td>${settings.get("annotation")}</td></tr>
<tr><th>Multisample variantcalling</th><td>${settings.get("multisample_variantcalling")}</td></tr>
<tr><th>Sv calling</th><td>${settings.get("sv_calling")}</td></tr>
......
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