Skip to content
Snippets Groups Projects
Commit 9e3b5000 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added multisample coverage table

parent c2b02cda
No related branches found
No related tags found
No related merge requests found
#import(nl.lumc.sasc.biopet.utils.IoUtils)
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(org.apache.commons.io.FileUtils)
#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 %>
<%@ var metricsTag: String = "bammetrics" %>
<%@ var target: String %>
#{
val samples = sampleId match {
case Some(sample) => List(sample.toString)
case _ => summary.samples.toList
}
}#
<table class="table">
<thead><tr>
<th>mean</th>
<th>median</th>
<th>max</th>
<th>horizontal</th>
<th>frac min 10x</th>
<th>frac min 20x</th>
<th>frac min 30x</th>
<th>frac min 40x</th>
<th>frac min 50x</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
#{
val prefixPath = List("samples", sample) ::: (if (libId.isEmpty) Nil else List("libraries", libId)) ::: List(metricsTag, "stats", target + "_cov_stats", "coverage", "_all")
val total = summary.getValue((prefixPath ::: List("biopet_flagstat", "All")):_*).getOrElse(0L).asInstanceOf[Long]
val mapped = summary.getValue((prefixPath ::: List("biopet_flagstat", "Mapped")):_*).getOrElse(0L).asInstanceOf[Long]
val duplicates = summary.getValue((prefixPath ::: List("biopet_flagstat", "Duplicates")):_*).getOrElse(0L).asInstanceOf[Long]
}#
<td>${summary.getValue((prefixPath ::: "mean" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "median" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "max" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "horizontal" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "frac_min_10x" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "frac_min_20x" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "frac_min_30x" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "frac_min_40x" :: Nil):_*)}</td>
<td>${summary.getValue((prefixPath ::: "frac_min_50x" :: Nil):_*)}</td>
</tr>
#end
#end
</tbody>
</table>
......@@ -58,7 +58,7 @@ object ShivaReport extends MultisampleReportBuilder {
def createPage(name: String, amplicon: Boolean = false): ReportPage = {
//TODO: get target content
ReportPage(Map(), List(), Map())
ReportPage(Map(), List("Coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsMultiTable.ssp")), Map("target" -> name))
}
amplicon match {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment