Skip to content
Snippets Groups Projects
Commit 6b607d8c authored by Sander Bollen's avatar Sander Bollen
Browse files

remove checks for existence of directories; they might not exist yet at script time

parent 0c9d68b0
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver ...@@ -81,7 +81,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver
@Output(doc = "Output CNV file") @Output(doc = "Output CNV file")
lazy val outputCnv: File = { lazy val outputCnv: File = {
outputDir match { outputDir match {
case Some(dir) if dir.exists => new File(dir, "cnv.txt") case Some(dir) => new File(dir, "cnv.txt")
case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS CNV output") case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS CNV output")
} }
} }
...@@ -89,7 +89,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver ...@@ -89,7 +89,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver
@Output(doc = "Output CNR file") @Output(doc = "Output CNR file")
lazy val outputCnr: File = { lazy val outputCnr: File = {
outputDir match { outputDir match {
case Some(dir) if dir.exists => new File(dir, "cnr.txt") case Some(dir) => new File(dir, "cnr.txt")
case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS CNR output") case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS CNR output")
} }
} }
...@@ -97,7 +97,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver ...@@ -97,7 +97,7 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver
@Output(doc = "Raw output") @Output(doc = "Raw output")
lazy val rawOutput: File = { lazy val rawOutput: File = {
outputDir match { outputDir match {
case Some(dir) if dir.exists => new File(dir, "rawoutput.txt") case Some(dir) => new File(dir, "rawoutput.txt")
case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS raw output") case _ => throw new IllegalArgumentException("Unexpected error when trying to set cn.MOPS raw output")
} }
} }
...@@ -121,5 +121,5 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver ...@@ -121,5 +121,5 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver
required("--rawoutput", rawOutput) + required("--rawoutput", rawOutput) +
required("--threads", threads) + required("--threads", threads) +
optional("--wl", windowLength) + optional("--wl", windowLength) +
required(input.map(f => f.getAbsolutePath).mkString(" ")) repeat(input)
} }
...@@ -13,7 +13,7 @@ class CnmopsTest extends TestNGSuite with Matchers { ...@@ -13,7 +13,7 @@ class CnmopsTest extends TestNGSuite with Matchers {
def testVersionCommand() = { def testVersionCommand() = {
val cn = new Cnmops(null) val cn = new Cnmops(null)
cn.versionCommand.endsWith("--version") shouldBe true cn.versionCommand.endsWith("--version") shouldBe true
cn.versionCommand.startsWith("Rscript") shouldBe true cn.versionCommand.split(" ").head.endsWith("Rscript") shouldBe true
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment