JAL-1720 renamed Structure Chooser filters according to suggestions from Jim. Also...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 23 Feb 2016 10:03:34 +0000 (10:03 +0000)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 23 Feb 2016 10:03:34 +0000 (10:03 +0000)
src/jalview/gui/StructureChooser.java
src/jalview/ws/dbsources/PDBRestClient.java

index 7d0d76a..5d381b9 100644 (file)
@@ -382,6 +382,19 @@ public class StructureChooser extends GStructureChooser implements
                 .getStructureSummaryFields();
         Collection<PDBResponseSummary> filteredResponse = new HashSet<PDBResponseSummary>();
         HashSet<String> errors = new HashSet<String>();
+        // try
+        // {
+        // PDBDocField fiterField = PDBRestClient
+        // .getPDBDocFieldByCode(fieldToFilterBy);
+        // if (!wantedFields.contains(fiterField))
+        // {
+        // wantedFields.add(fiterField);
+        // }
+        // } catch (Exception e)
+        // {
+        // e.printStackTrace();
+        // }
+
         for (SequenceI seq : selectedSequences)
         {
           PDBRestRequest pdbRequest = new PDBRestRequest();
@@ -507,15 +520,15 @@ public class StructureChooser extends GStructureChooser implements
     {
       cmb_filterOption.addItem(new FilterOption("Best Quality",
               PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
-      cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
+      cmb_filterOption.addItem(new FilterOption("Most UniProt Coverage",
               PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
-      cmb_filterOption.addItem(new FilterOption("Highest Resolution",
+      cmb_filterOption.addItem(new FilterOption("Best Resolution",
               PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
-      cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
+      cmb_filterOption.addItem(new FilterOption("Most Protein Chain",
               PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
-      cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
+      cmb_filterOption.addItem(new FilterOption("Most Bound Molecules",
               PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
-      cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
+      cmb_filterOption.addItem(new FilterOption("Most Polymer Residues",
               PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
     }
     cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
index 2c05acd..8e08c84 100644 (file)
@@ -333,6 +333,19 @@ public class PDBRestClient
     return pdbFieldIndexCounter;
   }
 
+  public static PDBDocField getPDBDocFieldByCode(String fieldCode)
+          throws Exception
+  {
+    for (PDBDocField curPDBDocField : PDBDocField.values())
+    {
+      if (curPDBDocField.getCode().equalsIgnoreCase(fieldCode))
+      {
+        return curPDBDocField;
+      }
+    }
+    throw new Exception("PDB doc Field not found!");
+  }
+
   /**
    * This enum represents the fields available in the PDB JSON response
    *