Commit 574ccefb authored by Wai Yi Leung's avatar Wai Yi Leung

Updates in report, visual changes (cleaner and sorted) ...

parent 8d6db946
......@@ -46,16 +46,18 @@
</div>
<div class="panel-footer">
#if (showTable)
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#alignmentSummaryTable">Hide table</button>
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#alignmentSummaryTable">
<i class="glyphicon glyphicon-eye-close"></i> Hide table</button>
#else
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#alignmentSummaryTable">Show table</button>
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#alignmentSummaryTable">
<i class="glyphicon glyphicon-eye-open"></i> Show table</button>
#end
<i class="glyphicon glyphicon-file"></i> <a href="alignmentSummary.tsv">tsv file</a>
<button type="button" class="btn btn-info"><i class="glyphicon glyphicon-cloud-download"> <a href="alignmentSummary.tsv">TSV file</a></i></button>
</div>
#end
<div class="panel-body collapse #if (showTable)in#end" id="alignmentSummaryTable">
<!-- Table -->
<table class="table sortable-theme-bootstrap" data-sortable>
<table class="table">
<thead><tr>
<th data-sorted="true" data-sorted-direction="ascending">Sample</th>
#if (!sampleLevel) <th>Library</th> #end
......@@ -70,8 +72,8 @@
#{
val libs = (libId, sampleLevel) match {
case (_, true) => List("")
case (Some(libId), _) => List(libId.toString)
case _ => summary.libraries(sample).toList
case (Some(libId), _) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
}#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
......
......@@ -32,9 +32,9 @@
#if (sampleId.isDefined && libId.isDefined)
something
#elseif(sampleId.isDefined)
This plot shows the insert size distribution for the libraries of sample ${sampleId}. <a href="http://thegenomefactory.blogspot.nl/2013/08/paired-end-read-confusion-library.html">Insert size</a> denotes the size of the so-called <em>insert</em> between two read pairs in a paired-end sequencing run. This should correspond to the length of the sequence between the sequencing adaptors. The provided table shows mean and median insert size for each sample, together with the standard deviation.
This plot shows the insert size distribution for the libraries of sample <b>${sampleId}</b>. <a href="http://thegenomefactory.blogspot.nl/2013/08/paired-end-read-confusion-library.html">Insert size</a> denotes the size of the so-called <em>insert</em> between two read pairs in a paired-end sequencing run. This should correspond to the length of the sequence between the sequencing adaptors. The provided table shows mean and median insert size for each sample, together with the standard deviation.
#else
This plot shows the insert size distribution for each of the ${samples.size} samples. <a href="http://thegenomefactory.blogspot.nl/2013/08/paired-end-read-confusion-library.html">Insert size</a> denotes the size of the so-called <em>insert</em> between two read pairs in a paired-end sequencing run. This should correspond to the length of the sequence between the sequencing adaptors. The provided table shows mean and median insert size for each sample, together with the standard deviation.
This plot shows the insert size distribution for each of the <b>${samples.size}</b> samples. <a href="http://thegenomefactory.blogspot.nl/2013/08/paired-end-read-confusion-library.html">Insert size</a> denotes the size of the so-called <em>insert</em> between two read pairs in a paired-end sequencing run. This should correspond to the length of the sequence between the sequencing adaptors. The provided table shows mean and median insert size for each sample, together with the standard deviation.
#end
</p>
</div>
......@@ -49,17 +49,20 @@
</div>
<div class="panel-footer">
#if (showTable)
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#insertsizeTable">Hide table</button>
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#insertsizeTable">
<i class="glyphicon glyphicon-eye-close"></i> Hide table</button>
#else
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#insertsizeTable">Show table</button>
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#insertsizeTable">
<i class="glyphicon glyphicon-eye-open"></i> Show table</button>
#end
<i class="glyphicon glyphicon-file"></i> <a href="insertsize.tsv">tsv file</a>
<button type="button" class="btn btn-info"><i class="glyphicon glyphicon-cloud-download"> <a href="insertsize.tsv">tsv file</a></i></button>
</div>
#end
<div class="panel-body collapse #if (showTable)in#end" id="insertsizeTable">
<!-- Table -->
<table class="table sortable-theme-bootstrap" data-sortable>
<table class="table">
<thead><tr>
<th data-sorted="true" data-sorted-direction="ascending">Sample</th>
#if (!sampleLevel) <th>Library</th> #end
......@@ -84,7 +87,7 @@
val prefixPath = List("samples", sample) ::: (if (libId.isEmpty) Nil else List("libraries", libId)) ::: List("bammetrics", "stats")
val fieldValues = for (field <- fields) yield {
summary.getValue((prefixPath ::: List("CollectInsertSizeMetrics", "metrics", field.toUpperCase)):_*).getOrElse(prefixPath ::: metricsTag :: Nil)
summary.getValue((prefixPath ::: List("CollectInsertSizeMetrics", "metrics", field.toUpperCase)):_*).getOrElse("N/A")
}
}#
#for (value <- fieldValues)
......
......@@ -78,7 +78,9 @@ object BammetricsReport extends ReportBuilder {
Map())),
List(
"Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"),
// FIXME: the insert size block, should only displayed when we have paired end data.
"Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp", Map("showPlot" -> true))
) ++ (if (wgsExecuted) List("Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp",
Map("showPlot" -> true)))
else Nil) ++
......
......@@ -6,7 +6,7 @@
<table class="table">
<thead><tr><th>Libraries</th></tr></thead>
<tbody>
#for (lib <- summary.libraries(sampleId.get))
#for (lib <- summary.libraries(sampleId.get).toList.sorted)
<tr><td><a href="${rootPath}Samples/${sampleId}/Libraries/${lib}/index.html">${lib}</a></td></tr>
#end
</tbody>
......
......@@ -12,22 +12,37 @@
val buffer: StringBuffer = new StringBuffer()
if (page.subPages.nonEmpty){
buffer.append("<ul class=\"dropdown-menu\">")
buffer.append("<ul class=\"dropdown-menu list-group\">")
}
for (subPage <- page.subPages.sortBy(_._1)) {
val href: String = {
if (path.isEmpty) rootPath + subPage._1 + "/index.html"
else rootPath + path.mkString("","/","/") + subPage._1 + "/index.html"
}
buffer.append("<li")
if(subPage._2.subPages.nonEmpty) buffer.append(" class=\"dropdown-submenu\"")
buffer.append("><a href=\"" + href + "\"")
if (first) buffer.append(" tabindex=\"-1\"")
buffer.append(">" + subPage._1 + "</a>")
buffer.append(createMenu(subPage._2, path ::: subPage._1 :: Nil, first = false))
buffer.append("</li>")
// buffer.append("<li")
// if(subPage._2.subPages.nonEmpty) buffer.append(" class=\"dropdown-submenu list-group-item\"")
// buffer.append("><span class=\"badge\">%d</span><a href=\"%s\"".format(subPage._2.subPages.size, href))
// if (first) buffer.append(" tabindex=\"-1\"")
// buffer.append(">%s</a>".format(subPage._1))
// buffer.append(createMenu(subPage._2, path ::: subPage._1 :: Nil, first = false))
// buffer.append("</li>")
val listSubmenu = if(subPage._2.subPages.nonEmpty) "dropdown-submenu" else ""
// val subMenuBadgeCount = if(subPage._2.subPages.nonEmpty && first) "<span class='badge'>%d</span>".format(subPage._2.subPages.size) else ""
val tabIndex = if (first) " tabindex='-1'" else ""
// val listGroupA = if(subPage._2.subPages.nonEmpty) "list-group-item" else ""
var menuItem: String = "<li class='%s'>".format(listSubmenu) +
"<a href='%s' class='%s'%s>".format(href, "", tabIndex) +
"%s".format(subPage._1) +
"</a>" +
createMenu(subPage._2, path ::: subPage._1 :: Nil, first = false) +
"</li>"
buffer.append(menuItem)
}
if(page.subPages.nonEmpty) {
buffer.append("</ul>\n")
......@@ -74,7 +89,7 @@
Sortable.init()
$('body').scrollspy({
target: '.bs-sidebar',
target: '.bs-sidebar'
});
});
......@@ -113,14 +128,14 @@
<a href="${rootPath}index.html">Home
#if (indexPage.subPages.nonEmpty) <b class="caret"></b> #end
</a>
${unescape(createMenu(indexPage))}
${unescape(createMenu(indexPage, Nil, false))}
</li>
#else
<li class="root #if (t == path.size) active #end">
<a href="${rootPath}${path.slice(0,t).mkString("", "/", "/")}index.html">${path( t - 1 )}
#if (getSubPage(path.slice(0, t)).subPages.nonEmpty) <b class="caret"></b> #end
</a>
${unescape(createMenu(getSubPage(path.slice(0, t)), path.slice(0, t)))}
${unescape(createMenu(getSubPage(path.slice(0, t)), path.slice(0, t), false))}
</li>
#end
#end
......
......@@ -5,7 +5,7 @@
<table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th></tr></thead>
<tbody>
#for (sample <- summary.samples)
#for (sample <- summary.samples.toList.sorted)
<tr><td><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td></tr>
#end
</tbody>
......
......@@ -36,7 +36,7 @@ trait MultisampleReportBuilder extends ReportBuilder {
def libraryPage(sampleId: String, libraryId: String, args: Map[String, Any]): ReportPage
/** Default list of libraries, can be override */
def libririesSections: List[(String, ReportSection)] = {
def librariesSections: List[(String, ReportSection)] = {
List(
("Libraries", ReportSection("/nl/lumc/sasc/biopet/core/report/librariesList.ssp"))
)
......@@ -60,6 +60,6 @@ trait MultisampleReportBuilder extends ReportBuilder {
val libPages = summary.libraries(sampleId)
.map(libId => libId -> libraryPage(sampleId, libId, args ++ Map("libId" -> Some(libId))))
.toList
ReportPage(libPages, libririesSections, args)
ReportPage(libPages, librariesSections, args)
}
}
......@@ -98,8 +98,8 @@
#for (sample <- samples.toList.sorted)
#{
val libs = libId match {
case Some(libId) => List(libId.toString)
case _ => summary.libraries(sample).toList
case Some(libId) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
val sampleRowspan = {
......
......@@ -35,8 +35,8 @@
#for (sample <- samples.toList.sorted)
#{
val libs = libId match {
case Some(libId) => List(libId.toString)
case _ => summary.libraries(sample).toList
case Some(libId) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
val sampleRowspan = {
......
......@@ -35,8 +35,8 @@
#for (sample <- samples.toList.sorted)
#{
val libs = libId match {
case Some(libId) => List(libId.toString)
case _ => summary.libraries(sample).toList
case Some(libId) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
val sampleRowspan = {
......
......@@ -103,12 +103,12 @@
#for (sample <- samples.toList.sorted)
#{
val libs = libId match {
case Some(libId) => List(libId.toString)
case _ => summary.libraries(sample).toList
case Some(libId) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
val sampleRowspan = {
libs.size +
libs.count(summary.getLibraryValue(sample, _, "flexiprep", "settings", "paired").getOrElse(false) == true)
libs.size +
libs.count(summary.getLibraryValue(sample, _, "flexiprep", "settings", "paired").getOrElse(false) == true)
}
}#
<tr><td rowspan="${sampleRowspan}">
......
......@@ -40,8 +40,8 @@
#{
val libs = (libId, sampleLevel) match {
case (_, true) => List("")
case (Some(libId), _) => List(libId.toString)
case _ => summary.libraries(sample).toList
case (Some(libId), _) => List(libId.toString).sorted
case _ => summary.libraries(sample).toList.sorted
}
}#
<tr><td rowspan="${libs.size}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment