X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2Fgff%2FExonerateHelperTest.java;h=ce52ee51a4dfb4be002cfed972b8a5351d944444;hb=528c0f1815bc67b54618ad5b16c2162946974caf;hp=54d6eb24765f3f1ebf43eaa7851054d8b96b92e2;hpb=2cef2c13e720e889304333e70f893a23d1a98f42;p=jalview.git diff --git a/test/jalview/io/gff/ExonerateHelperTest.java b/test/jalview/io/gff/ExonerateHelperTest.java index 54d6eb2..ce52ee5 100644 --- a/test/jalview/io/gff/ExonerateHelperTest.java +++ b/test/jalview/io/gff/ExonerateHelperTest.java @@ -238,20 +238,19 @@ public class ExonerateHelperTest { FileLoader loader = new FileLoader(false); AlignFrame af = loader.LoadFileWaitTillLoaded( - "examples/testdata/exonerateseqs.fa", - FormatAdapter.FILE); - + "examples/testdata/exonerateseqs.fa", FormatAdapter.FILE); + af.loadJalviewDataFile("examples/testdata/exonerateoutput.gff", FormatAdapter.FILE, null, null); - + /* * verify one mapping to a dummy sequence, one to a real one */ - List mappings = af - .getViewport().getAlignment().getDataset().getCodonFrames(); + List mappings = af.getViewport().getAlignment() + .getDataset().getCodonFrames(); assertEquals(2, mappings.size()); Iterator iter = mappings.iterator(); - + // first mapping is to dummy sequence AlignedCodonFrame mapping = iter.next(); Mapping[] mapList = mapping.getProtMappings(); @@ -262,7 +261,7 @@ public class ExonerateHelperTest // 143 in protein should map to codon [11270, 11269, 11268] in dna int[] mappedRegion = mapList[0].getMap().locateInFrom(143, 143); assertArrayEquals(new int[] { 11270, 11268 }, mappedRegion); - + // second mapping is to a sequence in the alignment mapping = iter.next(); mapList = mapping.getProtMappings(); @@ -271,23 +270,23 @@ public class ExonerateHelperTest .findName("DDB_G0280897"); assertSame(proteinSeq.getDatasetSequence(), mapList[0].getTo()); assertEquals(1, mapping.getdnaToProt().length); - + // 143 in protein should map to codon [11270, 11269, 11268] in dna mappedRegion = mapList[0].getMap().locateInFrom(143, 143); assertArrayEquals(new int[] { 11270, 11268 }, mappedRegion); - + // 182 in protein should map to codon [11153, 11152, 11151] in dna mappedRegion = mapList[0].getMap().locateInFrom(182, 182); assertArrayEquals(new int[] { 11153, 11151 }, mappedRegion); - + // and the reverse mapping: mappedRegion = mapList[0].getMap().locateInTo(11151, 11153); assertArrayEquals(new int[] { 182, 182 }, mappedRegion); - + // 11150 in dna should _not_ map to protein mappedRegion = mapList[0].getMap().locateInTo(11150, 11150); assertNull(mappedRegion); - + // similarly 183 in protein should _not_ map to dna mappedRegion = mapList[0].getMap().locateInFrom(183, 183); assertNull(mappedRegion);