From 9123df3211fb13ef1d5966c10a5d8ea83a42fede Mon Sep 17 00:00:00 2001
From: Wai Yi Leung <w.y.leung@lumc.nl>
Date: Fri, 13 Feb 2015 17:28:03 +0100
Subject: [PATCH] Make better use of the File object, let the file object
 concat the paths for me

---
 .../biopet/pipelines/kopisu/ConiferPipeline.scala | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/public/kopisu/src/main/scala/nl/lumc/sasc/biopet/pipelines/kopisu/ConiferPipeline.scala b/public/kopisu/src/main/scala/nl/lumc/sasc/biopet/pipelines/kopisu/ConiferPipeline.scala
index 54926853c..5e9355172 100644
--- a/public/kopisu/src/main/scala/nl/lumc/sasc/biopet/pipelines/kopisu/ConiferPipeline.scala
+++ b/public/kopisu/src/main/scala/nl/lumc/sasc/biopet/pipelines/kopisu/ConiferPipeline.scala
@@ -80,7 +80,7 @@ class ConiferPipeline(val root: Configurable) extends QScript with BiopetQScript
     val coniferRPKM = new ConiferRPKM(this)
     coniferRPKM.bamFile = this.inputBam.getAbsoluteFile
     coniferRPKM.probes = this.probeFile
-    coniferRPKM.output = new File(RPKMdir + File.separator + input2RPKM(inputBam))
+    coniferRPKM.output = new File(RPKMdir, input2RPKM(inputBam))
     add(coniferRPKM)
 
     if (!RPKMonly) {
@@ -88,9 +88,10 @@ class ConiferPipeline(val root: Configurable) extends QScript with BiopetQScript
       var refRPKMlist: List[File] = Nil
       // Sync the .txt only, these files contain the RPKM Values
       for (controlRPKMfile <- controlsDir.list.filter(_.toLowerCase.endsWith(".txt"))) {
-        val target = new File(RPKMdir + File.separator + controlRPKMfile.getName)
-        val source = new File(controlsDir + File.separator + controlRPKMfile)
-        if (!target.exists()) {
+        val target = new File(RPKMdir, controlRPKMfile)
+        val source = new File(controlsDir, controlRPKMfile)
+
+        if (!target.exists) {
           add(Ln(this, source, target, false))
           refRPKMlist :+= target
         } else if (!target.equals(source)) {
@@ -104,18 +105,18 @@ class ConiferPipeline(val root: Configurable) extends QScript with BiopetQScript
       coniferAnalyze.deps = List(coniferRPKM.output) ++ refRPKMlist
       coniferAnalyze.probes = this.probeFile
       coniferAnalyze.rpkmDir = RPKMdir
-      coniferAnalyze.output = new File(sampleDir + File.separator + input2HDF5(inputBam))
+      coniferAnalyze.output = new File(sampleDir, input2HDF5(inputBam))
       add(coniferAnalyze)
 
       val coniferCall = new ConiferCall(this)
       coniferCall.input = coniferAnalyze.output
-      coniferCall.output = new File(sampleDir + File.separator + "calls.txt")
+      coniferCall.output = new File(sampleDir, "calls.txt")
       add(coniferCall)
 
       summary.deps = List(coniferCall.output)
       summary.label = sampleLabel
       summary.calls = coniferCall.output
-      summary.out = new File(sampleDir + File.separator + input2Calls(inputBam))
+      summary.out = new File(sampleDir, input2Calls(inputBam))
 
       add(summary)
     }
-- 
GitLab