From 4bc5011afd8738293cd11d7fe8f28baf894c9051 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 28 Oct 2020 23:24:47 +0000 Subject: [PATCH] =?utf8?q?JAL-3725=20fix=20tests=20for=20EMBLFlatFile=20pars?= =?utf8?q?er=20when=20mapping=20doesn=E2=80=99t=20include=20stop=20codon?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/jalview/io/EmblFlatFileTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/jalview/io/EmblFlatFileTest.java b/test/jalview/io/EmblFlatFileTest.java index 5d8ef21..2465f27 100644 --- a/test/jalview/io/EmblFlatFileTest.java +++ b/test/jalview/io/EmblFlatFileTest.java @@ -173,7 +173,7 @@ public class EmblFlatFileTest { assertEquals((ranges = map.getFromRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1579); - assertEquals(ranges.get(0)[1], 2934); + assertEquals(ranges.get(0)[1], 2931); assertEquals((ranges = map.getToRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1); assertEquals(ranges.get(0)[1], 451); @@ -185,7 +185,7 @@ public class EmblFlatFileTest { assertEquals((ranges = map.getFromRanges()).size(), 1); assertEquals(ranges.get(0)[0], 2928); - assertEquals(ranges.get(0)[1], 3992); + assertEquals(ranges.get(0)[1], 3989); assertEquals((ranges = map.getToRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1); assertEquals(ranges.get(0)[1], 354); @@ -194,7 +194,7 @@ public class EmblFlatFileTest { assertEquals((ranges = map.getFromRanges()).size(), 1); assertEquals(ranges.get(0)[0], 4054); - assertEquals(ranges.get(0)[1], 4848); + assertEquals(ranges.get(0)[1], 4845); assertEquals((ranges = map.getToRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1); assertEquals(ranges.get(0)[1], 264); @@ -206,7 +206,7 @@ public class EmblFlatFileTest assertEquals(ranges.get(0)[0], 7022); assertEquals(ranges.get(0)[1], 7502); assertEquals(ranges.get(1)[0], 1); - assertEquals(ranges.get(1)[1], 437); + assertEquals(ranges.get(1)[1], 434); assertEquals((ranges = map.getToRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1); assertEquals(ranges.get(0)[1], 305); @@ -216,7 +216,7 @@ public class EmblFlatFileTest // complement(488..1480) assertEquals((ranges = map.getFromRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1480); - assertEquals(ranges.get(0)[1], 488); + assertEquals(ranges.get(0)[1], 491); assertEquals((ranges = map.getToRanges()).size(), 1); assertEquals(ranges.get(0)[0], 1); assertEquals(ranges.get(0)[1], 330); @@ -312,11 +312,12 @@ public class EmblFlatFileTest { int[] exons = new int[] { 11, 15, 21, 25, 31, 38 }; // 18 bp + int[] exons_nostop = new int[] { 11, 15, 21, 25, 31, 35 }; // 15 bp // exact length match: assertSame(exons, EmblFlatFile.adjustForProteinLength(6, exons)); - // match if we assume exons include stop codon not in protein: - assertSame(exons, EmblFlatFile.adjustForProteinLength(5, exons)); + // trimmed if we assume exons include stop codon not in protein: + assertEquals(Arrays.toString(exons_nostop), Arrays.toString(EmblFlatFile.adjustForProteinLength(5, exons))); // truncate last exon by 6bp int[] truncated = EmblFlatFile.adjustForProteinLength(4, exons); -- 1.7.10.2