JAL-3010 cache synonyms for Sequence Ontology terms
[jalview.git] / test / jalview / datamodel / ontology / OntologyBaseTest.java
index 937d260..64812c3 100644 (file)
@@ -29,7 +29,7 @@ public class OntologyBaseTest
   }
 
   @Test(groups = "Functional")
-  public void testfindSequenceOntologyGroupings()
+  public void testfindSequenceOntologyGroupings_nucleotide()
   {
     /*
      * typical gnomAD feature types, plus the top level 'sequence_variant' as in dbSNP
@@ -42,11 +42,7 @@ public class OntologyBaseTest
             "missense_variant");
 
     /*
-     * for stop_gained:
-     * transcript_variant further adds 5_prime_UTR_variant, 
-     *     non_coding_transcript_exon_variant, synonymous_variant, splice_region_variant
-     * feature_variant further adds upstream_gene_variant
-     * sequence_variant further adds sequence_variant
+     * hierarchy from stop_gained
      */
     Map<String, List<String>> map = SequenceOntologyFactory.getInstance()
             .findSequenceOntologyGroupings("stop_gained", featureTypes);
@@ -145,4 +141,24 @@ public class OntologyBaseTest
                     + "stop_lost, synonymous_variant, upstream_gene_variant]");
   }
 
+  @Test(groups = "Functional")
+  public void testfindSequenceOntologyGroupings_peptide()
+  {
+    /*
+     * typical Uniprot feature types
+     */
+    List<String> featureTypes = Arrays.asList("BETA-TURN-IR", "NEST-RL",
+            "BETA-BULGE", "ALPHA-BETA-MOTIF", "ASX-TURN-IR",
+            "GAMMA-TURN-CLASSIC", "GAMMA-TURN-INVERSE", "BETA-TURN-IL",
+            "BETA-TURN-IIL");
+  
+    /*
+     * hierarchy from GAMMA-TURN-INVERSE
+     * this is a synonym for 
+     */
+    Map<String, List<String>> map = SequenceOntologyFactory.getInstance()
+            .findSequenceOntologyGroupings("TURN", featureTypes);
+    assertEquals(map.size(), 10);
+  }
+
 }