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

#{
12
13
14
15
    val sampleNames: List[String] = sampleId match {
        case Some(sampleName) => List(sampleName.toString)
        case _ => summary.samples.toList.sorted
    }
akaljuvee's avatar
akaljuvee committed
16

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

20
21
22
23
24
25
26
27
28
    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
29
    ShivaSvCallingReport.createPlots(svTypes, outputDir)
30
31
32
33
34
}#


#if (showPlot)
    <div class="panel-body">
35
36
37
    #for (sv <- svTypes)
        <img src="${sv.pngFileName}" />
    #end
38
    </div>
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    #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
56
    <div class="panel-footer">
akaljuvee's avatar
akaljuvee committed
57
58
        <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#svSummaryTable">
            #if (showTable)
59
                <i class="glyphicon glyphicon-eye-close"></i> Hide tables
akaljuvee's avatar
akaljuvee committed
60
            #else
61
                <i class="glyphicon glyphicon-eye-open"></i> Show tables
akaljuvee's avatar
akaljuvee committed
62
63
64
            #end
        </button>
        <a href="${tsvAllTypes}"><button type="button" class="btn btn-info"><i class="glyphicon glyphicon-cloud-download"></i> TSV file</button></a>
65
66
67
68
69
    </div>
#end

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

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

#end
94
</div>