From 3fd32306db772b6d6756ca20d33519edeb353c2d Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 11 Mar 2016 17:04:56 +0000 Subject: [PATCH] JAL-2026 Bug fix for best quality filter --- src/jalview/gui/StructureChooser.java | 12 ------------ src/jalview/ws/dbsources/PDBRestClient.java | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index d313002..2e396aa 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -399,18 +399,6 @@ public class StructureChooser extends GStructureChooser implements .getStructureSummaryFields(); Collection filteredResponse = new HashSet(); HashSet errors = new HashSet(); - // try - // { - // PDBDocField fiterField = PDBRestClient - // .getPDBDocFieldByCode(fieldToFilterBy); - // if (!wantedFields.contains(fiterField)) - // { - // wantedFields.add(fiterField); - // } - // } catch (Exception e) - // { - // e.printStackTrace(); - // } for (SequenceI seq : selectedSequences) { diff --git a/src/jalview/ws/dbsources/PDBRestClient.java b/src/jalview/ws/dbsources/PDBRestClient.java index 05dab95..a36fdd4 100644 --- a/src/jalview/ws/dbsources/PDBRestClient.java +++ b/src/jalview/ws/dbsources/PDBRestClient.java @@ -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(); -- 1.7.10.2