JAL-2920 basic test for Description from features with/out description, variation...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 10 May 2018 10:35:11 +0000 (11:35 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 10 May 2018 10:35:11 +0000 (11:35 +0100)
test/jalview/ws/dbsources/UniprotTest.java

index f98ef85..c603a11 100644 (file)
@@ -63,6 +63,9 @@ public class UniprotTest
           + "<feature type=\"signal peptide\" evidence=\"7\"><location><begin position=\"1\"/><end position=\"18\"/></location></feature>"
           + "<feature type=\"propeptide\" description=\"Activation peptide\" id=\"PRO_0000027399\" evidence=\"9 16 17 18\"><location><begin position=\"19\"/><end position=\"20\"/></location></feature>"
           + "<feature type=\"chain\" description=\"Granzyme B\" id=\"PRO_0000027400\"><location><begin position=\"21\"/><end position=\"247\"/></location></feature>"
+          + "<feature type=\"sequence variant\"><original>M</original><variation>L</variation><location><position position=\"41\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><variation>L</variation><location><position position=\"41\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><location><position position=\"41\"/></location></feature>"
           + "<sequence length=\"10\" mass=\"27410\" checksum=\"8CB760AACF88FE6C\" modified=\"2008-01-15\" version=\"1\">MHAPL VSKDL</sequence></entry>"
           + "</uniprot>";
 
@@ -98,7 +101,7 @@ public class UniprotTest
      * Check sequence features
      */
     Vector<UniprotFeature> features = entry.getFeature();
-    assertEquals(3, features.size());
+    assertEquals(6, features.size());
     UniprotFeature sf = features.get(0);
     assertEquals("signal peptide", sf.getType());
     assertNull(sf.getDescription());
@@ -118,6 +121,27 @@ public class UniprotTest
     assertEquals(21, sf.getBegin());
     assertEquals(247, sf.getEnd());
 
+    sf = features.get(3);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Variation: 'L' Original: 'M'", sf.getDescription());
+    assertEquals(41, sf.getPosition());
+    assertEquals(41, sf.getBegin());
+    assertEquals(41, sf.getEnd());
+
+    sf = features.get(4);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Pathogenic Variation: 'L' Original: 'M'",
+            sf.getDescription());
+    assertEquals(41, sf.getPosition());
+    assertEquals(41, sf.getBegin());
+    assertEquals(41, sf.getEnd());
+
+    sf = features.get(5);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Pathogenic Original: 'M'", sf.getDescription());
+    assertEquals(41, sf.getPosition());
+    assertEquals(41, sf.getBegin());
+    assertEquals(41, sf.getEnd());
     /*
      * Check cross-references
      */