From 997598e2e68688b91b27a9bb08ecf7cddaf7b2a8 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 10 Jan 2015 18:41:41 +0100
Subject: [PATCH] Fix sorting

---
 .../nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala    | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
index 954334f89..921c04aaf 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
@@ -71,13 +71,7 @@ object AnnotateVcfWithBed extends ToolCommand {
 
     // Sort records when needed
     for ((chr, record) <- bedRecords) {
-      bedRecords(chr) = record.sortWith((first, second) => {
-        if (first._1 > second._1) true
-        else if (first._1 < second._1) false
-        else if (first._2 > second._2) true
-        else if (first._2 < second._2) false
-        else true
-      })
+      bedRecords(chr) = record.sortBy(x => (x._1, x._2))
     }
 
     val reader = new VCFFileReader(commandArgs.inputFile, false)
-- 
GitLab