From ab75933799b58cfcc4414fd1fd3b37b09364f871 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 1 Aug 2015 13:32:18 +0200
Subject: [PATCH] Replace getChr for getContig

---
 .../scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala  | 2 +-
 .../nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala      | 2 +-
 .../main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala   | 2 +-
 .../src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala   | 4 ++--
 .../src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala   | 2 +-
 .../src/main/scala/nl/lumc/sasc/biopet/tools/VcfWithVcf.scala | 4 ++--
 .../src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala  | 2 +-
 7 files changed, 9 insertions(+), 9 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 2646ea961..6136c146b 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
@@ -137,7 +137,7 @@ object AnnotateVcfWithBed extends ToolCommand {
     logger.info("Start reading vcf records")
 
     for (record <- reader) {
-      val overlaps = bedRecords.getOrElse(record.getChr, Nil).filter(x => {
+      val overlaps = bedRecords.getOrElse(record.getContig, Nil).filter(x => {
         record.getStart <= x._2 && record.getEnd >= x._1
       })
       if (overlaps.isEmpty) {
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
index ba148881c..2797ffc2d 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
@@ -97,7 +97,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 QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getChr),
+        val queryInterval = new QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getContig),
           vcfRecord.getStart, vcfRecord.getStart + refAllele.length - 1)
         val bamIter = bamReader.query(Array(queryInterval), false)
 
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
index 892ce397d..8a5b05f6e 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
@@ -131,7 +131,7 @@ object MergeAlleles extends ToolCommand {
     }
     val alleles: mutable.Set[Allele] = mutable.Set()
     val builder = new VariantContextBuilder
-    builder.chr(records.head.getChr)
+    builder.chr(records.head.getContig)
     builder.start(records.head.getStart)
 
     for (record <- records) {
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
index d34e8cf9d..47af91bf3 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
@@ -542,7 +542,7 @@ object VcfStats extends ToolCommand {
       else addToBuffer(tag, value, found = true)
     }
 
-    Map(record.getChr -> buffer.toMap, "total" -> buffer.toMap)
+    Map(record.getContig -> buffer.toMap, "total" -> buffer.toMap)
   }
 
   /** Function to check sample/genotype specific stats */
@@ -593,7 +593,7 @@ object VcfStats extends ToolCommand {
       else addToBuffer(tag, value, found = true)
     }
 
-    Map(record.getChr -> buffer.toMap, "total" -> buffer.toMap)
+    Map(record.getContig -> buffer.toMap, "total" -> buffer.toMap)
   }
 
   /** Function to write 1 specific genotype field */
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
index ab1f9d8cb..995efcdd2 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
@@ -109,7 +109,7 @@ object VcfToTsv extends ToolCommand {
     writer.println(sortedFields.mkString("#", commandArgs.separator, ""))
     for (vcfRecord <- reader) {
       val values: mutable.Map[String, Any] = mutable.Map()
-      values += "CHROM" -> vcfRecord.getChr
+      values += "CHROM" -> vcfRecord.getContig
       values += "POS" -> vcfRecord.getStart
       values += "ID" -> vcfRecord.getID
       values += "REF" -> vcfRecord.getReference.getBaseString
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfWithVcf.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfWithVcf.scala
index 9009d2918..2415d89a2 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfWithVcf.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfWithVcf.scala
@@ -103,10 +103,10 @@ object VcfWithVcf extends ToolCommand {
     var counter = 0
     for (record <- reader) {
       val secondaryRecords = if (commandArgs.matchAllele) {
-        secondaryReader.query(record.getChr, record.getStart, record.getEnd).toList.
+        secondaryReader.query(record.getContig, record.getStart, record.getEnd).toList.
           filter(x => record.getAlternateAlleles.exists(x.hasAlternateAllele))
       } else {
-        secondaryReader.query(record.getChr, record.getStart, record.getEnd).toList
+        secondaryReader.query(record.getContig, record.getStart, record.getEnd).toList
       }
 
       val fieldMap = (for (
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
index f010c1cc7..96a9dc436 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala
@@ -87,7 +87,7 @@ object WipeReads extends ToolCommand {
     def makeIntervalFromBed(inFile: File): Iterator[Interval] =
       asScalaIteratorConverter(getFeatureReader(inFile.toPath.toString, new BEDCodec(), false).iterator)
         .asScala
-        .map(x => new Interval(x.getChr, x.getStart, x.getEnd))
+        .map(x => new Interval(x.getContig, x.getStart, x.getEnd))
 
     /**
      * Parses a refFlat file to yield Interval objects
-- 
GitLab