Skip to content
Snippets Groups Projects
Commit 38e13cdd authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Switch to krona plots

parent dceac7c8
No related branches found
No related tags found
No related merge requests found
#import(java.io.File)
#import(scala.io.Source)
<%@ var rootPath: String %>
<%@ var kronaXml: File %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="${rootPath}ext/img/krona/favicon.ico"/>
<!--<script id="notfound">window.onload=function(){document.body.innerHTML="Could not get resources from \"http://krona.sourceforge.net\"."}</script>-->
<script src="${rootPath}ext/js/krona-2.0.js"></script>
</head>
<body>
<img id="hiddenImage" src="${rootPath}ext/img/krona/hidden.png" style="display:none"/>
<img id="loadingImage" src="${rootPath}ext/img/krona/loading.gif" style="display:none"/>
<noscript>Javascript must be enabled to view this page.</noscript>
<div style="display:none">
<%
val reader = Source.fromFile(kronaXml)
val xml = reader.getLines().mkString("\n")
reader.close()
%>
${unescape(xml)}
</div></body></html>
......@@ -148,7 +148,7 @@
${name}
</h3>
</div>
${unescape(section.render(args))}
${unescape(section.render(args ++ Map("args" -> args)))}
</div>
#end
</div>
......
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(nl.lumc.sasc.biopet.core.report.ReportBuilder)
#import(nl.lumc.sasc.biopet.pipelines.gears.GearsKraken)
#import(java.io.File)
#import(java.io.PrintWriter)
<%@ var summary: Summary %>
<%@ var rootPath: String %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var args: Map[String, Any] %>
<%@ var outputDir: File %>
<%
val bla = if (sampleId.isEmpty && libId.isEmpty) {
summary.getSampleValues("gearskraken", "stats", "krakenreport").map(x => x._1 -> x._2.get.asInstanceOf[Map[String, Any]])
} else summary.getValue(sampleId, libId, "gearskraken", "stats", "krakenreport").map(sampleId.get -> _.asInstanceOf[Map[String, Any]]).toList.toMap
val tempFile = File.createTempFile("krona.", ".xml")
tempFile.deleteOnExit()
GearsKraken.convertKrakenSummariesToKronaXml(bla, tempFile)
val output = ReportBuilder.renderTemplate("/nl/lumc/sasc/biopet/core/report/krona.ssp",
args ++ Map("kronaXml" -> tempFile))
val file = new File(outputDir, "kraken_krona.html")
val writer = new PrintWriter(file)
writer.println(output)
writer.close()
%>
<iframe src="kraken_krona.html" style="width:100%;height:80vh;border:none;"></iframe>
......@@ -16,7 +16,7 @@ object GearsReport extends MultisampleReportBuilder {
def reportName = "Gears Report"
override def extFiles = super.extFiles ++ List("js/gears.js")
override def extFiles = super.extFiles ++ List("js/gears.js", "js/krona-2.0.js", "img/krona/loading.gif", "img/krona/hidden.png", "img/krona/favicon.ico")
.map(x => ExtFile("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + x, x))
def indexPage = {
......@@ -54,7 +54,7 @@ object GearsReport extends MultisampleReportBuilder {
ReportPage(
if (krakenExecuted) List("Gears - Metagenomics" -> ReportPage(List(), List(
"Sunburst analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp"
"Kraken analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)), Map()))
else Nil, List(
"QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
......
......@@ -27,7 +27,7 @@ object GearsSingleReport extends ReportBuilder {
// TODO: Add dustbin analysis (aggregated)
// TODO: Add alignment stats per sample for the dustbin analysis
override def extFiles = super.extFiles ++ List("js/gears.js")
override def extFiles = super.extFiles ++ List("js/gears.js", "js/krona-2.0.js", "img/krona/loading.gif", "img/krona/hidden.png", "img/krona/favicon.ico")
.map(x => ExtFile("/nl/lumc/sasc/biopet/pipelines/gears/report/ext/" + x, x))
def indexPage = {
......@@ -39,7 +39,7 @@ object GearsSingleReport extends ReportBuilder {
),
List(
"Gears intro" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSingleFront.ssp"),
"Sunburst analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp")
"Kraken analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp")
),
pageArgs
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment