From 3921c5d9ab12bd6e6b4995c4a3ebe7b707ac530a Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Tue, 27 Oct 2015 15:24:19 +0100
Subject: [PATCH] Changed file name

---
 .../biopet/pipelines/shiva/ShivaReport.scala  | 27 ++++++++++---------
 .../biopet/pipelines/shiva/ShivaTrait.scala   |  6 ++---
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
index b3915dc07..135b239ad 100644
--- a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
+++ b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
@@ -38,7 +38,7 @@ object ShivaReport extends MultisampleReportBuilder {
 
   def variantcallingExecuted = summary.getValue("shiva", "settings", "multisample_variantcalling") match {
     case Some(true) => true
-    case _ => false
+    case _          => false
   }
 
   /** Root page for the shiva report */
@@ -58,19 +58,20 @@ object ShivaReport extends MultisampleReportBuilder {
       List(
         "Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/shivaFront.ssp")) ++
         (if (variantcallingExecuted) List("Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/sampleVariants.ssp",
-          Map("showPlot" -> true, "showTable" -> false))) else Nil) ++
+          Map("showPlot" -> true, "showTable" -> false)))
+        else Nil) ++
         List("Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",
           Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)
         ),
-        "Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp",
-          Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)),
-        "Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp",
-          Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)),
-        "QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",
-          Map("showPlot" -> true, "showTable" -> false)),
-        "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp",
-          Map("showPlot" -> true, "showTable" -> false))
-      ),
+          "Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp",
+            Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)),
+          "Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp",
+            Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)),
+          "QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",
+            Map("showPlot" -> true, "showTable" -> false)),
+          "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp",
+            Map("showPlot" -> true, "showTable" -> false))
+        ),
       pageArgs
     )
   }
@@ -135,8 +136,8 @@ object ShivaReport extends MultisampleReportBuilder {
       "Preprocessing" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp", Map("sampleLevel" -> true))) ++
       (if (variantcallingExecuted) List("Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/sampleVariants.ssp")) else Nil) ++
       List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
-      "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
-    ), args)
+        "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
+      ), args)
   }
 
   /** Library page */
diff --git a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala
index c51eb6331..fbfed09cd 100644
--- a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala
+++ b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala
@@ -121,7 +121,7 @@ trait ShivaTrait extends MultiSampleQScript with Reference {
 
       lazy val inputR1: Option[File] = config("R1")
       lazy val inputR2: Option[File] = config("R2")
-      lazy val inputBam: Option[File] = if (r1.isEmpty) config("bam") else None
+      lazy val inputBam: Option[File] = if (inputR1.isEmpty) config("bam") else None
 
       lazy val (mapping, bamFile, preProcessBam): (Option[Mapping], Option[File], Option[File]) =
         (inputR1.isDefined, inputBam.isDefined) match {
@@ -226,9 +226,9 @@ trait ShivaTrait extends MultiSampleQScript with Reference {
     protected def addDoublePreProcess(input: List[File], isIntermediate: Boolean = false): Option[File] = {
       if (input == Nil) None
       else if (input.tail == Nil) {
-        val bamFile = new File(sampleDir, input.head.getName)
+        val bamFile = new File(sampleDir, s"$sampleId.bam")
         val oldIndex: File = new File(input.head.getAbsolutePath.stripSuffix(".bam") + ".bai")
-        val newIndex: File = new File(sampleDir, input.head.getName.stripSuffix(".bam") + ".bai")
+        val newIndex: File = new File(sampleDir, s"$sampleId.bai")
         val baiLn = Ln(qscript, oldIndex, newIndex)
         add(baiLn)
 
-- 
GitLab