Commit 78c40fad authored by akaljuvee's avatar akaljuvee

vcf-files from sv detection tools are now also shown on the files page in Biopet's report

parent 2299e7a9
......@@ -10,13 +10,6 @@
<%@ var outputDir: File %>
#{
val variantCallers = summary.getValue(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 + File.separator)
else a
}
}
}#
<div class="panel-body">
......@@ -31,15 +24,15 @@
#if (variantCallers.size > 1)
<tr>
<td>Final (merged)</td>
<td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${ShivaReport.formatVcfFilePath(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td>
</tr>
#end
#for (variantCaller <- variantCallers)
<tr>
<td>${variantCaller}</td>
<td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
<td>${ShivaReport.formatVcfFilePath(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${ShivaReport.formatVcfFilePath(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5"))}</td>
</tr>
#end
</tbody>
......
#import(nl.lumc.sasc.biopet.pipelines.shiva.ShivaReport)
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<div class="panel-body">
<!-- Table -->
<table class="table">
<thead><tr>
<th>Sample</th>
<th>Path</th>
<th>MD5</th>
</tr></thead>
<tbody>
#if (summary.samples.size > 1)
<tr>
<td>Merged</td>
<td>${ShivaReport.formatVcfFilePath(summary.getValue(sampleId, libId, "shivasvcalling", "files", "pipeline", "final_mergedvcf", "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivasvcalling", "files", "pipeline", "final_mergedvcf", "md5")}</td>
</tr>
#end
#for (sampleName <- summary.samples)
<tr>
<tr>
<td><a href="${rootPath}Samples/${sampleName}/index.html">${sampleName}</a></td>
<td>${ShivaReport.formatVcfFilePath(summary.getValue(sampleId, libId, "shivasvcalling", "files", "pipeline", sampleName, "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivasvcalling", "files", "pipeline", sampleName, "md5")}</td>
</tr>
#end
</tbody>
</table>
</div>
......@@ -42,6 +42,11 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
case _ => false
}
def svCallingExecuted = summary.getValue("shiva", "settings", "sv_calling") match {
case Some(true) => true
case _ => false
}
override def frontSection = ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/shivaFront.ssp")
override def pipelineName = "shiva"
......@@ -100,11 +105,15 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
/** Files page, can be used general or at sample level */
override def filesPage: ReportPage = {
val vcfFilesSection = if (variantcallingExecuted) List("VCF files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputVcfFiles.ssp",
Map("sampleId" -> None)))
else Nil
val oldPage = super.filesPage
oldPage.copy(sections = oldPage.sections ++ vcfFilesSection)
if (!variantcallingExecuted && !svCallingExecuted) super.filesPage
else {
var sections: List[(String, ReportSection)] = List()
if (variantcallingExecuted) sections = sections :+ ("Result files from SNV calling", ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputVcfFiles.ssp", Map("sampleId" -> None)))
if (svCallingExecuted) sections = sections :+ ("Result files from SV calling", ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputVcfFilesSv.ssp"))
val oldPage = super.filesPage
oldPage.copy(sections = oldPage.sections ++ sections)
}
}
/** Single sample page */
......@@ -181,4 +190,10 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
} else plot.width = Some(200 + (summary.samples.count(s => sampleId.getOrElse(s) == s) * 10))
plot.runLocal()
}
def formatVcfFilePath(vcfFilePath: Option[Any]): Any = {
val prefix = summary.getValue("meta", "output_dir").getOrElse("").toString
vcfFilePath.collect { case a => "./" + a.toString.stripPrefix(prefix + File.separator) }
}
}
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