gearsSunburst.ssp 1.76 KB
Newer Older
Wai Yi Leung's avatar
Wai Yi Leung committed
1
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
Wai Yi Leung's avatar
Wai Yi Leung committed
2
#import(nl.lumc.sasc.biopet.utils.ConfigUtils)
Wai Yi Leung's avatar
Wai Yi Leung committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<%@ var showPlot: Boolean = true %>
<%@ var showIntro: Boolean = true %>
#{
    val samples = sampleId match {
        case Some(sample) => List(sample.toString)
        case _ => summary.samples.toList
    }
    val librariesCount = summary.samples.foldLeft(0)(_ + summary.libraries(_).size)
}#

#if (showIntro)

    <div class="row">
Wai Yi Leung's avatar
Wai Yi Leung committed
21
22
23
24
25
        <div class="col-md-1"></div>
        <div class="col-md-10">
            Here we show a sunburst visualisation of the analysis of the metagenome in sample: ${sampleId}
        </div>
        <div class="col-md-1"></div>
Wai Yi Leung's avatar
Wai Yi Leung committed
26
27
28
29
30
31
    </div>
#end



#if (showPlot)
Wai Yi Leung's avatar
Wai Yi Leung committed
32
<div class="row">
Wai Yi Leung's avatar
Wai Yi Leung committed
33
    <div class="col-md-12">
Wai Yi Leung's avatar
Wai Yi Leung committed
34
35
36
37
38
39
40
41
42
43
44
45
    <h3 id='currentlevel'>Root</h3>
    <div>
        <span id="selection_name"></span> -
        <span id="selection_size"></span> -
        <span id="selection_value"></span>
    </div>

    <form>
        <label><input type="radio" name="mode" value="size"> Size</label>
        <label><input type="radio" name="mode" value="count" checked> Count</label>
    </form>
    <div id="sequence"></div>
Wai Yi Leung's avatar
Wai Yi Leung committed
46

Wai Yi Leung's avatar
Wai Yi Leung committed
47
48
49
50
51
52
53
    <div id="datatable"></div>
    <div id="svgholder"></div>

    </div>

    <script src="${rootPath}ext/js/gears.js"></script>

Wai Yi Leung's avatar
Wai Yi Leung committed
54
    <script type="application/ecmascript">
Wai Yi Leung's avatar
Wai Yi Leung committed
55

Wai Yi Leung's avatar
Wai Yi Leung committed
56
    #{
57
        val rawreport = Map("kraken" -> summary.getValue(sampleId, libId, "gearskraken", "stats", "krakenreport"))
58
        val jsonReport = ConfigUtils.mapToJson(rawreport)
Wai Yi Leung's avatar
Wai Yi Leung committed
59
60
    }#

Peter van 't Hof's avatar
Peter van 't Hof committed
61
        var krakenresult = ${unescape(jsonReport)};
Wai Yi Leung's avatar
Wai Yi Leung committed
62
63
        loadGears(krakenresult.kraken.classified);
    </script>
Wai Yi Leung's avatar
Wai Yi Leung committed
64
65


Wai Yi Leung's avatar
Wai Yi Leung committed
66
</div>
Wai Yi Leung's avatar
Wai Yi Leung committed
67
#end