sampleVariantsSv.ssp 3.18 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(java.io.File)
<%@ var rootPath: String %>
<%@ var outputDir: File %>
<%@ var summary: Summary %>
<%@ var showPlot: Boolean = false %>
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>

#{
11
    val sampleNames: List[String] = summary.samples.toList.sorted
akaljuvee's avatar
akaljuvee committed
12

akaljuvee's avatar
akaljuvee committed
13
    val counts: Map[String, Map[String, Array[Long]]] = ShivaSvCallingReport.parseSummaryForSvCounts(summary)
14
    val traCounts: Map[String, Long] = ShivaSvCallingReport.parseSummaryForTranslocations(summary)
akaljuvee's avatar
akaljuvee committed
15

16
17
18
19
20
21
22
23
24
    var svTypes = List(
    SvTypeForReport("DEL", "Deletions", "svSummaryDeletions.tsv", "svSummaryDeletions.png"),
    SvTypeForReport("DUP", "Duplications", "svSummaryDuplications.tsv", "svSummaryDuplications.png"),
    SvTypeForReport("INS", "Insertions", "svSummaryInsertions.tsv", "svSummaryInsertions.png"),
    SvTypeForReport("INV", "Inversions", "svSummaryInversions.tsv", "svSummaryInversions.png"))
    svTypes = svTypes.filter(sv => counts.contains(sv.svType))
    val tsvAllTypes = "svSummary.tsv"

    ShivaSvCallingReport.writeTsvFiles(sampleNames, counts, svTypes, tsvAllTypes, outputDir)
akaljuvee's avatar
akaljuvee committed
25
    ShivaSvCallingReport.createPlots(svTypes, outputDir)
26
27
28
29
30
}#


#if (showPlot)
    <div class="panel-body">
31
32
33
    #for (sv <- svTypes)
        <img src="${sv.pngFileName}" />
    #end
34
    </div>
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    #if (traCounts.nonEmpty)
        <div class="panel-body">
        <h5>Number of translocation events detected:</h5>
        <table class="table table-condensed" style="width:auto">
            <thead><tr>
            #for (sampleName <- sampleNames)
                <th>${sampleName}</th>
            #end
            </tr></thead>
            <tbody><tr>
            #for (sampleName <- sampleNames)
                <td>${traCounts.get(sampleName).get}</td>
            #end
            </tr></tbody>
        </table>
        </div>
    #end
52
    <div class="panel-footer">
akaljuvee's avatar
akaljuvee committed
53
54
        <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#svSummaryTable">
            #if (showTable)
55
                <i class="glyphicon glyphicon-eye-close"></i> Hide tables
akaljuvee's avatar
akaljuvee committed
56
            #else
57
                <i class="glyphicon glyphicon-eye-open"></i> Show tables
akaljuvee's avatar
akaljuvee committed
58
59
60
            #end
        </button>
        <a href="${tsvAllTypes}"><button type="button" class="btn btn-info"><i class="glyphicon glyphicon-cloud-download"></i> TSV file</button></a>
61
62
63
64
65
    </div>
#end

<div class="panel-body collapse #if (showTable)in#end" id="svSummaryTable">

66
67
#for (sv <- svTypes)
#{
akaljuvee's avatar
akaljuvee committed
68
    val countsForSvType: Map[String, Array[Long]] = counts.get(sv.svType).get
69
70
}#
<h3>${sv.displayText}</h3>
71
72
<table class="table sortable-theme-bootstrap" data-sortable>
    <thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th>
73
74
75
        #for (text <- ShivaSvCallingReport.histogramText)
            <th>${text}</th>
         #end
76
77
    </tr></thead>
    <tbody>
78
79
80
81
82
        #for (sampleName <- sampleNames)
            <tr>
            <td><a href="${rootPath}Samples/${sampleName}/index.html">${sampleName}</a></td>
            #for (countForSize <- countsForSvType.get(sampleName).get)
                <td>${countForSize}</td>
83
            #end
84
            </tr>
85
86
87
        #end
    </tbody>
</table>
88
89

#end
90
</div>