From e42f7355faa8c40074c062f7d23223958ca73fc7 Mon Sep 17 00:00:00 2001
From: Wai Yi Leung <w.y.leung@lumc.nl>
Date: Thu, 14 Jan 2016 15:12:41 +0100
Subject: [PATCH] Fix compile errors

---
 .../extensions/pindel/PindelCaller.scala      |  2 +-
 .../extensions/pindel/PindelConfig.scala      | 13 ++++-----
 .../pipelines/shiva/svcallers/Pindel.scala    | 29 ++-----------------
 3 files changed, 9 insertions(+), 35 deletions(-)

diff --git a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelCaller.scala b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelCaller.scala
index f3bbea7c7..a3204c20f 100644
--- a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelCaller.scala
+++ b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelCaller.scala
@@ -166,7 +166,7 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
     optional("--MIN_DD_CLUSTER_SIZE", MIN_DD_CLUSTER_SIZE) +
     optional("--MIN_DD_BREAKPOINT_SUPPORT", MIN_DD_BREAKPOINT_SUPPORT) +
     optional("--MIN_DD_MAP_DISTANCE", MIN_DD_MAP_DISTANCE) +
-    optional("--DD_REPORT_DUPLICATION_READS", DD_REPORT_DUPLICATION_READS) +
+    optional("--DD_REPORT_DUPLICATION_READS", DD_REPORT_DUPLICATION_READS)
 }
 
 object PindelCaller {
diff --git a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelConfig.scala b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelConfig.scala
index cef1c6ea2..825593043 100644
--- a/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelConfig.scala
+++ b/public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelConfig.scala
@@ -14,8 +14,8 @@
  * license, please contact us to obtain a separate license.
  */
 package nl.lumc.sasc.biopet.extensions.pindel
-
-import java.io.{PrintWriter, File}
+import collection.JavaConversions._
+import java.io.{ PrintWriter, File }
 
 import htsjdk.samtools.SamReaderFactory
 import nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
@@ -70,16 +70,13 @@ object PindelConfig extends ToolCommand {
     val commandArgs: Args = argsParser.parse(args, Args()) getOrElse sys.exit(1)
 
     val input: File = commandArgs.inputbam
-    val output: File = commandArgs.output.getOrElse( new File(input.getAbsoluteFile + ".pindel.cfg") )
+    val output: File = commandArgs.output.getOrElse(new File(input.getAbsoluteFile + ".pindel.cfg"))
     val insertsize: Int = commandArgs.insertsize.getOrElse(0)
 
-
     val bamReader = SamReaderFactory.makeDefault().open(input)
     val writer = new PrintWriter(output)
-    var sampleName: String = ""
-    for( readgroup <- bamReader.getFileHeader.getReadGroups() ) {
-      val rg = bamReader.getFileHeader.getReadGroup( readgroup )
-      writer.write( s"${input.getAbsoluteFile}\t${insertsize}\t${rg.getSample}")
+    for (readgroup <- bamReader.getFileHeader.getReadGroups().toList) {
+      writer.write(s"${input.getAbsoluteFile}\t${insertsize}\t${readgroup.getSample}\n")
     }
     bamReader.close()
     writer.close()
diff --git a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Pindel.scala b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Pindel.scala
index 17b669c08..0bccf63d8 100644
--- a/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Pindel.scala
+++ b/public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Pindel.scala
@@ -17,8 +17,8 @@ package nl.lumc.sasc.biopet.pipelines.shiva.svcallers
 
 import java.io.File
 
-import nl.lumc.sasc.biopet.core.{BiopetQScript, PipelineCommand}
-import nl.lumc.sasc.biopet.extensions.pindel.{PindelCaller, PindelCaller$, PindelConfig}
+import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
+import nl.lumc.sasc.biopet.extensions.pindel.{ PindelCaller, PindelCaller$, PindelConfig }
 import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
@@ -27,35 +27,12 @@ class Pindel(val root: Configurable) extends SvCaller {
   val name = "pindel"
 
   def this() = this(null)
-//
-//  @Input(doc = "Input file (bam)")
-//  var input: File = _
-//
-//  @Input(doc = "Reference Fasta file")
-//  var reference: File = _
-//
-//  @Argument(doc = "Work directory")
-//  var workdir: String = _
-//
-//  //  @Output(doc = "Pindel VCF output")
-//  //  lazy val outputvcf: File = {
-//  //    new File(workdir + "/" + input.getName.substring(0, input.getName.lastIndexOf(".bam")) + ".pindel.vcf")
-//  //  }
-//
-//  @Output(doc = "Pindel config")
-//  def configfile: File = {
-//    new File(workdir + "/" + input.getName.substring(0, input.getName.lastIndexOf(".bam")) + ".pindel.cfg")
-//  }
-//  @Output(doc = "Pindel raw output")
-//  def outputvcf: File = {
-//    new File(workdir + "/" + input.getName.substring(0, input.getName.lastIndexOf(".bam")) + ".pindel.vcf")
-//  }
 
   def biopetScript() {
     for ((sample, bamFile) <- inputBams) {
       val pindelDir = new File(outputDir, sample)
 
-      val config_file: File = new File( bamFile.getAbsolutePath + ".pindel.cfg" )
+      val config_file: File = new File(bamFile.getAbsolutePath + ".pindel.cfg")
       val cfg = new PindelConfig(this)
       cfg.input = bamFile
 
-- 
GitLab