JAL-2026 Bug fix for best quality filter
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 11 Mar 2016 17:04:56 +0000 (17:04 +0000)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 11 Mar 2016 17:04:56 +0000 (17:04 +0000)
src/jalview/gui/StructureChooser.java
src/jalview/ws/dbsources/PDBRestClient.java

index d313002..2e396aa 100644 (file)
@@ -399,18 +399,6 @@ 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)
         {
index 05dab95..a36fdd4 100644 (file)
@@ -75,10 +75,27 @@ public class PDBRestClient
               .getWantedFields());
       int responseSize = (pdbRestRequest.getResponseSize() == 0) ? DEFAULT_RESPONSE_SIZE
               : pdbRestRequest.getResponseSize();
-      String sortParam = (pdbRestRequest.getFieldToSortBy() == null || pdbRestRequest
-              .getFieldToSortBy().trim().isEmpty()) ? "" : (pdbRestRequest
-              .getFieldToSortBy() + (pdbRestRequest.isAscending() ? " asc"
-              : " desc"));
+      String sortParam = null;
+      if (pdbRestRequest.getFieldToSortBy() == null
+              || pdbRestRequest.getFieldToSortBy().trim().isEmpty())
+      {
+        sortParam = "";
+      }
+      else
+      {
+        if (pdbRestRequest.getFieldToSortBy()
+                .equalsIgnoreCase("Resolution"))
+        {
+          sortParam = pdbRestRequest.getFieldToSortBy()
+                  + (pdbRestRequest.isAscending() ? " asc" : " desc");
+        }
+        else
+        {
+          sortParam = pdbRestRequest.getFieldToSortBy()
+                  + (pdbRestRequest.isAscending() ? " desc" : " asc");
+        }
+      }
+
       String facetPivot = (pdbRestRequest.getFacetPivot() == null || pdbRestRequest
               .getFacetPivot().isEmpty()) ? "" : pdbRestRequest
               .getFacetPivot();