From 705d9cd62eb280ab9d0c619c707c669740f3a46b Mon Sep 17 00:00:00 2001
From: Wai Yi Leung <w.y.leung@lumc.nl>
Date: Thu, 29 Oct 2015 13:27:48 +0100
Subject: [PATCH] Style fixes and config  for samtofastq

---
 .../lumc/sasc/biopet/extensions/sambamba/Sambamba.scala   | 4 ++--
 .../scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/Sambamba.scala b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/Sambamba.scala
index 12c6a5024..17894a815 100644
--- a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/Sambamba.scala
+++ b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/Sambamba.scala
@@ -15,7 +15,7 @@
  */
 package nl.lumc.sasc.biopet.extensions.sambamba
 
-import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
+import nl.lumc.sasc.biopet.core.{BiopetCommandLineFunction, Version}
 
 /** General Sambamba extension */
 abstract class Sambamba extends BiopetCommandLineFunction with Version {
@@ -24,7 +24,7 @@ abstract class Sambamba extends BiopetCommandLineFunction with Version {
 
   override def subPath = "sambamba" :: super.subPath
 
-  executable = config("exe", default = "sambamba", submodule = "sambamba")
+  executable = config("exe", default = "sambamba", submodule = "sambamba", freeVar = false)
   def versionCommand = executable
   def versionRegex = """sambamba v(.*)""".r
   override def versionExitcode = List(0, 1)
diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
index 63e032815..895ad38ad 100644
--- a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
@@ -63,9 +63,14 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript with Sam
     gears.summaryFile = summaryFile
     Some(gears)
   }
+
+  override def defaults = Map(
+    "samtofastq" -> Map(
+      "validationstringency" -> "LENIENT"
+    )
+  )
   /** Method to add jobs */
   def biopetScript(): Unit = {
-
     val fastqFiles: List[File] = bamFile.map { bamfile =>
 
       // sambamba view -f bam -F "unmapped or mate_is_unmapped" <alnFile> > <extracted.bam>
@@ -79,7 +84,6 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript with Sam
       // start bam to fastq (only on unaligned reads) also extract the matesam
       val samToFastq = new SamToFastq(this)
       samToFastq.input = samFilterUnmapped.output
-      samToFastq.stringency = Some("LENIENT")
       samToFastq.fastqR1 = new File(outputDir, s"$outputName.unmapped.R1.fq.gz")
       samToFastq.fastqR2 = new File(outputDir, s"$outputName.unmapped.R2.fq.gz")
       samToFastq.fastqUnpaired = new File(outputDir, s"$outputName.unmapped.singleton.fq.gz")
-- 
GitLab