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

Changes method name

parent ae94babe
......@@ -13,8 +13,8 @@
</tr></thead>
<tbody>
<tr>
<td>${summary.getLibraryValue(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", "path")}</td>
<td>${summary.getValue(sampleId, libId, metricsTag, "files", "pipeline", "bamfile", "md5")}</td>
</tr>
</tbody>
</table>
\ No newline at end of file
......@@ -10,11 +10,11 @@
<%@ var metricsTag: String = "bammetrics" %>
<%@ 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)
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]]
if (originalPlot.exists()) IoUtils.copyFile(originalPlot, plot)
......
......@@ -42,8 +42,8 @@ object BammetricsReport extends ReportBuilder {
libId: Option[String],
metricsTag: String = "bammetrics") = {
val targets = (
summary.getLibraryValue(sampleId, libId, "bammetrics", "settings", "amplicon_name"),
summary.getLibraryValue(sampleId, libId, "bammetrics", "settings", "roi_name")
summary.getValue(sampleId, libId, "bammetrics", "settings", "amplicon_name"),
summary.getValue(sampleId, libId, "bammetrics", "settings", "roi_name")
) match {
case (Some(amplicon: String), Some(roi: List[_])) => amplicon :: roi.map(_.toString)
case (_, Some(roi: List[_])) => roi.map(_.toString)
......
......@@ -6,7 +6,7 @@
<%@ var libId: Option[String] = None %>
<%@ 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">
......
......@@ -55,7 +55,7 @@ class Summary(file: File) {
//TODO: rename method
/** 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 {
case (Some(sample), Some(lib)) => getLibraryValue(sample, lib, path: _*)
case (Some(sample), _) => getSampleValue(sample, path: _*)
......
......@@ -48,8 +48,8 @@
#for (libId <- libs)
#if (libs.head != libId) <tr> #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>${summary.getLibraryValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "md5")}</td>
<td>${removeDir(summary.getValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "path"))}</td>
<td>${summary.getValue(Some(sample), (if (sampleLevel) None else Some(libId)), pipelineName, "files", "pipeline", fileTag, "md5")}</td>
</tr>
#end
#end
......
......@@ -9,7 +9,7 @@
<%@ var rootPath: String %>
<%@ 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
def removeDir(value: Option[Any]): Option[Any] = {
value.collect { case a =>
......@@ -31,15 +31,15 @@
#if (variantCallers.size > 1)
<tr>
<td>Final (merged)</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td>
<td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", "final", "md5")}</td>
</tr>
#end
#for (variantCaller <- variantCallers)
<tr>
<td>${variantCaller}</td>
<td>${removeDir(summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${summary.getLibraryValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
<td>${removeDir(summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "path"))}</td>
<td>${summary.getValue(sampleId, libId, "shivavariantcalling", "files", "pipeline", variantCaller, "md5")}</td>
</tr>
#end
</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