Commit 2ce81c48 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Changes method name

parent ae94babe
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr> <tr>
<td>${summary.getLibraryValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "path")}</td> <td>${summary.getValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "path")}</td>
<td>${summary.getLibraryValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "md5")}</td> <td>${summary.getValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "md5")}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
\ No newline at end of file
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<%@ var metricsTag: String = "bammetrics" %> <%@ var metricsTag: String = "bammetrics" %>
<%@ var target: String %> <%@ var target: String %>
#{ #{
val originalPlot = new File(summary.getLibraryValue(sampleId, libId, metricsTag, "files", target + "_cov_stats", "plot", "path") val originalPlot = new File(summary.getValue(sampleId, libId, metricsTag, "files", target + "_cov_stats", "plot", "path")
.getOrElse(throw new IllegalArgumentException("No plot found in summary")).toString) .getOrElse(throw new IllegalArgumentException("No plot found in summary")).toString)
val plot = new File(outputDir, target + "_cov_stats.png") val plot = new File(outputDir, target + "_cov_stats.png")
val values = summary.getLibraryValue(sampleId, libId, metricsTag, "stats", target + "_cov_stats", "coverage", "_all") val values = summary.getValue(sampleId, libId, metricsTag, "stats", target + "_cov_stats", "coverage", "_all")
.getOrElse(throw new IllegalArgumentException("No plot found in summary")).asInstanceOf[Map[String, Any]] .getOrElse(throw new IllegalArgumentException("No plot found in summary")).asInstanceOf[Map[String, Any]]
if (originalPlot.exists()) IoUtils.copyFile(originalPlot, plot) if (originalPlot.exists()) IoUtils.copyFile(originalPlot, plot)
......
...@@ -42,8 +42,8 @@ object BammetricsReport extends ReportBuilder { ...@@ -42,8 +42,8 @@ object BammetricsReport extends ReportBuilder {
libId: Option[String], libId: Option[String],
metricsTag: String = "bammetrics") = { metricsTag: String = "bammetrics") = {
val targets = ( val targets = (
summary.getLibraryValue(sampleId, libId, "bammetrics", "settings", "amplicon_name"), summary.getValue(sampleId, libId, "bammetrics", "settings", "amplicon_name"),
summary.getLibraryValue(sampleId, libId, "bammetrics", "settings", "roi_name") summary.getValue(sampleId, libId, "bammetrics", "settings", "roi_name")
) match { ) match {
case (Some(amplicon: String), Some(roi: List[_])) => amplicon :: roi.map(_.toString) case (Some(amplicon: String), Some(roi: List[_])) => amplicon :: roi.map(_.toString)
case (_, Some(roi: List[_])) => roi.map(_.toString) case (_, Some(roi: List[_])) => roi.map(_.toString)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<%@ var libId: Option[String] = None %> <%@ var libId: Option[String] = None %>
<%@ var pipeline: String = summary.getValue("meta", "pipeline_name").getOrElse("").toString %> <%@ var pipeline: String = summary.getValue("meta", "pipeline_name").getOrElse("").toString %>
#{ #{
val executables = summary.getLibraryValue(sampleId, libId, pipeline, "executables").getOrElse(Map()).asInstanceOf[Map[String, Map[String, Any]]] val executables = summary.getValue(sampleId, libId, pipeline, "executables").getOrElse(Map()).asInstanceOf[Map[String, Map[String, Any]]]
}# }#
<table class="table"> <table class="table">
......
...@@ -55,7 +55,7 @@ class Summary(file: File) { ...@@ -55,7 +55,7 @@ class Summary(file: File) {
//TODO: rename method //TODO: rename method
/** Get value on nested path with prefix depending is sampleId and/or libId is None or not */ /** Get value on nested path with prefix depending is sampleId and/or libId is None or not */
def getLibraryValue(sampleId: Option[String], libId: Option[String], path: String*): Option[Any] = { def getValue(sampleId: Option[String], libId: Option[String], path: String*): Option[Any] = {
(sampleId, libId) match { (sampleId, libId) match {
case (Some(sample), Some(lib)) => getLibraryValue(sample, lib, path: _*) case (Some(sample), Some(lib)) => getLibraryValue(sample, lib, path: _*)
case (Some(sample), _) => getSampleValue(sample, path: _*) case (Some(sample), _) => getSampleValue(sample, path: _*)
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
#for (libId <- libs) #for (libId <- libs)
#if (libs.head != libId) <tr> #end #if (libs.head != libId) <tr> #end
#if (!sampleLevel) <td><a href="${rootPath}Samples/${sample}/Libraries/${libId}/index.html">${libId}</a></td> #end #if (!sampleLevel) <td><a href="${rootPath}Samples/${sample}/Libraries/${libId}/index.html">${libId}</a></td> #end
<td>${removeDir(summary.getLibraryValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "path"))}</td> <td>${removeDir(summary.getValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "path"))}</td>
<td>${summary.getLibraryValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "md5")}</td> <td>${summary.getValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "md5")}</td>
</tr> </tr>
#end #end
#end #end
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<%@ var rootPath: String %> <%@ var rootPath: String %>
<%@ var outputDir: File %> <%@ var outputDir: File %>
#{ #{
val variantCallers = summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "settings", "variantcallers").get.asInstanceOf[List[String]] val variantCallers = summary.getValue(sampleId, libId, "shivavariantcalling", "settings", "variantcallers").get.asInstanceOf[List[String]]
val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
def removeDir(value: Option[Any]): Option[Any] = { def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a => value.collect { case a =>
...@@ -31,15 +31,15 @@ ...@@ -31,15 +31,15 @@
#if (variantCallers.size > 1) #if (variantCallers.size > 1)
<tr> <tr>
<td>Final (merged)</td> <td>Final (merged)</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td> <td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td> <td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td>
</tr> </tr>
#end #end
#for (variantCaller <- variantCallers) #for (variantCaller <- variantCallers)
<tr> <tr>
<td>${variantCaller}</td> <td>${variantCaller}</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td> <td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td> <td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
</tr> </tr>
#end #end
</tbody> </tbody>
......
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