Merge branch 'develop' of https://source.jalview.org/git/jalview into develop
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 15 Jun 2016 15:02:30 +0000 (16:02 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 15 Jun 2016 15:02:30 +0000 (16:02 +0100)
resources/fts/uniprot_data_columns.txt
src/jalview/gui/StructureChooser.java
test/jalview/fts/core/FTSRestClientTest.java
test/jalview/gui/StructureChooserTest.java

index fccf3bb..f506648 100644 (file)
@@ -110,7 +110,7 @@ Caution;comment(CAUTION);String;g6;50;1000;95;false;false
 Miscellaneous [CC];comment(GENERAL);String;g6;50;1000;95;false;false
 Keywords;keywords|keyword;String;g6;50;1000;95;false;true
 Protein existence;existence;String;g6;50;1000;95;false;true
-ALL;Search All;String;g7;50;1000;95;false;true;
+ALL;Search All;String;g7;50;1000;95;false;true
 Subunit structure [CC];comment(SUBUNIT);String;g9;50;1000;95;false;false
 Interacts with;interactor;String;g9;50;1000;95;false;false
 Developmental stage;comment(DEVELOPMENTAL STAGE);String;g10;50;1000;95;false;false
index 3d80f79..fd2de8e 100644 (file)
@@ -338,7 +338,7 @@ public class StructureChooser extends GStructureChooser implements
    * @param seqName
    * @return
    */
-  private static String sanitizeSeqName(String seqName)
+  static String sanitizeSeqName(String seqName)
   {
     Objects.requireNonNull(seqName);
     return seqName.replaceAll("\\[\\d*\\]", "")
index 5ceb5cd..eae5575 100644 (file)
@@ -95,7 +95,7 @@ public class FTSRestClientTest
     Collection<FTSDataColumnI> searchalbeFields = ftsRestClient
             .getSearchableDataColumns();
     Assert.assertNotNull(searchalbeFields);
-    Assert.assertEquals(searchalbeFields.size(), 30);
+    Assert.assertEquals(searchalbeFields.size(), 22);
   }
 
   @Test(groups = { "Functional" })
@@ -237,11 +237,12 @@ public class FTSRestClientTest
             .getSearchableDataColumns();
     for (FTSDataColumnI foundCol : searchableCols)
     {
+      System.out.println(foundCol.toString());
       uniqueSet.add(foundCol);
       uniqueSet.add(foundCol);
     }
     Assert.assertTrue(!uniqueSet.isEmpty());
-    Assert.assertEquals(uniqueSet.size(), 30);
+    Assert.assertEquals(uniqueSet.size(), 22);
   }
 
   @Test(groups = { "Functional" })
index c2209d6..ae6bf38 100644 (file)
@@ -116,4 +116,22 @@ public class StructureChooserTest
     assertTrue(sc.getDiscoveredStructuresSet().size() > 0);
 
   }
+
+  @Test(groups = { "Functional" })
+  public void sanitizeSeqNameTest()
+  {
+    String name = "ab_cdEF|fwxyz012349";
+    assertEquals(name, StructureChooser.sanitizeSeqName(name));
+
+    // remove a [nn] substring
+    name = "abcde12[345]fg";
+    assertEquals("abcde12fg", StructureChooser.sanitizeSeqName(name));
+
+    // remove characters other than a-zA-Z0-9 | or _
+    name = "ab[cd],.\t£$*!- \\\"@:e";
+    assertEquals("abcde", StructureChooser.sanitizeSeqName(name));
+
+    name = "abcde12[345a]fg";
+    assertEquals("abcde12345afg", StructureChooser.sanitizeSeqName(name));
+  }
 }