3 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
4 * Copyright (C) 2014 The Jalview Authors
6 * This file is part of Jalview.
8 * Jalview is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation, either version 3
11 * of the License, or (at your option) any later version.
13 * Jalview is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
20 * The Jalview Authors are detailed in the 'AUTHORS' file.
25 import jalview.datamodel.DBRefEntry;
26 import jalview.datamodel.PDBEntry;
27 import jalview.datamodel.SequenceI;
28 import jalview.jbgui.GStructureChooser;
29 import jalview.jbgui.PDBDocFieldPreferences;
30 import jalview.structure.StructureSelectionManager;
31 import jalview.util.MessageManager;
32 import jalview.ws.dbsources.PDBRestClient;
33 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
34 import jalview.ws.uimodel.PDBRestRequest;
35 import jalview.ws.uimodel.PDBRestResponse;
36 import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
38 import java.awt.event.ItemEvent;
39 import java.util.ArrayList;
40 import java.util.Collection;
41 import java.util.HashSet;
42 import java.util.Hashtable;
43 import java.util.LinkedHashSet;
44 import java.util.List;
46 import javax.swing.JCheckBox;
47 import javax.swing.JComboBox;
48 import javax.swing.JLabel;
49 import javax.swing.JOptionPane;
50 import javax.swing.table.DefaultTableModel;
54 * Provides the behaviors for the Structure chooser Panel
59 @SuppressWarnings("serial")
60 public class StructureChooser extends GStructureChooser
62 private boolean structuresDiscovered = false;
64 private SequenceI selectedSequence;
66 private SequenceI[] selectedSequences;
68 private IProgressIndicator progressIndicator;
70 private Collection<PDBResponseSummary> discoveredStructuresSet;
72 private PDBRestRequest lastPdbRequest;
74 private PDBRestClient pdbRestCleint;
76 private String selectedPdbFileName;
78 private boolean isValidPBDEntry;
80 private static Hashtable<String, PDBEntry> cachedEntryMap;
82 public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
86 this.selectedSequence = selectedSeq;
87 this.selectedSequences = selectedSeqs;
88 this.progressIndicator = (ap == null) ? null : ap.alignFrame;
93 * Initializes parameters used by the Structure Chooser Panel
97 Thread discoverPDBStructuresThread = new Thread(new Runnable()
102 long startTime = System.currentTimeMillis();
103 String msg = MessageManager.getString("status.fetching_db_refs");
104 updateProgressIndicator(msg, startTime);
105 loadLocalCachedPDBEntries();
106 fetchStructuresMetaData();
107 populateFilterComboBox();
108 updateProgressIndicator(null, startTime);
109 mainFrame.setVisible(true);
113 discoverPDBStructuresThread.start();
117 * Updates the progress indicator with the specified message
120 * displayed message for the operation
122 * unique handle for this indicator
124 public void updateProgressIndicator(String message, long id)
126 if (progressIndicator != null)
128 progressIndicator.setProgressBar(message, id);
133 * Retrieve meta-data for all the structure(s) for a given sequence(s) in a
136 public void fetchStructuresMetaData()
138 long startTime = System.currentTimeMillis();
139 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
140 .getStructureSummaryFields();
142 discoveredStructuresSet = new LinkedHashSet<PDBResponseSummary>();
143 HashSet<String> errors = new HashSet<String>();
144 for (SequenceI seq : selectedSequences)
146 PDBRestRequest pdbRequest = new PDBRestRequest();
147 pdbRequest.setAllowEmptySeq(false);
148 pdbRequest.setResponseSize(500);
149 pdbRequest.setFieldToSearchBy("(text:");
150 pdbRequest.setWantedFields(wantedFields);
151 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
152 pdbRequest.setAssociatedSequence(seq.getName());
153 pdbRestCleint = new PDBRestClient();
154 PDBRestResponse resultList;
157 resultList = pdbRestCleint.executeRequest(pdbRequest);
158 } catch (Exception e)
160 errors.add(e.getMessage());
163 lastPdbRequest = pdbRequest;
164 if (resultList.getSearchSummary() != null
165 && !resultList.getSearchSummary().isEmpty())
167 discoveredStructuresSet.addAll(resultList.getSearchSummary());
168 updateSequencePDBEntries(seq, resultList.getSearchSummary());
172 int noOfStructuresFound = 0;
173 String totalTime = (System.currentTimeMillis() - startTime)
175 if (discoveredStructuresSet != null
176 && !discoveredStructuresSet.isEmpty())
178 tbl_summary.setModel(PDBRestResponse.getTableModel(lastPdbRequest,
179 discoveredStructuresSet));
180 structuresDiscovered = true;
181 noOfStructuresFound = discoveredStructuresSet.size();
182 mainFrame.setTitle("Structure Chooser - " + noOfStructuresFound
183 + " Found (" + totalTime + ")");
188 .setTitle("Structure Chooser - Manual association");
189 if (errors.size() > 0)
191 StringBuilder errorMsg = new StringBuilder();
192 // "Operation was unsucessful due to the following: \n");
193 for (String error : errors)
195 errorMsg.append(error).append("\n");
197 JOptionPane.showMessageDialog(this, errorMsg.toString(),
198 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
203 public void loadLocalCachedPDBEntries()
205 DefaultTableModel tableModel = new DefaultTableModel();
206 tableModel.addColumn("Sequence");
207 tableModel.addColumn("PDB Id");
208 tableModel.addColumn("Chain");
209 tableModel.addColumn("Type");
210 tableModel.addColumn("File");
211 cachedEntryMap = new Hashtable<String, PDBEntry>();
212 for (SequenceI seq : selectedSequences)
214 if (seq.getDatasetSequence() != null
215 && seq.getDatasetSequence().getPDBId() != null)
217 for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
220 String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
222 String[] pdbEntryRowData = new String[]
223 { seq.getDisplayId(false), pdbEntry.getId(),
226 pdbEntry.getFile() };
227 if (pdbEntry.getFile() != null)
229 tableModel.addRow(pdbEntryRowData);
231 cachedEntryMap.put(pdbEntry.getId().toLowerCase(),
236 tbl_local_pdb.setModel(tableModel);
240 * Update the PDBEntry for a given sequence with values retrieved from
244 * the Sequence to update its DBRef entry
245 * @param responseSummaries
246 * a collection of PDBResponseSummary
248 public void updateSequencePDBEntries(SequenceI seq,
249 Collection<PDBResponseSummary> responseSummaries)
251 for (PDBResponseSummary response : responseSummaries)
253 String pdbIdStr = response.getPdbId();
254 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
255 if (pdbEntry == null)
257 pdbEntry = new PDBEntry();
258 pdbEntry.setId(pdbIdStr);
259 pdbEntry.setType(PDBEntry.Type.PDB);
261 seq.getDatasetSequence().addPDBId(pdbEntry);
266 * Builds a query string for a given sequences using its DBRef entries
269 * the sequences to build a query for
270 * @return the built query string
273 public static String buildQuery(SequenceI seq)
275 HashSet<String> seqRefs = new LinkedHashSet<String>();
276 String seqName = seq.getName();
277 String[] names = seqName.toLowerCase().split("\\|");
278 for (String name : names)
280 // System.out.println("Found name : " + name);
282 if (isValidSeqName(name))
288 if (seq.getPDBId() != null)
290 for (PDBEntry entry : seq.getPDBId())
292 seqRefs.add(entry.getId());
296 if (seq.getDBRef() != null && seq.getDBRef().length != 0)
299 for (DBRefEntry dbRef : seq.getDBRef())
301 seqRefs.add(getDBRefId(dbRef));
310 StringBuilder queryBuilder = new StringBuilder();
311 for (String seqRef : seqRefs)
313 queryBuilder.append("text:").append(seqRef).append(" OR ");
315 int endIndex = queryBuilder.lastIndexOf(" OR ");
316 String query = queryBuilder.toString().substring(5, endIndex);
321 * Ensures sequence ref names are not less than 3 characters and does not
322 * contain a database name
327 public static boolean isValidSeqName(String seqName)
329 String ignoreList = "pdb,uniprot";
330 if (seqName.length() < 3)
334 for (String ignoredEntry : ignoreList.split(","))
336 if (seqName.equalsIgnoreCase(ignoredEntry))
344 public static String getDBRefId(DBRefEntry dbRef)
346 String ref = dbRef.getAccessionId().replaceAll("GO:", "");
351 * Filters a given list of discovered structures based on supplied argument
353 * @param fieldToFilterBy
354 * the field to filter by
356 public void filterResultSet(final String fieldToFilterBy)
358 Thread filterThread = new Thread(new Runnable()
363 long startTime = System.currentTimeMillis();
364 lbl_loading.setVisible(true);
365 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
366 .getStructureSummaryFields();
367 Collection<PDBResponseSummary> filteredResponse = new HashSet<PDBResponseSummary>();
368 HashSet<String> errors = new HashSet<String>();
369 for (SequenceI seq : selectedSequences)
371 PDBRestRequest pdbRequest = new PDBRestRequest();
372 pdbRequest.setAllowEmptySeq(false);
373 pdbRequest.setResponseSize(1);
374 pdbRequest.setFieldToSearchBy("(text:");
375 pdbRequest.setFieldToSortBy(fieldToFilterBy,
376 !chk_invertFilter.isSelected());
377 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
378 pdbRequest.setWantedFields(wantedFields);
379 pdbRequest.setAssociatedSequence(seq.getName());
380 pdbRestCleint = new PDBRestClient();
381 PDBRestResponse resultList;
384 resultList = pdbRestCleint.executeRequest(pdbRequest);
385 } catch (Exception e)
387 errors.add(e.getMessage());
390 lastPdbRequest = pdbRequest;
391 if (resultList.getSearchSummary() != null
392 && !resultList.getSearchSummary().isEmpty())
394 filteredResponse.addAll(resultList.getSearchSummary());
398 String totalTime = (System.currentTimeMillis() - startTime)
400 if (!filteredResponse.isEmpty())
402 final int filterResponseCount = filteredResponse.size();
403 Collection<PDBResponseSummary> reorderedStructuresSet = new LinkedHashSet<PDBResponseSummary>();
404 reorderedStructuresSet.addAll(filteredResponse);
405 reorderedStructuresSet.addAll(discoveredStructuresSet);
406 tbl_summary.setModel(PDBRestResponse.getTableModel(
407 lastPdbRequest, reorderedStructuresSet));
409 // Update table selection model here
410 tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
412 mainFrame.setTitle("Structure Chooser - Filter time ("
417 mainFrame.setTitle("Structure Chooser - Filter time ("
419 if (errors.size() > 0)
421 StringBuilder errorMsg = new StringBuilder();
422 for (String error : errors)
424 errorMsg.append(error).append("\n");
426 JOptionPane.showMessageDialog(null, errorMsg.toString(),
427 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
431 lbl_loading.setVisible(false);
433 validateSelections();
436 filterThread.start();
441 * Handles action event for btn_pdbFromFile
443 public void pdbFromFile_actionPerformed()
445 jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
446 jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
447 chooser.setFileView(new jalview.io.JalviewFileView());
448 chooser.setDialogTitle(MessageManager.formatMessage(
449 "label.select_pdb_file_for", new String[]
450 { selectedSequence.getDisplayId(false) }));
451 chooser.setToolTipText(MessageManager.formatMessage(
452 "label.load_pdb_file_associate_with_sequence", new String[]
453 { selectedSequence.getDisplayId(false) }));
455 int value = chooser.showOpenDialog(null);
456 if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
458 selectedPdbFileName = chooser.getSelectedFile().getPath();
459 jalview.bin.Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
460 validateSelections();
465 * Populates the filter combo-box options dynamically depending on discovered
468 protected void populateFilterComboBox()
470 if (isStructuresDiscovered())
472 cmb_filterOption.addItem(new FilterOption("Best Quality",
473 PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
474 cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
475 PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
476 cmb_filterOption.addItem(new FilterOption("Highest Resolution",
477 PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
478 cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
479 PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
480 cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
481 PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
482 cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
483 PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
485 cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
487 cmb_filterOption.addItem(new FilterOption("From File", "-",
489 cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
494 * Updates the displayed view based on the selected filter option
496 protected void updateCurrentView()
498 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
500 layout_switchableViews.show(pnl_switchableViews,
501 selectedFilterOpt.getView());
502 String filterTitle = mainFrame.getTitle();
503 mainFrame.setTitle(frameTitle);
504 chk_invertFilter.setVisible(false);
505 if (selectedFilterOpt.getView() == VIEWS_FILTER)
507 mainFrame.setTitle(filterTitle);
508 chk_invertFilter.setVisible(true);
509 filterResultSet(selectedFilterOpt.getValue());
511 else if (selectedFilterOpt.getView() == VIEWS_ENTER_ID
512 || selectedFilterOpt.getView() == VIEWS_FROM_FILE)
514 mainFrame.setTitle(filterTitle);
515 idInputAssSeqPanel.loadCmbAssSeq();
516 fileChooserAssSeqPanel.loadCmbAssSeq();
518 validateSelections();
522 * Validates user selection and activates the view button if all parameters
525 public void validateSelections()
527 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
529 btn_view.setEnabled(false);
530 String currentView = selectedFilterOpt.getView();
531 if (currentView == VIEWS_FILTER)
533 if (tbl_summary.getSelectedRows().length > 0)
535 btn_view.setEnabled(true);
538 else if (currentView == VIEWS_LOCAL_PDB)
540 if (tbl_local_pdb.getSelectedRows().length > 0)
542 btn_view.setEnabled(true);
545 else if (currentView == VIEWS_ENTER_ID)
547 validateAssociationEnterPdb();
549 else if (currentView == VIEWS_FROM_FILE)
551 validateAssociationFromFile();
556 * Validates inputs from the Manual PDB entry panel
558 public void validateAssociationEnterPdb()
560 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
561 .getCmb_assSeq().getSelectedItem();
562 lbl_pdbManualFetchStatus.setIcon(errorImage);
563 lbl_pdbManualFetchStatus.setToolTipText("");
564 if (txt_search.getText().length() > 0)
566 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
567 true, "No PDB entry found for \'" + txt_search.getText()
571 if (errorWarning.length() > 0)
573 lbl_pdbManualFetchStatus.setIcon(warningImage);
574 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
575 true, errorWarning.toString()));
578 if (selectedSequences.length == 1
579 || !assSeqOpt.getName().equalsIgnoreCase(
580 "-Select Associated Seq-"))
582 txt_search.setEnabled(true);
585 btn_view.setEnabled(true);
586 lbl_pdbManualFetchStatus.setToolTipText("");
587 lbl_pdbManualFetchStatus.setIcon(goodImage);
592 txt_search.setEnabled(false);
593 lbl_pdbManualFetchStatus.setIcon(errorImage);
598 * Validates inputs for the manual PDB file selection options
600 public void validateAssociationFromFile()
602 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
603 .getCmb_assSeq().getSelectedItem();
604 lbl_fromFileStatus.setIcon(errorImage);
605 if (selectedSequences.length == 1
606 || (assSeqOpt != null
607 && !assSeqOpt.getName().equalsIgnoreCase(
608 "-Select Associated Seq-")))
610 btn_pdbFromFile.setEnabled(true);
611 if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
613 btn_view.setEnabled(true);
614 lbl_fromFileStatus.setIcon(goodImage);
619 btn_pdbFromFile.setEnabled(false);
620 lbl_fromFileStatus.setIcon(errorImage);
625 public void cmbAssSeqStateChanged()
627 validateSelections();
631 * Handles the state change event for the 'filter' combo-box and 'invert'
635 protected void stateChanged(ItemEvent e)
637 if (e.getSource() instanceof JCheckBox)
643 if (e.getStateChange() == ItemEvent.SELECTED)
652 * Handles action event for btn_ok
655 public void ok_ActionPerformed()
657 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
659 String currentView = selectedFilterOpt.getView();
660 if (currentView == VIEWS_FILTER)
662 int pdbIdCol = PDBRestClient.getPDBIdColumIndex(
663 lastPdbRequest.getWantedFields(), true);
664 int[] selectedRows = tbl_summary.getSelectedRows();
665 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
667 for (int summaryRow : selectedRows)
669 String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
672 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
673 if (pdbEntry == null)
675 pdbEntry = new PDBEntry();
676 pdbEntry.setId(pdbIdStr);
677 pdbEntry.setType(PDBEntry.Type.PDB);
679 pdbEntriesToView[count++] = pdbEntry;
681 launchStructureViewer(ap.getStructureSelectionManager(),
682 pdbEntriesToView, ap, selectedSequences);
684 else if(currentView == VIEWS_LOCAL_PDB){
685 int[] selectedRows = tbl_local_pdb.getSelectedRows();
686 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
688 for (int row : selectedRows)
690 String entryKey = tbl_local_pdb.getValueAt(row, 1).toString()
692 pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
694 launchStructureViewer(ap.getStructureSelectionManager(),
695 pdbEntriesToView, ap, selectedSequences);
697 else if (currentView == VIEWS_ENTER_ID)
699 SequenceI userSelectedSeq = ((AssociateSeqOptions) idInputAssSeqPanel
700 .getCmb_assSeq().getSelectedItem()).getSequence();
701 if (userSelectedSeq != null)
703 selectedSequence = userSelectedSeq;
706 String pdbIdStr = txt_search.getText();
707 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
708 if (pdbEntry == null)
710 pdbEntry = new PDBEntry();
711 pdbEntry.setId(txt_search.getText());
712 pdbEntry.setType(PDBEntry.Type.PDB);
715 selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
716 PDBEntry[] pdbEntriesToView = new PDBEntry[]
718 launchStructureViewer(ap.getStructureSelectionManager(),
719 pdbEntriesToView, ap, new SequenceI[]
720 { selectedSequence });
722 else if (currentView == VIEWS_FROM_FILE)
724 SequenceI userSelectedSeq = ((AssociateSeqOptions) fileChooserAssSeqPanel
725 .getCmb_assSeq().getSelectedItem()).getSequence();
726 if (userSelectedSeq != null)
728 selectedSequence = userSelectedSeq;
730 PDBEntry fileEntry = new AssociatePdbFileWithSeq()
731 .associatePdbWithSeq(
732 selectedPdbFileName, jalview.io.AppletFormatAdapter.FILE,
733 selectedSequence, true, Desktop.instance);
735 launchStructureViewer(ap.getStructureSelectionManager(),
737 { fileEntry }, ap, new SequenceI[]
738 { selectedSequence });
743 private void launchStructureViewer(StructureSelectionManager ssm,
744 PDBEntry[] pdbEntriesToView, AlignmentPanel alignPanel,
745 SequenceI[] selectedSequences)
747 StructureViewer sViewer = new StructureViewer(ssm);
748 if (pdbEntriesToView.length > 1)
750 sViewer.viewStructures(alignPanel, pdbEntriesToView,
751 alignPanel.av.collateForPDB(pdbEntriesToView));
755 sViewer.viewStructures(pdbEntriesToView[0], selectedSequences, null,
761 * Populates the combo-box used in associating manually fetched structures to
762 * a unique sequence when more than one sequence selection is made.
764 public void populateCmbAssociateSeqOptions(
765 JComboBox<AssociateSeqOptions> cmb_assSeq, JLabel lbl_associateSeq)
767 cmb_assSeq.removeAllItems();
768 cmb_assSeq.addItem(new AssociateSeqOptions("-Select Associated Seq-",
770 // cmb_assSeq.addItem(new AssociateSeqOptions("Auto Detect", null));
771 lbl_associateSeq.setVisible(false);
772 if (selectedSequences.length > 1)
774 for (SequenceI seq : selectedSequences)
776 cmb_assSeq.addItem(new AssociateSeqOptions(seq));
781 String seqName = selectedSequence.getDisplayId(false);
782 seqName = seqName.length() <= 40 ? seqName : seqName.substring(0, 39);
783 lbl_associateSeq.setText(seqName);
784 lbl_associateSeq.setVisible(true);
785 cmb_assSeq.setVisible(false);
789 public boolean isStructuresDiscovered()
791 return structuresDiscovered;
794 public void setStructuresDiscovered(boolean structuresDiscovered)
796 this.structuresDiscovered = structuresDiscovered;
799 public Collection<PDBResponseSummary> getDiscoveredStructuresSet()
801 return discoveredStructuresSet;
805 protected void txt_search_ActionPerformed()
807 errorWarning.setLength(0);
808 isValidPBDEntry = false;
809 if (txt_search.getText().length() > 0)
811 List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
812 wantedFields.add(PDBDocField.PDB_ID);
813 PDBRestRequest pdbRequest = new PDBRestRequest();
814 pdbRequest.setAllowEmptySeq(false);
815 pdbRequest.setResponseSize(1);
816 pdbRequest.setFieldToSearchBy("(pdb_id:");
817 pdbRequest.setWantedFields(wantedFields);
818 pdbRequest.setSearchTerm(txt_search.getText() + ")");
819 pdbRequest.setAssociatedSequence(selectedSequence.getName());
820 pdbRestCleint = new PDBRestClient();
821 PDBRestResponse resultList;
824 resultList = pdbRestCleint.executeRequest(pdbRequest);
825 } catch (Exception e)
827 // JOptionPane.showMessageDialog(this, e.getMessage(),
828 // "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
829 errorWarning.append(e.getMessage());
833 // System.out.println(">>>>> executing finally block");
834 validateSelections();
836 if (resultList.getSearchSummary() != null
837 && resultList.getSearchSummary().size() > 0)
839 isValidPBDEntry = true;
842 validateSelections();
846 public void tabRefresh()
848 if (selectedSequences != null)
850 Thread refreshThread = new Thread(new Runnable()
855 fetchStructuresMetaData();
856 filterResultSet(((FilterOption) cmb_filterOption
857 .getSelectedItem()).getValue());
860 refreshThread.start();