Commit f4458933 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge branch 'develop' into fix-BIOPET-635

parents 80e8742a 492b52f0
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
...@@ -16,8 +17,13 @@ ...@@ -16,8 +17,13 @@
<%@ var showTable: Boolean = true %> <%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
...@@ -74,12 +80,12 @@ ...@@ -74,12 +80,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %> <%@ var summary: Summary %>
<%@ var rootPath: String %> <%@ var rootPath: String %>
<%@ var sampleId: Option[String] %> <%@ var sampleId: Option[Int] %>
<%@ var libId: Option[String] = None %> <%@ var libId: Option[Int] = None %>
<table class="table"> <table class="table">
<tbody> <tbody>
<tr><th>Pipeline</th><td>BamMetrics</td></tr> <tr><th>Pipeline</th><td>BamMetrics</td></tr>
......
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<%@ var metricsTag: String = "bammetrics" %>
<%@ var fields: List[String] = List("All", "Mapped", "Duplicates", "MAPQ>30", "MateUnmapped", "Mate on other chr")%>
<table>
<tbody>
#for (field <- fields)
<tr><th>${field}</th><td>
#if (libId.isDefined)
${summary.getLibraryValue(sampleId.get, libId.get, metricsTag, "stats", "bamstats", "flagstats", field)}
#else
${summary.getSampleValue(sampleId.get, metricsTag, "stats", "bamstats", "flagstats", field)}
#end
</td></tr>
#end
</tbody>
</table>
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] %>
<%@ var libId: Option[String] = None %>
<%@ var metricsTag: String = "bammetrics" %>
<table class="table sortable-theme-bootstrap">
<thead><tr>
<th>Path</th>
<th>MD5</th>
</tr></thead>
<tbody>
<tr>
<td>${summary.getValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "path")}</td>
<td>${summary.getValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "md5")}</td>
</tr>
</tbody>
</table>
\ No newline at end of file
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport) #import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File) #import(java.io.File)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
...@@ -17,10 +16,14 @@ ...@@ -17,10 +16,14 @@
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%> <%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
<div class="row"> <div class="row">
...@@ -74,12 +77,12 @@ ...@@ -74,12 +77,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
#import(nl.lumc.sasc.biopet.utils.IoUtils) #import(nl.lumc.sasc.biopet.utils.IoUtils)
#import(org.apache.commons.io.FileUtils) #import(org.apache.commons.io.FileUtils)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
...@@ -18,11 +19,14 @@ ...@@ -18,11 +19,14 @@
<%@ var target: Option[String] %> <%@ var target: Option[String] %>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var fields: List[String] = List("mean", "median", "max", "horizontal", "frac_min_10x", "frac_min_20x", "frac_min_30x", "frac_min_40x", "frac_min_50x") %> <%@ var fields: List[String] = List("mean", "median", "max", "horizontal", "frac_min_10x", "frac_min_20x", "frac_min_30x", "frac_min_40x", "frac_min_50x") %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
<table class="table"> <table class="table">
<thead><tr> <thead><tr>
<th>sample</th> <th>sample</th>
...@@ -36,7 +40,7 @@ ...@@ -36,7 +40,7 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport) #import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File) #import(java.io.File)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
...@@ -18,10 +17,14 @@ ...@@ -18,10 +17,14 @@
<%@ var showTable: Boolean = true %> <%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
<div class="row"> <div class="row">
...@@ -76,12 +79,12 @@ ...@@ -76,12 +79,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport) #import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File) #import(java.io.File)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
...@@ -17,11 +16,14 @@ ...@@ -17,11 +16,14 @@
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%> <%@ var fields: List[String] = List("min", "max", "mean", "median", "modal")%>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
<div class="row"> <div class="row">
...@@ -75,12 +77,12 @@ ...@@ -75,12 +77,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
#{ //TODO: Need content }#
Todo
\ No newline at end of file
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport) #import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File) #import(java.io.File)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
...@@ -18,10 +17,14 @@ ...@@ -18,10 +17,14 @@
<%@ var showTable: Boolean = true %> <%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
<div class="row"> <div class="row">
...@@ -66,12 +69,12 @@ ...@@ -66,12 +69,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._) #import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage) #import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport) #import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File) #import(java.io.File)
<%@ var summary: SummaryDb %> <%@ var summary: SummaryDb %>
...@@ -17,10 +16,14 @@ ...@@ -17,10 +16,14 @@
<%@ var showIntro: Boolean = true%> <%@ var showIntro: Boolean = true%>
<%@ var runId: Int %> <%@ var runId: Int %>
<%@ var fields: List[String] = List("mean_coverage", "pct_5x", "pct_10x", "pct_15x", "pct_20x", "pct_25x", "pct_30x", "pct_40x", "pct_50x", "pct_60x", "pct_70x", "pct_80x", "pct_90x", "pct_100x")%> <%@ var fields: List[String] = List("mean_coverage", "pct_5x", "pct_10x", "pct_15x", "pct_20x", "pct_25x", "pct_30x", "pct_40x", "pct_50x", "pct_60x", "pct_70x", "pct_80x", "pct_90x", "pct_100x")%>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{ #{
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf) val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id).toList
case _ => allSamples.toList
}
}# }#
#if (showIntro) #if (showIntro)
<br/> <br/>
<div class="row"> <div class="row">
...@@ -65,12 +68,12 @@ ...@@ -65,12 +68,12 @@
val libs: List[Option[Int]] = (libId, sampleLevel) match { val libs: List[Option[Int]] = (libId, sampleLevel) match {
case (_, true) => List(None) case (_, true) => List(None)
case (Some(_), _) => List(libId) case (Some(_), _) => List(libId)
case _ => Await.result(summary.getLibraries(sampleId = Some(sample.id), runId = Some(runId)), Duration.Inf).map(x => Some(x.id)).toList case _ => allLibraries.filter(_.sampleId == sample.id).map(x => Some(x.id)).toList
} }
}# }#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td> <tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td>
#for (libId <- libs) #for (libId <- libs)
#{ val libName = libId.map(l => Await.result(summary.getLibraryName(l), Duration.Inf)) }# #{ val libName = libId.map(l => allLibraries.find(_.id == l).get.name) }#
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample.name}/Libraries/${libName}/index.html">${libName}</a></td> #end
#{ #{
......
...@@ -48,9 +48,7 @@ object BammetricsReport extends ReportBuilder { ...@@ -48,9 +48,7 @@ object BammetricsReport extends ReportBuilder {
ReportPage(bamMetricsPage.subPages ::: List( ReportPage(bamMetricsPage.subPages ::: List(
"Versions" -> ReportPage(List(), List("Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp" "Versions" -> ReportPage(List(), List("Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
)), Map()), )), Map()),
"Files" -> ReportPage(List(), List( "Files" -> ReportPage(List(), List(), Map())
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bammetricsInputFile.ssp")
), Map())
), List( ), List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bamMetricsFront.ssp") "Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bamMetricsFront.ssp")
) ::: bamMetricsPage.sections, ) ::: bamMetricsPage.sections,
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var rootPath: String %> <%@ var rootPath: String %>
<%@ var sampleId: Option[Int] = None %> <%@ var sampleId: Option[Int] = None %>
<%@ var runId: Int %> <%@ var allLibraries: Seq[Library] %>
<%@ var allSamples: Seq[Sample] %>
<table class="table"> <table class="table">
<thead><tr><th>Libraries</th></tr></thead> <thead><tr><th>Libraries</th></tr></thead>
<tbody> <tbody>
#for (lib <- Await.result(summary.getLibraries(runId = Some(runId)), Duration.Inf)) #{ val libs = sampleId match {
<tr><td><a href="${rootPath}Samples/${Await.result(summary.getSampleName(lib.sampleId), Duration.Inf)}/Libraries/${lib.name}/index.html">${lib}</a></td></tr> case Some(id) => allLibraries.filter(_.sampleId == id)
case _ => allLibraries
} }#
#for (lib <- libs)
#{ val sampleName: String = allSamples.find(_.id == lib.sampleId).get.name }#
<tr><td><a href="${rootPath}Samples/${sampleName}/Libraries/${lib.name}/index.html">${lib}</a></td></tr>
#end #end
</tbody> </tbody>
</table> </table>
\ No newline at end of file
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb) #import(nl.lumc.sasc.biopet.utils.summary.db.Schema._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var rootPath: String %> <%@ var rootPath: String %>
<%@ var runId: Int %> <%@ var allSamples: Seq[Sample] %>
<table class="table sortable-theme-bootstrap" data-sortable> <table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th></tr></thead> <thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th></tr></thead>
<tbody> <tbody>
#for (sample <- Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf)) #for (sample <- allSamples)
<tr><td><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td></tr> <tr><td><a href="${rootPath}Samples/${sample.name}/index.html">${sample.name}</a></td></tr>
#end #end
</tbody> </tbody>
......
...@@ -54,7 +54,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction => ...@@ -54,7 +54,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
} }
writer.println("set -eubf") writer.println("set -eubf")
writer.println("set -o pipefail") writer.println("set -o pipefail")
lines.foreach(writer.println) writer.println(this.commandLine)
jobDelayTime.foreach(x => writer.println(s"sleep $x")) jobDelayTime.foreach(x => writer.println(s"sleep $x"))
writer.close() writer.close()
} }
...@@ -99,6 +99,8 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction => ...@@ -99,6 +99,8 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
beforeGraph() beforeGraph()
internalBeforeGraph() internalBeforeGraph()
this.commandDirectory = this.jobOutputFile.getParentFile
super.freezeFieldValues() super.freezeFieldValues()
} }
......
...@@ -38,17 +38,16 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w ...@@ -38,17 +38,16 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
@Input(doc = "Reference") @Input(doc = "Reference")
var reference: File = _ var reference: File = _
protected def cleverOutputDir: File = new File(cleverWorkDir, "work")
var cleverWorkDir: File = _ var cleverWorkDir: File = _
@Output(doc = "Clever VCF output") @Output(doc = "Clever VCF output")
lazy val outputvcf: File = { lazy val outputvcf: File = {
new File(cleverOutputDir, "predictions.vcf") new File(cleverWorkDir, "predictions.vcf")
} }
@Output(doc = "Clever raw output") @Output(doc = "Clever raw output")
lazy val outputraw: File = { lazy val outputraw: File = {
new File(cleverOutputDir, "predictions.raw.txt") new File(cleverWorkDir, "predictions.raw.txt")
} }
// var T: Option[Int] = config("T", default = defaultThreads) // var T: Option[Int] = config("T", default = defaultThreads)
...@@ -60,13 +59,13 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w ...@@ -60,13 +59,13 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
override def beforeGraph() { override def beforeGraph() {
super.beforeGraph() super.beforeGraph()
if (cleverOutputDir == null) throw new Exception("Clever :: Workdirectory is not defined") if (cleverWorkDir == null) throw new Exception("Clever :: Workdirectory is not defined")
if (reference == null) reference = referenceFasta() if (reference == null) reference = referenceFasta()
} }
def cmdLine = required(executable) + def cmdLine = required(executable) +
" --sorted " + required("--sorted") +
" --use_xa " + required("--use_xa") +
optional("-T", threads) + optional("-T", threads) +
conditional(f, "-f") + conditional(f, "-f") +
conditional(a, "-a") + conditional(a, "-a") +
...@@ -74,7 +73,7 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w ...@@ -74,7 +73,7 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
conditional(r, "-r") + conditional(r, "-r") +
required(input) + required(input) +
required(reference) + required(reference) +
required(cleverOutputDir) required(cleverWorkDir)
}