sampleVariants.ssp 1.84 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 12 13 14 15 16 17 18
#{
    val fields = List("Hom", "HomVar", "HomRef", "NoCall", "Variant", "NonInformative", "Total")
    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 26 27
        #if (showTable)
            <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#variantSummaryTable">Show table</button>
        #end
28 29
        <i class="glyphicon glyphicon-file"></i> <a href="variantSummary.tsv">tsv file</a>
    </div>
30 31
#end
#if (showTable)
Peter van 't Hof's avatar
Peter van 't Hof committed
32
    <div class="panel-body collapse" id="variantSummaryTable">
33 34 35

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

51
#end