Skip to content
Snippets Groups Projects
Commit a548cfde authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Simplify the report for plots for Gentrap / TinyCap heatmaps. Only 1 template...

Simplify the report for plots for Gentrap / TinyCap heatmaps. Only 1 template file, defining the picture path in the Report instead of the template.
parent e568b959
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,8 @@
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var outputDir: File %>
<%@ var pipelineName: String = "gentrap" %>
<%@ var pipelineName: String %>
<%@ var plotPath: Option[Any] %>
#{
def getPlot(path:Option[Any], targetPath:String) = {
......@@ -27,7 +28,7 @@ def getPlot(path:Option[Any], targetPath:String) = {
<tbody>
<tr>
<td>
<img src="${getPlot(summary.getValue("fragmentspergene", "files", "pipeline", "fragments_per_gene_heatmap", "path"), "measurements" )}" class="img-responsive" />
<img src="${getPlot(plotPath, "measurements" )}" class="img-responsive center-block" />
</td>
</tr>
</tbody>
......
#import(nl.lumc.sasc.biopet.utils.summary.Summary)
#import(org.apache.commons.io.FileUtils)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var outputDir: File %>
<%@ var pipelineName: String = "tinycap" %>
#{
def getPlot(path:Option[Any], targetPath:String) = {
path.collect {
case value =>
new File(targetPath).mkdirs()
val file = new File(value.toString)
val newFile = new File(outputDir, targetPath + File.separator + file.getName)
if (file.exists()) FileUtils.copyFile(file, newFile)
targetPath + File.separator + file.getName
}
}
}#
<div class="panel-body">
<!-- Table -->
<table class="table">
<thead>
</thead>
<tbody>
<tr>
<td>
<img src="${getPlot(summary.getValue("fragmentspersmallrna", "files", "pipeline", "fragments_per_gene_heatmap", "path"), "measurements" )}" class="img-responsive" />
</td>
</tr>
</tbody>
</table>
</div>
......@@ -20,10 +20,15 @@ object TinyCapReport extends MultisampleMappingReportTrait {
override def frontSection: ReportSection = ReportSection("/nl/lumc/sasc/biopet/pipelines/tinycap/tinycapFront.ssp")
override def additionalSections = List(
"Fragments per gene" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gentrap/measure_fragmentspergene.ssp",
Map("pipelineName" -> pipelineName)),
"Fragments per microRNA" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/tinycap/measure_fragmentspersmallrna.ssp",
Map("pipelineName" -> pipelineName))
"Fragments per gene" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gentrap/measure_plotreport.ssp",
Map("pipelineName" -> pipelineName,
"plotName" -> "fragmentspergene",
"plotPath" -> summary.getValue("fragmentspergene", "files", "pipeline", "fragments_per_gene_heatmap", "path")
) ),
"Fragments per microRNA" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gentrap/measure_plotreport.ssp",
Map("pipelineName" -> pipelineName,
"plotName" -> "fragmentspersmallrna",
"plotPath" -> summary.getValue("fragmentspersmallrna", "files", "pipeline", "fragments_per_gene_heatmap", "path")))
)
override def pipelineName = "tinycap"
......
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