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

Merge branch 'develop' into Fix-BIOPET-653

parents c347da53 811fe4c2
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var rootPath: String %>
<%@ var sampleId: Option[Int] %>
#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.Schema.Library)
<%@ var runId: Int %>
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>BamMetrics</td></tr>
<tr><th>Version</th><td>${summary.getValue("meta", "pipeline_version")}</td></tr>
<tr><th>Last commit hash</th><td>${summary.getValue("meta", "last_commit_hash")}</td></tr>
<tr><th>Output directory</th><td>${summary.getValue("meta", "output_dir")}</td></tr>
<tr><th>Sample ID</th><td>${sampleId}</td></tr>
#if (libId.isDefined) <tr><th>Library ID</th><td>${libId}</td></tr> #end
<tr><th>Pipeline</th><td>GearsSingle</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Sample</th><td>${allSamples.filter(_.id == sampleId.get).headOption.map(_.name)}</td></tr>
<tr><th>Library</th><td>${allLibraries.filter(_.id == libId.get).headOption.map(_.name)}</td></tr>
</tbody>
</table>
<br/>
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.core.report
import java.io._
import nl.lumc.sasc.biopet.core.ToolCommandFunction
import nl.lumc.sasc.biopet.utils.summary.db.Schema.{ Library, Module, Pipeline, Sample }
import nl.lumc.sasc.biopet.utils.summary.db.Schema.{ Library, Module, Pipeline, Sample, Run }
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.{ LibraryId, SampleId }
import nl.lumc.sasc.biopet.utils.{ IoUtils, Logging, ToolCommand }
......@@ -40,7 +40,7 @@ trait ReportBuilderExtension extends ToolCommandFunction {
/** Report builder object */
def builder: ReportBuilder
def toolObject = builder
def toolObject: ReportBuilder = builder
@Input(required = true)
var summaryDbFile: File = _
......@@ -114,20 +114,24 @@ trait ReportBuilder extends ToolCommand {
private var setSummary: SummaryDb = _
/** Retrival of summary, read only */
final def summary = setSummary
final def summary: SummaryDb = setSummary
private var setRunId: Int = 0
final def runId = setRunId
final def runId: Int = setRunId
private var _setRun: Run = _
final def run: Run = _setRun
private var _setPipelines = Seq[Pipeline]()
final def pipelines = _setPipelines
final def pipelines: Seq[Pipeline] = _setPipelines
private var _setModules = Seq[Module]()
final def modules = _setModules
final def modules: Seq[Module] = _setModules
private var _setSamples = Seq[Sample]()
final def samples = _setSamples
final def samples: Seq[Sample] = _setSamples
private var _setLibraries = Seq[Library]()
final def libraries = _setLibraries
final def libraries: Seq[Library] = _setLibraries
/** default args that are passed to all page withing the report */
def pageArgs: Map[String, Any] = Map()
......@@ -136,13 +140,13 @@ trait ReportBuilder extends ToolCommand {
private var total = 0
private var _sampleId: Option[Int] = None
protected[report] def sampleId = _sampleId
protected[report] def sampleId: Option[Int] = _sampleId
private var _libId: Option[Int] = None
protected[report] def libId = _libId
protected[report] def libId: Option[Int] = _libId
case class ExtFile(resourcePath: String, targetPath: String)
def extFiles = List(
def extFiles: List[ExtFile] = List(
"css/bootstrap_dashboard.css",
"css/bootstrap.min.css",
"css/bootstrap-theme.min.css",
......@@ -183,6 +187,7 @@ trait ReportBuilder extends ToolCommand {
case _ =>
}
_setRun = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
_setPipelines = Await.result(summary.getPipelines(runId = Some(runId)), Duration.Inf)
_setModules = Await.result(summary.getModules(runId = Some(runId)), Duration.Inf)
_setSamples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf)
......@@ -219,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) {
......@@ -231,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")
}
......@@ -257,13 +266,14 @@ 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) = {
val rootPath = "./" + Array.fill(path.size)("../").mkString
args ++ page.args ++
Map("page" -> page,
"run" -> run,
"path" -> path,
"outputDir" -> pageOutputDir,
"rootPath" -> rootPath,
......@@ -295,6 +305,7 @@ trait ReportBuilder extends ToolCommand {
writer.close()
logger.info(s"Done rendering: $file")
page
}
renderFuture :: Await.result(subPageJobs, Duration.Inf)
......
......@@ -38,6 +38,8 @@ class CleverFixVCF(val parent: Configurable) extends BiopetJavaCommandLineFuncti
@Argument(doc = "Samplename")
var sampleName: String = _
override def defaultCoreMemory = 4.0
override def cmdLine = super.cmdLine +
required("-i", input) +
required("-o", output) +
......@@ -112,6 +114,7 @@ object CleverFixVCF extends ToolCommand {
##INFO=<ID=DPADJ,Number=.,Type=Integer,Description="Read Depth of adjacency">
##INFO=<ID=CN,Number=1,Type=Integer,Description="Copy number of segment containing breakend">
##INFO=<ID=CNADJ,Number=.,Type=Integer,Description="Copy number of adjacency">
##INFO=<ID=ESUPPORT,Number=1,Type=Float,Description="Support of event, see into clever python script for more: scripts/postprocess-predictions">
##INFO=<ID=CICN,Number=2,Type=Integer,Description="Confidence interval around copy number for the segment">
##INFO=<ID=CICNADJ,Number=.,Type=Integer,Description="Confidence interval around copy number for the adjacency">
##FORMAT=<ID=CN,Number=1,Type=Integer,Description="Copy number genotype for imprecise events">
......
......@@ -28,6 +28,7 @@
##INFO=<ID=DPADJ,Number=.,Type=Integer,Description="Read Depth of adjacency">
##INFO=<ID=CN,Number=1,Type=Integer,Description="Copy number of segment containing breakend">
##INFO=<ID=CNADJ,Number=.,Type=Integer,Description="Copy number of adjacency">
##INFO=<ID=ESUPPORT,Number=1,Type=Float,Description="Support of event, see into clever python script for more: scripts/postprocess-predictions">
##INFO=<ID=CICN,Number=2,Type=Integer,Description="Confidence interval around copy number for the segment">
##INFO=<ID=CICNADJ,Number=.,Type=Integer,Description="Confidence interval around copy number for the adjacency">
##FORMAT=<ID=CN,Number=1,Type=Integer,Description="Copy number genotype for imprecise events">
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var runId: Int %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
}#
#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: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Carp</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Number of samples</th><td>${allSamples.size}</td></tr>
</tbody>
</table>
<br/>
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Library)
#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)
......@@ -17,9 +19,11 @@
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>
<%@ var multisample: Boolean = true %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{
val samples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf)
val libraries = Await.result(summary.getLibraries(runId = Some(runId), sampleId = sampleId), Duration.Inf)
val samples = sampleId.map(id => allSamples.filter(_.id == id)).getOrElse(allSamples)
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
val settings = summary.getSettingsForLibraries(runId, "flexiprep", keyValues = Map(
"skip_trim" -> List("skip_trim"), "skip_clip" -> List("skip_clip"), "paired" -> List("paired")))
settings.count(_._2.getOrElse("skip_trim", None) == Some(true))
......
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Run)
#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._)
......@@ -10,6 +11,7 @@
#import(nl.lumc.sasc.biopet.core.report.ReportBuilder.ec)
<%@ var summary: SummaryDb %>
<%@ var runId: Int %>
<%@ var run: Run %>
<%@ var sampleId: Option[Int] %>
<%@ var libId: Option[Int] %>
<%@ var plot: String %>
......
#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.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var rootPath: String %>
<%@ var runId: Int %>
#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.Schema.Library)
<%@ var sampleId: Option[Int] %>
<%@ var libId: Option[Int] %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
}#
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Flexiprep</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Sample ID</th><td>${Await.result(summary.getSampleName(sampleId.get), Duration.Inf)}</td></tr>
<tr><th>Library ID</th><td>${Await.result(summary.getLibraryName(libId.get), Duration.Inf)}</td></tr>
<tr><th>Sample ID</th><td>${allSamples.filter(_.id == sampleId.get).headOption.map(_.name)}</td></tr>
<tr><th>Library ID</th><td>${allLibraries.filter(_.id == libId.get).headOption.map(_.name)}</td></tr>
</tbody>
</table>
<br/>
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Library)
#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)
......@@ -16,9 +18,11 @@
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>
<%@ var multisample: Boolean = true %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{
val samples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf)
val libraries = Await.result(summary.getLibraries(runId = Some(runId), sampleId = sampleId), Duration.Inf)
val samples = sampleId.map(id => allSamples.filter(_.id == id)).getOrElse(allSamples)
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
val settings = summary.getSettingsForLibraries(runId, "flexiprep", keyValues = Map(
"skip_trim" -> List("skip_trim"), "skip_clip" -> List("skip_clip"), "paired" -> List("paired")))
settings.count(_._2.getOrElse("skip_trim", None) == Some(true))
......
......@@ -206,7 +206,9 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
val foundAdapters = modules.get("Adapter Content").map { x =>
val header = x.lines.head.split("\t").tail.zipWithIndex
val lines = x.lines.tail.map(_.split("\t").tail)
val found = header.filter(h => lines.exists(x => x(h._2).toFloat > 0)).map(_._1)
val found = header
.filter(h => lines.exists(x => x(h._2).toFloat > adapterCutoff))
.map(_._1)
adapterSet.filter(x => found.contains(x.name))
}
......@@ -214,6 +216,8 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
} else Set()
}
val adapterCutoff: Float = config("adapter_cutoff", default = 0.001)
@Output
private var outputFiles: List[File] = Nil
......
#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.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var runId: Int %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
val samples = Await.result(summary.getSamples(Some(runId)), 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: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Gears</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Number of samples</th><td>${samples.size}</td></tr>
<tr><th>Number of samples</th><td>${allSamples.size}</td></tr>
</tbody>
</table>
<br/>
......
#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.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: 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.Schema.Library)
<%@ var runId: Int %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
}#
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>GearsSingle</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
#if(sampleId.isDefined) <tr><th>Sample</th><td>${sampleId}</td></tr> #end
#if(libId.isDefined) <tr><th>Library</th><td>${libId}</td></tr> #end
<tr><th>Sample</th><td>${allSamples.filter(_.id == sampleId.get).headOption.map(_.name)}</td></tr>
<tr><th>Library</th><td>${allLibraries.filter(_.id == libId.get).headOption.map(_.name)}</td></tr>
</tbody>
</table>
<br/>
......
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(nl.lumc.sasc.biopet.utils.ConfigUtils)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<%@ var showPlot: Boolean = true %>
<%@ var showIntro: Boolean = true %>
#{
val samples = sampleId match {
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
}
val librariesCount = summary.samples.foldLeft(0)(_ + summary.libraries(_).size)
}#
#if (showIntro)
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
Here we show a sunburst visualisation of the analysis of the metagenome in sample: ${sampleId}
</div>
<div class="col-md-1"></div>
</div>
#end
#if (showPlot)
<div class="row">
<div class="col-md-12">
<h3 id='currentlevel'>Root</h3>
<div>
<span id="selection_name"></span> -
<span id="selection_size"></span> -
<span id="selection_value"></span>
</div>
<form>
<label><input type="radio" name="mode" value="size"> Size</label>
<label><input type="radio" name="mode" value="count" checked> Count</label>
</form>
<div id="sequence"></div>
<div id="datatable"></div>
<div id="svgholder"></div>
</div>
<script src="${rootPath}ext/js/gears.js"></script>
<script type="application/ecmascript">
#{
val rawreport = Map("kraken" -> summary.getValue(sampleId, libId, "gearskraken", "stats", "krakenreport"))
val jsonReport = ConfigUtils.mapToJson(rawreport)
}#
var krakenresult = ${unescape(jsonReport)};
loadGears(krakenresult.kraken.classified);
</script>
</div>
#end
......@@ -13,7 +13,6 @@
<%@ var centrifugeTag: Option[String] = None %>
<%@ var summaryStatsTag: String = "krakenreport" %>
<%@ var summaryModuleTag: String = "gearskraken" %>
<%
val summaries = if (sampleId.isEmpty) {
summary.getSampleValues(summaryModuleTag, "stats", summaryStatsTag).map(x => x._1 -> x._2.get.asInstanceOf[Map[String, Any]])
......
......@@ -5,7 +5,6 @@
<%@ var biomFile: File %>
<%@ var args: Map[String, Any] %>
<%@ var outputDir: File %>
<%
val tempFile = File.createTempFile("krona.", ".xml")
tempFile.deleteOnExit()
......@@ -20,5 +19,4 @@
writer.println(output)
writer.close()
%>
<iframe src="kraken_krona.html" style="width:100%;height:80vh;border:none;"></iframe>
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
<%@ var summary: Summary %>
#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: Seq[Sample] %>
<table class="table">
<tbody>
<tr><th>Pipeline</th><td>Gentrap</td></tr>
<tr><th>Version</th><td>${summary.getValue("meta", "pipeline_version")}</td></tr>
<tr><th>Last commit hash</th><td>${summary.getValue("meta", "last_commit_hash")}</td></tr>
<tr><th>Output directory</th><td>${summary.getValue("meta", "output_dir")}</td></tr>
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Number of samples</th><td>${allSamples.size}</td></tr>
</tbody>
</table>
<br/>
......
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(org.apache.commons.io.FileUtils)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var outputDir: File %>
<%@ var pipelineName: String %>
<%@ var plotPath: Option[Any] %>
......
#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.Schema.Library)
#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 %>
<%@ var sampleId: Option[Int] %>
<%@ var libId: Option[Int] %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
val settings = summary.getSettingKeys(runId, run.name,
keyValues = Map(
"contigs" -> List("reference", "contigs"),
......@@ -25,8 +28,8 @@
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Reference</th><td>${settings.get("species")} - ${settings.get("name")}</td></tr>
<tr><th>Sample</th><td>${Await.result(summary.getSampleName(sampleId.get), Duration.Inf)}</td></tr>
<tr><th>Library</th><td>${Await.result(summary.getLibraryName(libId.get), Duration.Inf)}</td></tr>
<tr><th>Sample</th><td>${allSamples.filter(_.id == sampleId.get).headOption.map(_.name)}</td></tr>
<tr><th>Library</th><td>${allLibraries.filter(_.id == libId.get).headOption.map(_.name)}</td></tr>
</tbody>
</table>
<br/>
......
#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,9 +10,10 @@
<%@ var rootPath: String %>
<%@ var pipeline: String %>
<%@ var runId: Int %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
val samples = Await.result(summary.getSamples(runId = Some(runId)), Duration.Inf)
val samples = allSamples
val settings = summary.getSettingKeys(runId, pipeline,
keyValues = Map(
"contigs" -> List("reference", "contigs"),
......
......@@ -42,9 +42,6 @@ object MappingReport extends ReportBuilder {
override def extFiles = super.extFiles ++ List("js/gears.js", "js/krona-2.0.js", "img/krona/loading.gif", "img/krona/hidden.png", "img/krona/favicon.ico")
.map(x => ExtFile("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + x, x))
def krakenExecuted: Boolean = Await.result(summary.getStatsSize(runId, "gears", "krakenreport",
sample = sampleId.map(SampleId), library = libId.map(LibraryId)), Duration.Inf) >= 1
/** Root page for single BamMetrcis report */
def indexPage: Future[ReportPage] = Future {
val mappingSettings = summary.getSettingKeys(runId, "mapping", NoModule,
......@@ -55,11 +52,7 @@ object MappingReport extends ReportBuilder {
Some(BammetricsReport.bamMetricsPage(summary, sampleId, libId))
} else None
ReportPage((if (skipFlexiprep) Nil else List("QC" -> FlexiprepReport.flexiprepPage)) :::
bamMetricsPage.map(_.subPages).getOrElse(Nil) :::
(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(
bamMetricsPage.map(_.subPages).getOrElse(Nil), List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/mappingFront.ssp")
) ::: bamMetricsPage.map(_.sections).getOrElse(Nil),
Map()
......
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#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)
......@@ -18,10 +19,14 @@
<%@ var target: Option[String] = None %>
<%@ var caller: String = "final" %>
<%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
#{
val fields = List("Hom", "HomVar", "Het", "HomRef", "NoCall", "Variant", "Total")
val samples = Await.result(summary.getSamples(runId = Some(runId), sampleId = sampleId), Duration.Inf)
val samples = sampleId match {
case Some(id) => allSamples.filter(_.id == id)
case _ => allSamples
}
val vcfstatsKey = target match {
case Some(t) => s"multisample-vcfstats-$caller-$t"
case _ => s"multisample-vcfstats-$caller"
......
#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)
......@@ -6,9 +8,9 @@
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var runId: Int %>
<%@ var run: Run %>
<%@ var allSamples: Seq[Sample] %>
#{
val run = Await.result(summary.getRuns(runId = Some(runId)), Duration.Inf).head
val samples = Await.result(summary.getSamples(Some(runId)), Duration.Inf)
val settings = summary.getSettingKeys(runId, run.name,
keyValues = Map(
"contigs" -> List("reference", "contigs"),
......@@ -32,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>
......
......@@ -22,7 +22,7 @@ import nl.lumc.sasc.biopet.extensions.gatk._
import nl.lumc.sasc.biopet.extensions.tools.ValidateVcf
import nl.lumc.sasc.biopet.pipelines.bammetrics.TargetRegions
import nl.lumc.sasc.biopet.pipelines.kopisu.Kopisu
import nl.lumc.sasc.biopet.pipelines.mapping.MultisampleMappingTrait
import nl.lumc.sasc.biopet.pipelines.mapping.{ Mapping, MultisampleMappingTrait }
import nl.lumc.sasc.biopet.pipelines.toucan.Toucan
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
......@@ -77,13 +77,13 @@ class Shiva(val parent: Configurable) extends QScript with MultisampleMappingTra
override def makeLibrary(id: String) = new this.Library(id)
/** Sample specific settings */
override def summarySettings = super.summarySettings ++
override def summarySettings: Map[String, Any] = super.summarySettings ++
Map("single_sample_variantcalling" -> variantcalling.isDefined, "use_indel_realigner" -> useIndelRealigner)
/** Class to generate jobs for a library */
class Library(libId: String) extends super.Library(libId) {
override def summaryFiles = super.summaryFiles ++
override def summaryFiles: Map[String, File] = super.summaryFiles ++
variantcalling.map("final" -> _.finalFile) ++
bqsrFile.map("baserecal" -> _) ++
bqsrAfterFile.map("baserecal_after" -> _)
......@@ -101,31 +101,31 @@ class Shiva(val parent: Configurable) extends QScript with MultisampleMappingTra
lazy val bqsrFile: Option[File] = if (useBaseRecalibration) Some(createFile("baserecal")) else None
lazy val bqsrAfterFile: Option[File] = if (useAnalyzeCovariates) Some(createFile("baserecal.after")) else None
override def keepFinalBamfile = super.keepFinalBamfile && !useIndelRealigner && !useBaseRecalibration
override def keepFinalBamfile: Boolean = super.keepFinalBamfile && !useIndelRealigner && !useBaseRecalibration
override def bamFile = mapping.map(_.mergedBamFile)
override def bamFile: Option[Mapping#File] = mapping.map(_.mergedBamFile)
override def preProcessBam = if (useIndelRealigner && usePrintReads)
override def preProcessBam: Option[Mapping#File] = if (useIndelRealigner && usePrintReads && useBaseRecalibration)
bamFile.map(swapExt(libDir, _, ".bam", ".realign.baserecal.bam"))
else if (useIndelRealigner) bamFile.map(swapExt(libDir, _, ".bam", ".realign.bam"))
else if (usePrintReads) bamFile.map(swapExt(libDir, _, ".bam", ".baserecal.bam"))
else if (usePrintReads && useBaseRecalibration) bamFile.map(swapExt(libDir, _, ".bam", ".baserecal.bam"))
else bamFile
/** Library specific settings */
override def summarySettings = super.summarySettings ++ Map(
override def summarySettings: Map[String, Any] = super.summarySettings ++ Map(
"library_variantcalling" -> variantcalling.isDefined,
"use_indel_realigner" -> useIndelRealigner,
"use_base_recalibration" -> useBaseRecalibration,
"useAnalyze_covariates" -> useAnalyzeCovariates
)
lazy val variantcalling = if (config("library_variantcalling", default = false).asBoolean &&
lazy val variantcalling: Option[ShivaVariantcalling with QScript] = if (config("library_variantcalling", default = false).asBoolean &&
(bamFile.isDefined || preProcessBam.isDefined)) {
Some(makeVariantcalling(multisample = false, sample = Some(sampleId), library = Some(libId)))
} else None
/** This will add jobs for this library */
override def addJobs() = {
override def addJobs(): Unit = {
super.addJobs()