sampleVariants.ssp 1.91 KB
Newer Older
1 2
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
3 4
#import(nl.lumc.sasc.biopet.pipelines.shiva.ShivaReport)
#import(java.io.File)
5 6
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
7
<%@ var rootPath: String %>
8 9 10
<%@ var outputDir: File %>
<%@ var showPlot: Boolean = false %>
<%@ var showTable: Boolean = true %>
11
#{
Peter van 't Hof's avatar
Peter van 't Hof committed
12
    val fields = List("Hom", "HomVar", "Het", "HomRef", "NoCall", "Variant", "Total")
13 14 15 16 17 18
    val samples = sampleId match {
        case Some(sample) => List(sample.toString)
        case _ => summary.samples.toList
    }
}#

19 20
#if (showPlot)
    #{ ShivaReport.variantSummaryPlot(outputDir, "variantSummary", summary, sampleId = sampleId) }#
21 22 23 24
    <div class="panel-body">
        <img src="variantSummary.png" class="img-responsive" />
    </div>
    <div class="panel-footer">
Peter van 't Hof's avatar
Peter van 't Hof committed
25
        #if (showTable)
Peter van 't Hof's avatar
Peter van 't Hof committed
26 27
            <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#variantSummaryTable">Hide table</button>
        #else
Peter van 't Hof's avatar
Peter van 't Hof committed
28 29
            <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#variantSummaryTable">Show table</button>
        #end
30 31
        <i class="glyphicon glyphicon-file"></i> <a href="variantSummary.tsv">tsv file</a>
    </div>
32
#end
33

Peter van 't Hof's avatar
Peter van 't Hof committed
34
<div class="panel-body collapse #if (showTable)in#end" id="variantSummaryTable">
35

Peter van 't Hof's avatar
Peter van 't Hof committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
<!-- Table -->
<table class="table sortable-theme-bootstrap" data-sortable>
    <thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th>
        #for (field <- fields) <th>${field}</th> #end
    </tr></thead>
    <tbody>
    #for (sample <- samples.toList.sorted)
    <tr><td><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
        #for (field <- fields)
        <td>${summary.getSampleValue(sample, "shivavariantcalling", "stats", "multisample-vcfstats-final", "genotype", field)}</td>
        #end
    </tr>
    #end
    </tbody>
</table>
</div>