gearsSunburst.ssp 1.94 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
21
22
23
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<%@ var outputDir: File %>
<%@ var showPlot: Boolean = true %>
<%@ var showTable: Boolean = true %>
<%@ var showIntro: Boolean = true %>
<%@ var multisample: Boolean = false %>
#{
    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
24
25
26
27
28
        <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
29
30
31
32
33
34
    </div>
#end



#if (showPlot)
Wai Yi Leung's avatar
Wai Yi Leung committed
35
<div class="row">
Wai Yi Leung's avatar
Wai Yi Leung committed
36
    <div class="col-md-12">
Wai Yi Leung's avatar
Wai Yi Leung committed
37
38
39
40
41
42
43
44
45
46
47
48
    <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
49

Wai Yi Leung's avatar
Wai Yi Leung committed
50
51
52
53
54
55
56
57
58
    <div id="datatable"></div>
    <div id="svgholder"></div>

    </div>


    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
    <script src="${rootPath}ext/js/gears.js"></script>

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

Wai Yi Leung's avatar
Wai Yi Leung committed
61
62
63
64
65
66
    #{
        val rawreport = Map("kraken" -> summary.getValue("gears", "stats", "krakenreport"))
        val bla = ConfigUtils.mapToJson(rawreport)
    }#

        var krakenresult = JSON.parse('<%= unescape(bla) %>');
Wai Yi Leung's avatar
Wai Yi Leung committed
67
68
        loadGears(krakenresult.kraken.classified);
    </script>
Wai Yi Leung's avatar
Wai Yi Leung committed
69
70


Wai Yi Leung's avatar
Wai Yi Leung committed
71
</div>
Wai Yi Leung's avatar
Wai Yi Leung committed
72
#end