JAL-3187 update unit test - protein variants not now precomputed
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 17 Jun 2019 12:18:12 +0000 (13:18 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 17 Jun 2019 12:18:12 +0000 (13:18 +0100)
test/jalview/io/vcf/VCFLoaderTest.java

index a87c160..20cabbd 100644 (file)
@@ -1,6 +1,7 @@
 package jalview.io.vcf;
 
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
@@ -178,13 +179,18 @@ public class VCFLoaderTest
       }
     }
     List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
-    assertEquals(proteinFeatures.size(), 1);
-    sf = proteinFeatures.get(0);
-    assertEquals(sf.getFeatureGroup(), "VCF");
-    assertEquals(sf.getBegin(), 1);
-    assertEquals(sf.getEnd(), 1);
-    assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
-    assertEquals(sf.getDescription(), "p.Ser1Thr");
+
+    /*
+     * JAL-3187 don't precompute protein features, do dynamically instead
+     */
+    assertTrue(proteinFeatures.isEmpty());
+    // assertEquals(proteinFeatures.size(), 1);
+    // sf = proteinFeatures.get(0);
+    // assertEquals(sf.getFeatureGroup(), "VCF");
+    // assertEquals(sf.getBegin(), 1);
+    // assertEquals(sf.getEnd(), 1);
+    // assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
+    // assertEquals(sf.getDescription(), "p.Ser1Thr");
   }
 
   private File makeVcf() throws IOException
@@ -445,13 +451,17 @@ public class VCFLoaderTest
       }
     }
     List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
-    assertEquals(proteinFeatures.size(), 1);
-    sf = proteinFeatures.get(0);
-    assertEquals(sf.getFeatureGroup(), "VCF");
-    assertEquals(sf.getBegin(), 6);
-    assertEquals(sf.getEnd(), 6);
-    assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
-    assertEquals(sf.getDescription(), "p.Ala6Gly");
+    /*
+     * JAL-3187 don't precompute protein features, do dynamically instead
+     */
+    assertTrue(proteinFeatures.isEmpty());
+    // assertEquals(proteinFeatures.size(), 1);
+    // sf = proteinFeatures.get(0);
+    // assertEquals(sf.getFeatureGroup(), "VCF");
+    // assertEquals(sf.getBegin(), 6);
+    // assertEquals(sf.getEnd(), 6);
+    // assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
+    // assertEquals(sf.getDescription(), "p.Ala6Gly");
   }
 
   /**
@@ -605,20 +615,24 @@ public class VCFLoaderTest
       }
     }
     List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
-    SequenceFeatures.sortFeatures(proteinFeatures, true);
-    assertEquals(proteinFeatures.size(), 2);
-    sf = proteinFeatures.get(0);
-    assertEquals(sf.getFeatureGroup(), "VCF");
-    assertEquals(sf.getBegin(), 1);
-    assertEquals(sf.getEnd(), 1);
-    assertEquals(sf.getType(), SequenceOntologyI.SYNONYMOUS_VARIANT);
-    assertEquals(sf.getDescription(), "agC/agT");
-    sf = proteinFeatures.get(1);
-    assertEquals(sf.getFeatureGroup(), "VCF");
-    assertEquals(sf.getBegin(), 4);
-    assertEquals(sf.getEnd(), 4);
-    assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
-    assertEquals(sf.getDescription(), "p.Glu4Gly");
+    /*
+     * JAL-3187 don't precompute protein features, do dynamically instead
+     */
+    assertTrue(proteinFeatures.isEmpty());
+    // SequenceFeatures.sortFeatures(proteinFeatures, true);
+    // assertEquals(proteinFeatures.size(), 2);
+    // sf = proteinFeatures.get(0);
+    // assertEquals(sf.getFeatureGroup(), "VCF");
+    // assertEquals(sf.getBegin(), 1);
+    // assertEquals(sf.getEnd(), 1);
+    // assertEquals(sf.getType(), SequenceOntologyI.SYNONYMOUS_VARIANT);
+    // assertEquals(sf.getDescription(), "agC/agT");
+    // sf = proteinFeatures.get(1);
+    // assertEquals(sf.getFeatureGroup(), "VCF");
+    // assertEquals(sf.getBegin(), 4);
+    // assertEquals(sf.getEnd(), 4);
+    // assertEquals(sf.getType(), SequenceOntologyI.NONSYNONYMOUS_VARIANT);
+    // assertEquals(sf.getDescription(), "p.Glu4Gly");
 
     /*
      * verify variant feature(s) added to transcript4