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

Added bam and vcf files to report of Shiva

parent 6b6ea1fe
......@@ -46,6 +46,14 @@ class Summary(file: File) {
ConfigUtils.getValueFromPath(map, "samples" :: sampleId :: "libraries" :: libId :: path.toList)
}
def getLibraryValue(sampleId: Option[String], libId: Option[String], path: String*): Option[Any] = {
(sampleId, libId) match {
case (Some(sample), Some(lib)) => getLibraryValue(sample, lib, path: _*)
case (Some(sample), _) => getSampleValue(sample, path: _*)
case _ => getValue(path: _*)
}
}
def getLibraryValues(path: String*): Map[(String, String), Option[Any]] = {
(for (sample <- samples; lib <- libraries.getOrElse(sample, Set())) yield {
(sample, lib) -> getLibraryValue(sample, lib, path: _*)
......
#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 = false %>
<%@ 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, "mapping", "files", "pipeline", "output_bamfile", "path")}</td>
<td>${summary.getLibraryValue(sample, libId, "mapping", "files", "pipeline", "output_bamfile", "md5")}</td>
</tr>
#end
#end
</tbody>
</table>
</div>
#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>
#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 variantCallers = summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "settings", "variantcallers").get.asInstanceOf[List[String]]
}#
<div class="panel-body">
<!-- Table -->
<table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr>
<th>Variantcaller</th>
<th>Path</th>
<th>MD5</th>
</tr></thead>
<tbody>
#if (variantCallers.size > 1)
<tr>
<td>Final (merged)</td>
<td>${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>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
</tr>
#end
</tbody>
</table>
</div>
......@@ -36,10 +36,7 @@ object ShivaReport extends MultisampleReportBuilder {
Map("showPlot" -> true, "showTable" -> true))
), Map()),
"Samples" -> generateSamplesPage(pageArgs),
"Files" -> 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")
), Map()),
"Files" -> filesPage,
"Versions" -> ReportPage(Map(), List(), Map())
),
List(
......@@ -60,10 +57,19 @@ 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"),
"VCF files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/outputVcfFiles.ssp", Map("sampleId" -> None))
), Map())
def samplePage(sampleId: String, args: Map[String, Any]) = {
ReportPage(Map(
"Libraries" -> generateLibraryPage(args),
"Alignment" -> BammetricsReport.bamMetricsPage
"Alignment" -> BammetricsReport.bamMetricsPage,
"Files" -> filesPage
), List(
"Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",
if (summary.libraries(sampleId).size > 1) Map("showPlot" -> true) else Map()),
......
......@@ -72,7 +72,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
/** Sample specific files to add to summary */
def summaryFiles: Map[String, File] = {
preProcessBam match {
case Some(preProcessBam) => Map("bamFile" -> preProcessBam)
case Some(preProcessBam) => Map("preProcessBam" -> preProcessBam)
case _ => 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