From: Jim Procter Date: Wed, 28 Oct 2020 23:24:47 +0000 (+0000) Subject: JAL-3725 fix tests for EMBLFlatFile parser when mapping doesn’t include stop codon X-Git-Tag: Release_2_11_1_3~5^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4bc5011afd8738293cd11d7fe8f28baf894c9051;p=jalview.git JAL-3725 fix tests for EMBLFlatFile parser when mapping doesn’t include stop codon --- 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);