JAL-653 GFF new/refactored helper classes
[jalview.git] / test / jalview / io / FeaturesFileTest.java
index 506ee91..7112c77 100644 (file)
@@ -256,7 +256,7 @@ public class FeaturesFileTest
     String gffData = "##gff-version 3\n"
             + "FER_CAPAA\tuniprot\tMETAL\t39\t39\t0.0\t.\t.\t"
             + "Note=Iron-sulfur (2Fe-2S);Note=another note;evidence=ECO:0000255|PROSITE-ProRule:PRU00465\n"
-            + "FER1_SOLLC\tuniprot\tPfam\t55\t130\t3.0\t.\t.";
+            + "FER1_SOLLC\tuniprot\tPfam\t55\t130\t3.0\t.\t.\tID=$23";
     FeaturesFile featuresFile = new FeaturesFile(gffData,
             FormatAdapter.PASTE);
     assertTrue("Failed to parse features file",
@@ -339,8 +339,8 @@ public class FeaturesFileTest
     assertEquals("no sequences extracted from GFF3 file", 2,
             dataset.getHeight());
   
-    SequenceI seq1 = dataset.findName("seq1"), seq2 = dataset
-            .findName("seq2");
+    SequenceI seq1 = dataset.findName("seq1");
+    SequenceI seq2 = dataset.findName("seq2");
     assertNotNull(seq1);
     assertNotNull(seq2);
     assertFalse(
@@ -402,8 +402,7 @@ public class FeaturesFileTest
     assertTrue(
             "Didn't read the alignment into an alignframe from Gff3 File",
             af != null);
-    // FIXME codon mappings are on the alignment but not on the dataset
-    checkDatasetfromSimpleGff3(af.getViewport().getAlignment()/* .getDataset() */);
+    checkDatasetfromSimpleGff3(af.getViewport().getAlignment());
   }
 
   @Test(groups = { "Functional" })
@@ -418,64 +417,4 @@ public class FeaturesFileTest
             parseResult);
     checkDatasetfromSimpleGff3(dataset);
   }
-
-  /**
-   * Tests loading exonerate GFF2 output, including 'similarity' alignment
-   * feature, on to sequences
-   */
-  @Test(groups = { "Functional" })
-  public void testExonerateImport()
-  {
-    FileLoader loader = new FileLoader(false);
-    AlignFrame af = loader.LoadFileWaitTillLoaded(
-            "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
-     */
-    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);
-  }
 }