JAL-3832 Gui working, with 3DBeacons parameters
authorarngucci <arnaud.gucciardi@gmail.com>
Mon, 12 Apr 2021 14:05:35 +0000 (16:05 +0200)
committerJim Procter <j.procter@dundee.ac.uk>
Mon, 30 Aug 2021 11:17:32 +0000 (12:17 +0100)
resources/fts/tdbeacons_data_columns.txt
src/jalview/fts/core/FTSDataColumnPreferences.java
test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java

index 31d85c6..350b9e8 100644 (file)
@@ -40,11 +40,11 @@ _data_column.max_col_width
 _data_column.preferred_col_width
 _data_column.is_shown_by_default
 _data_column.is_searchable
-Sequence;aligned_sequence;String;g1;80;150;85;true;true
 Model id;model_identifier;String;g2;80;150;85;true;true
+Sequence;aligned_sequence;String;g1;80;150;85;true;true
 Provider;provider;String;g1;80;150;85;true;true
 Uniprot Id;id;String;g2;80;150;85;true;true
 UniProt Accession;uniprot_accession;String;g2;50;400;95;true;false
-Entry Name;entry name;String;g2;100;150;105;true;true 
+Entry Name;entry_name;String;g2;100;150;105;true;true 
 Url;model_url;String;g1;100;150;105;true;true
-Qmean;qmean_avg_local_score;double;g3;100;150;105;true;true
+Qmean;qmean_avg_local_score;double;g2;100;150;105;true;false
index e5042ae..f865ac3 100644 (file)
@@ -96,11 +96,12 @@ public class FTSDataColumnPreferences extends JScrollPane
       break;
     }
 
-    Object[][] data = new Object[allFTSDataColumns.size() - 1][3];
+    Object[][] data = new Object[allFTSDataColumns.size()][3];
 
     int x = 0;
     for (FTSDataColumnI field : allFTSDataColumns)
-    {
+    {   
+      //System.out.println("allFTSDataColumns==" + allFTSDataColumns);
       if (field.getName().equalsIgnoreCase("all"))
       {
         continue;
@@ -112,6 +113,7 @@ public class FTSDataColumnPreferences extends JScrollPane
         data[x++] = new Object[] { ftsRestClient
                 .getAllDefaultDisplayedFTSDataColumns().contains(field),
             field.getName(), field.getGroup() };
+        //System.out.println(" PUIS " + field.getName() + " ET AUSSI " + field.getGroup() + "X = " + x);
         break;
       case STRUCTURE_CHOOSER:
         data[x++] = new Object[] { structSummaryColumns.contains(field),
index b144aa5..539af37 100644 (file)
@@ -63,15 +63,15 @@ public class TDBeaconsFTSRestClientTest
   
   @Test
   public void getAllDefaulDisplayedDataColumns()
-  {
+  {     
+    // to change when resources.tdbeacons_data_columns.txt is changed
     Assert.assertNotNull(ftsRestClient
             .getAllDefaultDisplayedFTSDataColumns());
     System.out.println(ftsRestClient.getAllDefaultDisplayedFTSDataColumns());
     Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
             .isEmpty());
     Assert.assertEquals(ftsRestClient
-            .getAllDefaultDisplayedFTSDataColumns().size(), 3);
-    // currently 3, may change -> change this test and the nexts accordingly
+            .getAllDefaultDisplayedFTSDataColumns().size(), 8);
   }
   
   @Test(groups = { "Functional" })
@@ -85,10 +85,10 @@ public class TDBeaconsFTSRestClientTest
       Assert.assertEquals(foundIndex, -1);
       foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields,
               false);
-      Assert.assertEquals(foundIndex, 0);
+      Assert.assertEquals(foundIndex, 1);
       foundIndex = ftsRestClient
               .getPrimaryKeyColumIndex(wantedFields, true);
-      Assert.assertEquals(foundIndex, 1);
+      Assert.assertEquals(foundIndex, 2);
     } catch (Exception e)
     {
       e.printStackTrace();
@@ -99,12 +99,13 @@ public class TDBeaconsFTSRestClientTest
   @Test(groups = { "Functional" })
   public void getDataColumnsFieldsAsCommaDelimitedString()
   {
+    // to change when resources.tdbeacons_data_columns.txt is changed
     Collection<FTSDataColumnI> wantedFields = ftsRestClient
             .getAllDefaultDisplayedFTSDataColumns();
     String actual = ftsRestClient
             .getDataColumnsFieldsAsCommaDelimitedString(wantedFields);
     Assert.assertEquals(actual,
-            "id,uniprot_accession,entry name");
+            "aligned_sequence,model_identifier,provider,id,uniprot_accession,entry_name,model_url,qmean_avg_local_score");
   }
   
   @Test(groups = { "Functional" })
@@ -114,27 +115,29 @@ public class TDBeaconsFTSRestClientTest
             .getAllFTSDataColumns();
     Assert.assertNotNull(allFields);
     //System.out.println(allFields.size());
-    Assert.assertEquals(allFields.size(), 3);
+    Assert.assertEquals(allFields.size(), 8);
   }
   
   @Test(groups = { "Functional" })
   public void getSearchableDataColumns()
-  {
+  {     
+    // to change when resources.tdbeacons_data_columns.txt is changed
     Collection<FTSDataColumnI> searchableFields = ftsRestClient
             .getSearchableDataColumns();
     Assert.assertNotNull(searchableFields);
     //System.out.println(searchableFields.size());
-    Assert.assertEquals(searchableFields.size(), 1); //only 1, as of first 3DB test
+    Assert.assertEquals(searchableFields.size(), 6); //only 1, as of first 3DB test
   }
   
   @Test(groups = { "Functional" })
   public void getPrimaryKeyColumn()
-  {
+  { 
+    // to change when resources.tdbeacons_data_columns.txt is changed
     FTSDataColumnI expectedPKColumn;
     try
     {
       expectedPKColumn = ftsRestClient
-              .getDataColumnByNameOrCode("Uniprot Id");
+              .getDataColumnByNameOrCode("Model id");
       Assert.assertNotNull(ftsRestClient.getPrimaryKeyColumn());
       Assert.assertEquals(ftsRestClient.getPrimaryKeyColumn(),
               expectedPKColumn);