From: tcofoegbu Date: Tue, 23 Feb 2016 10:03:34 +0000 (+0000) Subject: JAL-1720 renamed Structure Chooser filters according to suggestions from Jim. Also... X-Git-Tag: Release_2_10_0~308 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=782d4f5f28a6d138378b74ce74f4dbf14a49333f;p=jalview.git JAL-1720 renamed Structure Chooser filters according to suggestions from Jim. Also made improvements which enables automatic listing of selected filter meta-data in the summary table --- diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 7d0d76a..5d381b9 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -382,6 +382,19 @@ 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) { 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", "-", diff --git a/src/jalview/ws/dbsources/PDBRestClient.java b/src/jalview/ws/dbsources/PDBRestClient.java index 2c05acd..8e08c84 100644 --- a/src/jalview/ws/dbsources/PDBRestClient.java +++ b/src/jalview/ws/dbsources/PDBRestClient.java @@ -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 *