- Set<AlignedCodonFrame> mappings = af
- .getViewport().getAlignment().getDataset().getCodonFrames();
- assertEquals(2, mappings.size());
- Iterator<AlignedCodonFrame> iter = mappings.iterator();
-
- // first mapping is to dummy sequence
- AlignedCodonFrame mapping = iter.next();
- Mapping[] mapList = mapping.getProtMappings();
- assertEquals(1, mapList.length);
- assertTrue(mapList[0].getTo() instanceof SequenceDummy);
- assertEquals("DDB_G0269124", mapList[0].getTo().getName());
-
- // second mapping is to a sequence in the alignment
- mapping = iter.next();
- mapList = mapping.getProtMappings();
- assertEquals(1, mapList.length);
- SequenceI proteinSeq = af.getViewport().getAlignment()
- .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
- int[] 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);
+ expected = "METAL\tcc9900\n"
+ + "Pfam\tff0000\n"
+ + "GAMMA-TURN\tff0000|00ffff|20.0|95.0|below|66.0\n"
+ + "\nSTARTGROUP\tuniprot\n"
+ + "Iron\tFER_CAPAA\t-1\t39\t39\tMETAL\t0.0\n"
+ + "Turn\tFER_CAPAA\t-1\t36\t38\tGAMMA-TURN\t0.0\n"
+ + "<html>Pfam domain<a href=\"http://pfam.xfam.org/family/PF00111\">Pfam_3_4</a></html>\tFER_CAPAA\t-1\t20\t20\tPfam\t0.0\n"
+ + "ENDGROUP\tuniprot\n";
+ assertEquals(expected, exported);