From 1b165e17854bb1bf34f1c9bcb665109dd101ac36 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Mon, 27 Oct 2014 09:44:25 +0100
Subject: [PATCH] Switch to Gatk/Queue 3.3

---
 biopet-framework/pom.xml                                  | 2 +-
 .../sasc/biopet/extensions/gatk/HaplotypeCaller.scala     | 2 --
 .../nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala  | 3 ++-
 .../nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala     | 8 +++++---
 .../main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala  | 7 ++++---
 mvn_install_queue.sh                                      | 4 ++--
 6 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/biopet-framework/pom.xml b/biopet-framework/pom.xml
index d735e4bbd..8385a13dd 100644
--- a/biopet-framework/pom.xml
+++ b/biopet-framework/pom.xml
@@ -49,7 +49,7 @@
         <dependency>
             <groupId>org.broadinstitute.gatk</groupId>
             <artifactId>gatk-queue-package-distribution</artifactId>
-            <version>3.2</version>
+            <version>3.3</version>
         </dependency>
         <dependency>
             <groupId>io.argonaut</groupId>
diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/HaplotypeCaller.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/HaplotypeCaller.scala
index 640035455..a83ee965e 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/HaplotypeCaller.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/HaplotypeCaller.scala
@@ -27,12 +27,10 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
 
     if (config("inputtype", default = "dna").getString == "rna") {
       dontUseSoftClippedBases = config("dontusesoftclippedbases", default = true)
-      recoverDanglingHeads = config("recoverdanglingheads", default = true)
       stand_call_conf = config("stand_call_conf", default = 5)
       stand_emit_conf = config("stand_emit_conf", default = 0)
     } else {
       dontUseSoftClippedBases = config("dontusesoftclippedbases", default = false)
-      recoverDanglingHeads = config("recoverdanglingheads", default = false)
       stand_call_conf = config("stand_call_conf", default = 5)
       stand_emit_conf = config("stand_emit_conf", default = 0)
     }
diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
index 2d822e2c6..315a8db8c 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
@@ -1,6 +1,7 @@
 package nl.lumc.sasc.biopet.tools
 
 import htsjdk.samtools.SAMFileReader
+import htsjdk.samtools.QueryInterval
 import htsjdk.samtools.SAMRecord
 import htsjdk.variant.variantcontext.VariantContext
 import htsjdk.variant.variantcontext.VariantContextBuilder
@@ -84,7 +85,7 @@ object CheckAllelesVcfInBam extends ToolCommand {
       val countReports: Map[String,CountReport] = bamReaders.map(x => (x._1, new CountReport))
       val refAllele = vcfRecord.getReference.getBaseString
       for ((sample, bamReader) <- bamReaders) {
-        val queryInterval = new SAMFileReader.QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getChr), 
+        val queryInterval = new QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getChr), 
                                                             vcfRecord.getStart, vcfRecord.getStart + refAllele.size - 1)
         val bamIter = bamReader.query(Array(queryInterval), false)
         
diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
index 06ae6b64f..add0849bc 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
@@ -16,7 +16,9 @@
 
 package nl.lumc.sasc.biopet.tools
 
+import htsjdk.samtools.QueryInterval
 import htsjdk.samtools.SAMFileReader
+import htsjdk.samtools.ValidationStringency
 import htsjdk.samtools.SAMRecord
 import java.io.File
 import nl.lumc.sasc.biopet.core.ToolCommand
@@ -41,7 +43,7 @@ object FindRepeatsPacBio extends ToolCommand {
     val argsParser = new OptParser
     val commandArgs: Args = argsParser.parse(args, Args()) getOrElse sys.exit(1)
     val bamReader = new SAMFileReader(commandArgs.inputBam)
-    bamReader.setValidationStringency(SAMFileReader.ValidationStringency.SILENT)
+    bamReader.setValidationStringency(ValidationStringency.SILENT)
     val bamHeader = bamReader.getFileHeader
     
     val header = List("chr", "startPos", "stopPos","Repeat_seq", "repeatLength", 
@@ -51,7 +53,7 @@ object FindRepeatsPacBio extends ToolCommand {
     
     for (bedLine <- Source.fromFile(commandArgs.inputBed).getLines;
       val values = bedLine.split("\t"); if values.size >= 3) {
-      val interval = new SAMFileReader.QueryInterval(bamHeader.getSequenceIndex(values(0)), values(1).toInt, values(2).toInt)
+      val interval = new QueryInterval(bamHeader.getSequenceIndex(values(0)), values(1).toInt, values(2).toInt)
       val bamIter = bamReader.query(Array(interval), false)
       val results = for (samRecord <-bamIter) yield procesSamrecord(samRecord, interval)
       val chr = values(0)
@@ -100,7 +102,7 @@ object FindRepeatsPacBio extends ToolCommand {
     }
   }
   
-  def procesSamrecord(samRecord:SAMRecord, interval:SAMFileReader.QueryInterval): Option[Result] = {
+  def procesSamrecord(samRecord:SAMRecord, interval:QueryInterval): Option[Result] = {
     val readStartPos = List.range(0, samRecord.getReadBases.length)
           .find(x => samRecord.getReferencePositionAtReadPosition(x) >= interval.start)
     var readPos = if (readStartPos.isEmpty) return None else readStartPos.get
diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
index 4e3d118ce..a990bab67 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
@@ -10,7 +10,8 @@ import scala.collection.JavaConverters._
 
 import htsjdk.samtools.AlignmentBlock
 import htsjdk.samtools.SAMFileReader
-import htsjdk.samtools.SAMFileReader.QueryInterval
+import htsjdk.samtools.QueryInterval
+import htsjdk.samtools.ValidationStringency
 import htsjdk.samtools.SAMFileWriterFactory
 import htsjdk.samtools.SAMRecord
 import htsjdk.tribble.AbstractFeatureReader.getFeatureReader
@@ -161,7 +162,7 @@ object WipeReads extends ToolCommand {
         new SAMFileReader(inBAM, inBAMIndex)
       else {
         val sfr = new SAMFileReader(inBAM)
-        sfr.setValidationStringency(SAMFileReader.ValidationStringency.LENIENT)
+        sfr.setValidationStringency(ValidationStringency.LENIENT)
         if (!sfr.hasIndex)
           throw new IllegalStateException("Input BAM file must be indexed")
         else
@@ -314,7 +315,7 @@ object WipeReads extends ToolCommand {
       .setUseAsyncIo(async)
 
     val templateBAM = new SAMFileReader(inBAM)
-    templateBAM.setValidationStringency(SAMFileReader.ValidationStringency.LENIENT)
+    templateBAM.setValidationStringency(ValidationStringency.LENIENT)
 
     val targetBAM = factory.makeBAMWriter(templateBAM.getFileHeader, true, outBAM)
 
diff --git a/mvn_install_queue.sh b/mvn_install_queue.sh
index 3e5d12fdd..3bd9be7ca 100755
--- a/mvn_install_queue.sh
+++ b/mvn_install_queue.sh
@@ -1,6 +1,6 @@
-JAR=/data/DIV5/SASC/common/programs/Queue-3.2-2/Queue.jar
+JAR=/data/DIV5/SASC/common/programs/Queue-3.3-0/Queue.jar
 ID=gatk-queue-package-distribution
-VERSION=3.2
+VERSION=3.3
 GROUP=org.broadinstitute.gatk
 
 mvn install:install-file -Dfile=$JAR -DgroupId=$GROUP -DartifactId=$ID -Dversion=$VERSION -Dpackaging=jar
-- 
GitLab