From 3584a778e4760dda7e3c79948d42d50db9ee7dd8 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 1 Aug 2015 13:52:34 +0200
Subject: [PATCH] Saver execution order

---
 .../nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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 5eb7bf411..6d790f104 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
@@ -280,9 +280,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
   } else None
 
   lazy val svCalling = if (config("sv_calling", default = false).asBoolean) {
-    val svCalling = new ShivaSvCalling(this)
-    samples.foreach(x => x._2.preProcessBam.foreach(bam => svCalling.addBamFile(bam, Some(x._1))))
-    Some(svCalling)
+    Some(new ShivaSvCalling(this))
   } else None
 
   /** This will add the mutisample variantcalling */
@@ -298,6 +296,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
 
     svCalling.foreach(sv => {
       sv.outputDir = new File(outputDir, "sv_calling")
+      samples.foreach(x => x._2.preProcessBam.foreach(bam => sv.addBamFile(bam, Some(x._1))))
       sv.init()
       sv.biopetScript()
       addAll(sv.functions)
-- 
GitLab