covstatsPlot.ssp 1.66 KB
Newer Older
1
#import(nl.lumc.sasc.biopet.utils.IoUtils)
2
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
3 4 5 6 7 8 9
#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] %>
<%@ var libId: Option[String] = None %>
<%@ var outputDir: File %>
Peter van 't Hof's avatar
Peter van 't Hof committed
10
<%@ var metricsTag: String = "bammetrics" %>
Peter van 't Hof's avatar
Peter van 't Hof committed
11
<%@ var target: Option[String] %>
12
#{
Peter van 't Hof's avatar
Peter van 't Hof committed
13
    val originalPlot = new File(summary.getValue(sampleId, libId, metricsTag, "files", target.get + "_cov_stats", "plot", "path")
14
        .getOrElse(throw new IllegalArgumentException("No plot found in summary")).toString)
Peter van 't Hof's avatar
Peter van 't Hof committed
15
    val plot = new File(outputDir, target.get + "_cov_stats.png")
16

Peter van 't Hof's avatar
Peter van 't Hof committed
17
    val values = summary.getValue(sampleId, libId, metricsTag, "stats", target.get + "_cov_stats", "coverage", "_all")
Peter van 't Hof's avatar
Peter van 't Hof committed
18 19
        .getOrElse(throw new IllegalArgumentException("No plot found in summary")).asInstanceOf[Map[String, Any]]

20
    if (originalPlot.exists()) IoUtils.copyFile(originalPlot, plot)
21 22
}#

Peter van 't Hof's avatar
Peter van 't Hof committed
23
<img src="${plot.getName}">
Peter van 't Hof's avatar
Peter van 't Hof committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

<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>
<tr>
    <td>${values.get("mean")}</td>
    <td>${values.get("median")}</td>
    <td>${values.get("max")}</td>
    <td>${values.get("horizontal")}</td>
    <td>${values.get("frac_min_10x")}</td>
    <td>${values.get("frac_min_20x")}</td>
    <td>${values.get("frac_min_30x")}</td>
    <td>${values.get("frac_min_40x")}</td>
    <td>${values.get("frac_min_50x")}</td>
</tr>
</tbody>
</table>