Commit 6d343c05 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Remove output folder when it's in the summary file

parent ee15cd5e
......@@ -11,8 +11,15 @@
<%@ var showTable: Boolean = true %>
#{
val samples = sampleId match {
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
}
val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a =>
if (a.toString.startsWith(pipelineOutputDir) && pipelineOutputDir.nonEmpty) "./" + a.toString.stripPrefix(pipelineOutputDir)
else a
}
}
}#
......@@ -46,7 +53,7 @@
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
<td>${read}</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "input_" + read, "path")}</td>
<td>${removeDir(summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "input_" + read, "path"))}</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "input_" + read, "md5")}</td>
#end
</tr>
......
......@@ -11,8 +11,15 @@
<%@ var showTable: Boolean = true %>
#{
val samples = sampleId match {
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
}
val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a =>
if (a.toString.startsWith(pipelineOutputDir) && pipelineOutputDir.nonEmpty) "./" + a.toString.stripPrefix(pipelineOutputDir)
else a
}
}
}#
......@@ -46,7 +53,7 @@
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
<td>${read}</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "output_" + read, "path")}</td>
<td>${removeDir(summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "output_" + read, "path"))}</td>
<td>${summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "output_" + read, "md5")}</td>
#end
</tr>
......
......@@ -5,15 +5,24 @@
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var sampleLevel: Boolean = false %>
<%@ var sampleLevel: Boolean = true %>
<%@ var rootPath: String %>
<%@ var outputDir: File %>
<%@ var pipelineName: String = "mapping" %>
<%@ var fileTag: String = "output_bamfile" %>
#{
val samples = sampleId match {
case Some(sample) => {
List(sample.toString)
case Some(sample) => {
List(sample.toString)
}
case _ => summary.samples.toList
}
case _ => summary.samples.toList
val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a =>
if (a.toString.startsWith(pipelineOutputDir) && pipelineOutputDir.nonEmpty) "./" + a.toString.stripPrefix(pipelineOutputDir)
else a
}
}
}#
......@@ -39,8 +48,8 @@
#for (libId <- libs)
#if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample}/Libraries/${libId}/index.html">${libId}</a></td> #end
<td>${summary.getLibraryValue(sample, libId, "mapping", "files", "pipeline", "output_bamfile", "path")}</td>
<td>${summary.getLibraryValue(sample, libId, "mapping", "files", "pipeline", "output_bamfile", "md5")}</td>
<td>${removeDir(summary.getLibraryValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "path"))}</td>
<td>${summary.getLibraryValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "md5")}</td>
</tr>
#end
#end
......
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var sampleLevel: Boolean = true %>
<%@ var rootPath: String %>
<%@ var outputDir: File %>
#{
val samples = sampleId match {
case Some(sample) => {
List(sample.toString)
}
case _ => summary.samples.toList
}
}#
<div class="panel-body">
<!-- Table -->
<table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr>
<th data-sorted="true" data-sorted-direction="ascending">Sample</th>
#if (!sampleLevel) <th>Library</th> #end
<th>Path</th>
<th>MD5</th>
</tr></thead>
<tbody>
#for (sample <- samples.toList.sorted)
#{
val libs = (libId, sampleLevel) match {
case (_, true) => List("")
case (Some(libId), _) => List(libId.toString)
case _ => summary.libraries(sample).toList
}
}#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
#for (libId <- libs)
#if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample}/Libraries/${libId}/index.html">${libId}</a></td> #end
<td>${summary.getLibraryValue(sample, libId, "shiva", "files", "pipeline", "preProcessBam", "path")}</td>
<td>${summary.getLibraryValue(sample, libId, "shiva", "files", "pipeline", "preProcessBam", "md5")}</td>
</tr>
#end
#end
</tbody>
</table>
</div>
......@@ -10,6 +10,13 @@
<%@ var outputDir: File %>
#{
val variantCallers = summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "settings", "variantcallers").get.asInstanceOf[List[String]]
val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a =>
if (a.toString.startsWith(pipelineOutputDir) && pipelineOutputDir.nonEmpty) "./" + a.toString.stripPrefix(pipelineOutputDir)
else a
}
}
}#
<div class="panel-body">
......@@ -24,14 +31,14 @@
#if (variantCallers.size > 1)
<tr>
<td>Final (merged)</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path")}</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td>
</tr>
#end
#for (variantCaller <- variantCallers)
<tr>
<td>${variantCaller}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path")}</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
</tr>
#end
......
......@@ -48,8 +48,9 @@ object ShivaReport extends MultisampleReportBuilder {
def filesPage = ReportPage(Map(), List(
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepInputfiles.ssp"),
"After QC fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepOutputfiles.ssp"),
"Bam files per lib" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp"),
"Preprocessed bam files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputBamfiles.ssp"),
"Bam files per lib" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp", Map("sampleLevel" -> false)),
"Preprocessed bam files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp",
Map("pipelineName" -> "shiva", "fileTag" -> "preProcessBam")),
"VCF files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputVcfFiles.ssp", Map("sampleId" -> None))
), Map())
......
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