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 updateProgressIndicator(MessageManager
104 .getString("status.loading_cached_pdb_entries"), startTime);
105 loadLocalCachedPDBEntries();
106 updateProgressIndicator(null, startTime);
107 updateProgressIndicator(MessageManager
108 .getString("status.searching_for_pdb_structures"),
110 fetchStructuresMetaData();
111 populateFilterComboBox();
112 updateProgressIndicator(null, startTime);
113 mainFrame.setVisible(true);
117 discoverPDBStructuresThread.start();
121 * Updates the progress indicator with the specified message
124 * displayed message for the operation
126 * unique handle for this indicator
128 public void updateProgressIndicator(String message, long id)
130 if (progressIndicator != null)
132 progressIndicator.setProgressBar(message, id);
137 * Retrieve meta-data for all the structure(s) for a given sequence(s) in a
140 public void fetchStructuresMetaData()
142 long startTime = System.currentTimeMillis();
143 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
144 .getStructureSummaryFields();
146 discoveredStructuresSet = new LinkedHashSet<PDBResponseSummary>();
147 HashSet<String> errors = new HashSet<String>();
148 for (SequenceI seq : selectedSequences)
150 PDBRestRequest pdbRequest = new PDBRestRequest();
151 pdbRequest.setAllowEmptySeq(false);
152 pdbRequest.setResponseSize(500);
153 pdbRequest.setFieldToSearchBy("(text:");
154 pdbRequest.setWantedFields(wantedFields);
155 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
156 pdbRequest.setAssociatedSequence(seq.getName());
157 pdbRestCleint = new PDBRestClient();
158 PDBRestResponse resultList;
161 resultList = pdbRestCleint.executeRequest(pdbRequest);
162 } catch (Exception e)
164 errors.add(e.getMessage());
167 lastPdbRequest = pdbRequest;
168 if (resultList.getSearchSummary() != null
169 && !resultList.getSearchSummary().isEmpty())
171 discoveredStructuresSet.addAll(resultList.getSearchSummary());
172 updateSequencePDBEntries(seq, resultList.getSearchSummary());
176 int noOfStructuresFound = 0;
177 String totalTime = (System.currentTimeMillis() - startTime)
179 if (discoveredStructuresSet != null
180 && !discoveredStructuresSet.isEmpty())
182 tbl_summary.setModel(PDBRestResponse.getTableModel(lastPdbRequest,
183 discoveredStructuresSet));
184 structuresDiscovered = true;
185 noOfStructuresFound = discoveredStructuresSet.size();
186 mainFrame.setTitle("Structure Chooser - " + noOfStructuresFound
187 + " Found (" + totalTime + ")");
192 .setTitle("Structure Chooser - Manual association");
193 if (errors.size() > 0)
195 StringBuilder errorMsg = new StringBuilder();
196 // "Operation was unsucessful due to the following: \n");
197 for (String error : errors)
199 errorMsg.append(error).append("\n");
201 JOptionPane.showMessageDialog(this, errorMsg.toString(),
202 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
207 public void loadLocalCachedPDBEntries()
209 DefaultTableModel tableModel = new DefaultTableModel();
210 tableModel.addColumn("Sequence");
211 tableModel.addColumn("PDB Id");
212 tableModel.addColumn("Chain");
213 tableModel.addColumn("Type");
214 tableModel.addColumn("File");
215 cachedEntryMap = new Hashtable<String, PDBEntry>();
216 for (SequenceI seq : selectedSequences)
218 if (seq.getDatasetSequence() != null
219 && seq.getDatasetSequence().getPDBId() != null)
221 for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
224 String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
226 String[] pdbEntryRowData = new String[]
227 { seq.getDisplayId(false), pdbEntry.getId(),
230 pdbEntry.getFile() };
231 if (pdbEntry.getFile() != null)
233 tableModel.addRow(pdbEntryRowData);
235 cachedEntryMap.put(pdbEntry.getId().toLowerCase(),
240 tbl_local_pdb.setModel(tableModel);
244 * Update the PDBEntry for a given sequence with values retrieved from
248 * the Sequence to update its DBRef entry
249 * @param responseSummaries
250 * a collection of PDBResponseSummary
252 public void updateSequencePDBEntries(SequenceI seq,
253 Collection<PDBResponseSummary> responseSummaries)
255 for (PDBResponseSummary response : responseSummaries)
257 String pdbIdStr = response.getPdbId();
258 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
259 if (pdbEntry == null)
261 pdbEntry = new PDBEntry();
262 pdbEntry.setId(pdbIdStr);
263 pdbEntry.setType(PDBEntry.Type.PDB);
265 seq.getDatasetSequence().addPDBId(pdbEntry);
270 * Builds a query string for a given sequences using its DBRef entries
273 * the sequences to build a query for
274 * @return the built query string
277 public static String buildQuery(SequenceI seq)
279 HashSet<String> seqRefs = new LinkedHashSet<String>();
280 String seqName = seq.getName();
281 String[] names = seqName.toLowerCase().split("\\|");
282 for (String name : names)
284 // System.out.println("Found name : " + name);
286 if (isValidSeqName(name))
292 if (seq.getPDBId() != null)
294 for (PDBEntry entry : seq.getPDBId())
296 seqRefs.add(entry.getId());
300 if (seq.getDBRef() != null && seq.getDBRef().length != 0)
303 for (DBRefEntry dbRef : seq.getDBRef())
305 seqRefs.add(getDBRefId(dbRef));
314 StringBuilder queryBuilder = new StringBuilder();
315 for (String seqRef : seqRefs)
317 queryBuilder.append("text:").append(seqRef).append(" OR ");
319 int endIndex = queryBuilder.lastIndexOf(" OR ");
320 String query = queryBuilder.toString().substring(5, endIndex);
325 * Ensures sequence ref names are not less than 3 characters and does not
326 * contain a database name
331 public static boolean isValidSeqName(String seqName)
333 String ignoreList = "pdb,uniprot";
334 if (seqName.length() < 3)
338 for (String ignoredEntry : ignoreList.split(","))
340 if (seqName.equalsIgnoreCase(ignoredEntry))
348 public static String getDBRefId(DBRefEntry dbRef)
350 String ref = dbRef.getAccessionId().replaceAll("GO:", "");
355 * Filters a given list of discovered structures based on supplied argument
357 * @param fieldToFilterBy
358 * the field to filter by
360 public void filterResultSet(final String fieldToFilterBy)
362 Thread filterThread = new Thread(new Runnable()
367 long startTime = System.currentTimeMillis();
368 lbl_loading.setVisible(true);
369 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
370 .getStructureSummaryFields();
371 Collection<PDBResponseSummary> filteredResponse = new HashSet<PDBResponseSummary>();
372 HashSet<String> errors = new HashSet<String>();
373 for (SequenceI seq : selectedSequences)
375 PDBRestRequest pdbRequest = new PDBRestRequest();
376 pdbRequest.setAllowEmptySeq(false);
377 pdbRequest.setResponseSize(1);
378 pdbRequest.setFieldToSearchBy("(text:");
379 pdbRequest.setFieldToSortBy(fieldToFilterBy,
380 !chk_invertFilter.isSelected());
381 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
382 pdbRequest.setWantedFields(wantedFields);
383 pdbRequest.setAssociatedSequence(seq.getName());
384 pdbRestCleint = new PDBRestClient();
385 PDBRestResponse resultList;
388 resultList = pdbRestCleint.executeRequest(pdbRequest);
389 } catch (Exception e)
391 errors.add(e.getMessage());
394 lastPdbRequest = pdbRequest;
395 if (resultList.getSearchSummary() != null
396 && !resultList.getSearchSummary().isEmpty())
398 filteredResponse.addAll(resultList.getSearchSummary());
402 String totalTime = (System.currentTimeMillis() - startTime)
404 if (!filteredResponse.isEmpty())
406 final int filterResponseCount = filteredResponse.size();
407 Collection<PDBResponseSummary> reorderedStructuresSet = new LinkedHashSet<PDBResponseSummary>();
408 reorderedStructuresSet.addAll(filteredResponse);
409 reorderedStructuresSet.addAll(discoveredStructuresSet);
410 tbl_summary.setModel(PDBRestResponse.getTableModel(
411 lastPdbRequest, reorderedStructuresSet));
413 // Update table selection model here
414 tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
416 mainFrame.setTitle("Structure Chooser - Filter time ("
421 mainFrame.setTitle("Structure Chooser - Filter time ("
423 if (errors.size() > 0)
425 StringBuilder errorMsg = new StringBuilder();
426 for (String error : errors)
428 errorMsg.append(error).append("\n");
430 JOptionPane.showMessageDialog(null, errorMsg.toString(),
431 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
435 lbl_loading.setVisible(false);
437 validateSelections();
440 filterThread.start();
445 * Handles action event for btn_pdbFromFile
447 public void pdbFromFile_actionPerformed()
449 jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
450 jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
451 chooser.setFileView(new jalview.io.JalviewFileView());
452 chooser.setDialogTitle(MessageManager.formatMessage(
453 "label.select_pdb_file_for", new String[]
454 { selectedSequence.getDisplayId(false) }));
455 chooser.setToolTipText(MessageManager.formatMessage(
456 "label.load_pdb_file_associate_with_sequence", new String[]
457 { selectedSequence.getDisplayId(false) }));
459 int value = chooser.showOpenDialog(null);
460 if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
462 selectedPdbFileName = chooser.getSelectedFile().getPath();
463 jalview.bin.Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
464 validateSelections();
469 * Populates the filter combo-box options dynamically depending on discovered
472 protected void populateFilterComboBox()
474 if (isStructuresDiscovered())
476 cmb_filterOption.addItem(new FilterOption("Best Quality",
477 PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
478 cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
479 PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
480 cmb_filterOption.addItem(new FilterOption("Highest Resolution",
481 PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
482 cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
483 PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
484 cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
485 PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
486 cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
487 PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
489 cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
491 cmb_filterOption.addItem(new FilterOption("From File", "-",
493 cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
498 * Updates the displayed view based on the selected filter option
500 protected void updateCurrentView()
502 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
504 layout_switchableViews.show(pnl_switchableViews,
505 selectedFilterOpt.getView());
506 String filterTitle = mainFrame.getTitle();
507 mainFrame.setTitle(frameTitle);
508 chk_invertFilter.setVisible(false);
509 if (selectedFilterOpt.getView() == VIEWS_FILTER)
511 mainFrame.setTitle(filterTitle);
512 chk_invertFilter.setVisible(true);
513 filterResultSet(selectedFilterOpt.getValue());
515 else if (selectedFilterOpt.getView() == VIEWS_ENTER_ID
516 || selectedFilterOpt.getView() == VIEWS_FROM_FILE)
518 mainFrame.setTitle(filterTitle);
519 idInputAssSeqPanel.loadCmbAssSeq();
520 fileChooserAssSeqPanel.loadCmbAssSeq();
522 validateSelections();
526 * Validates user selection and activates the view button if all parameters
529 public void validateSelections()
531 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
533 btn_view.setEnabled(false);
534 String currentView = selectedFilterOpt.getView();
535 if (currentView == VIEWS_FILTER)
537 if (tbl_summary.getSelectedRows().length > 0)
539 btn_view.setEnabled(true);
542 else if (currentView == VIEWS_LOCAL_PDB)
544 if (tbl_local_pdb.getSelectedRows().length > 0)
546 btn_view.setEnabled(true);
549 else if (currentView == VIEWS_ENTER_ID)
551 validateAssociationEnterPdb();
553 else if (currentView == VIEWS_FROM_FILE)
555 validateAssociationFromFile();
560 * Validates inputs from the Manual PDB entry panel
562 public void validateAssociationEnterPdb()
564 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
565 .getCmb_assSeq().getSelectedItem();
566 lbl_pdbManualFetchStatus.setIcon(errorImage);
567 lbl_pdbManualFetchStatus.setToolTipText("");
568 if (txt_search.getText().length() > 0)
570 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
571 true, "No PDB entry found for \'" + txt_search.getText()
575 if (errorWarning.length() > 0)
577 lbl_pdbManualFetchStatus.setIcon(warningImage);
578 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
579 true, errorWarning.toString()));
582 if (selectedSequences.length == 1
583 || !assSeqOpt.getName().equalsIgnoreCase(
584 "-Select Associated Seq-"))
586 txt_search.setEnabled(true);
589 btn_view.setEnabled(true);
590 lbl_pdbManualFetchStatus.setToolTipText("");
591 lbl_pdbManualFetchStatus.setIcon(goodImage);
596 txt_search.setEnabled(false);
597 lbl_pdbManualFetchStatus.setIcon(errorImage);
602 * Validates inputs for the manual PDB file selection options
604 public void validateAssociationFromFile()
606 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
607 .getCmb_assSeq().getSelectedItem();
608 lbl_fromFileStatus.setIcon(errorImage);
609 if (selectedSequences.length == 1
610 || (assSeqOpt != null
611 && !assSeqOpt.getName().equalsIgnoreCase(
612 "-Select Associated Seq-")))
614 btn_pdbFromFile.setEnabled(true);
615 if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
617 btn_view.setEnabled(true);
618 lbl_fromFileStatus.setIcon(goodImage);
623 btn_pdbFromFile.setEnabled(false);
624 lbl_fromFileStatus.setIcon(errorImage);
629 public void cmbAssSeqStateChanged()
631 validateSelections();
635 * Handles the state change event for the 'filter' combo-box and 'invert'
639 protected void stateChanged(ItemEvent e)
641 if (e.getSource() instanceof JCheckBox)
647 if (e.getStateChange() == ItemEvent.SELECTED)
656 * Handles action event for btn_ok
659 public void ok_ActionPerformed()
661 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
663 String currentView = selectedFilterOpt.getView();
664 if (currentView == VIEWS_FILTER)
666 int pdbIdCol = PDBRestClient.getPDBIdColumIndex(
667 lastPdbRequest.getWantedFields(), true);
668 int[] selectedRows = tbl_summary.getSelectedRows();
669 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
671 for (int summaryRow : selectedRows)
673 String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
676 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
677 if (pdbEntry == null)
679 pdbEntry = new PDBEntry();
680 pdbEntry.setId(pdbIdStr);
681 pdbEntry.setType(PDBEntry.Type.PDB);
683 pdbEntriesToView[count++] = pdbEntry;
685 launchStructureViewer(ap.getStructureSelectionManager(),
686 pdbEntriesToView, ap, selectedSequences);
688 else if(currentView == VIEWS_LOCAL_PDB){
689 int[] selectedRows = tbl_local_pdb.getSelectedRows();
690 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
692 for (int row : selectedRows)
694 String entryKey = tbl_local_pdb.getValueAt(row, 1).toString()
696 pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
698 launchStructureViewer(ap.getStructureSelectionManager(),
699 pdbEntriesToView, ap, selectedSequences);
701 else if (currentView == VIEWS_ENTER_ID)
703 SequenceI userSelectedSeq = ((AssociateSeqOptions) idInputAssSeqPanel
704 .getCmb_assSeq().getSelectedItem()).getSequence();
705 if (userSelectedSeq != null)
707 selectedSequence = userSelectedSeq;
710 String pdbIdStr = txt_search.getText();
711 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
712 if (pdbEntry == null)
714 pdbEntry = new PDBEntry();
715 pdbEntry.setId(txt_search.getText());
716 pdbEntry.setType(PDBEntry.Type.PDB);
719 selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
720 PDBEntry[] pdbEntriesToView = new PDBEntry[]
722 launchStructureViewer(ap.getStructureSelectionManager(),
723 pdbEntriesToView, ap, new SequenceI[]
724 { selectedSequence });
726 else if (currentView == VIEWS_FROM_FILE)
728 SequenceI userSelectedSeq = ((AssociateSeqOptions) fileChooserAssSeqPanel
729 .getCmb_assSeq().getSelectedItem()).getSequence();
730 if (userSelectedSeq != null)
732 selectedSequence = userSelectedSeq;
734 PDBEntry fileEntry = new AssociatePdbFileWithSeq()
735 .associatePdbWithSeq(
736 selectedPdbFileName, jalview.io.AppletFormatAdapter.FILE,
737 selectedSequence, true, Desktop.instance);
739 launchStructureViewer(ap.getStructureSelectionManager(),
741 { fileEntry }, ap, new SequenceI[]
742 { selectedSequence });
747 private void launchStructureViewer(StructureSelectionManager ssm,
748 PDBEntry[] pdbEntriesToView, AlignmentPanel alignPanel,
749 SequenceI[] selectedSequences)
751 StructureViewer sViewer = new StructureViewer(ssm);
752 if (pdbEntriesToView.length > 1)
754 sViewer.viewStructures(alignPanel, pdbEntriesToView,
755 alignPanel.av.collateForPDB(pdbEntriesToView));
759 sViewer.viewStructures(pdbEntriesToView[0], selectedSequences, null,
765 * Populates the combo-box used in associating manually fetched structures to
766 * a unique sequence when more than one sequence selection is made.
768 public void populateCmbAssociateSeqOptions(
769 JComboBox<AssociateSeqOptions> cmb_assSeq, JLabel lbl_associateSeq)
771 cmb_assSeq.removeAllItems();
772 cmb_assSeq.addItem(new AssociateSeqOptions("-Select Associated Seq-",
774 // cmb_assSeq.addItem(new AssociateSeqOptions("Auto Detect", null));
775 lbl_associateSeq.setVisible(false);
776 if (selectedSequences.length > 1)
778 for (SequenceI seq : selectedSequences)
780 cmb_assSeq.addItem(new AssociateSeqOptions(seq));
785 String seqName = selectedSequence.getDisplayId(false);
786 seqName = seqName.length() <= 40 ? seqName : seqName.substring(0, 39);
787 lbl_associateSeq.setText(seqName);
788 lbl_associateSeq.setVisible(true);
789 cmb_assSeq.setVisible(false);
793 public boolean isStructuresDiscovered()
795 return structuresDiscovered;
798 public void setStructuresDiscovered(boolean structuresDiscovered)
800 this.structuresDiscovered = structuresDiscovered;
803 public Collection<PDBResponseSummary> getDiscoveredStructuresSet()
805 return discoveredStructuresSet;
809 protected void txt_search_ActionPerformed()
811 errorWarning.setLength(0);
812 isValidPBDEntry = false;
813 if (txt_search.getText().length() > 0)
815 List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
816 wantedFields.add(PDBDocField.PDB_ID);
817 PDBRestRequest pdbRequest = new PDBRestRequest();
818 pdbRequest.setAllowEmptySeq(false);
819 pdbRequest.setResponseSize(1);
820 pdbRequest.setFieldToSearchBy("(pdb_id:");
821 pdbRequest.setWantedFields(wantedFields);
822 pdbRequest.setSearchTerm(txt_search.getText() + ")");
823 pdbRequest.setAssociatedSequence(selectedSequence.getName());
824 pdbRestCleint = new PDBRestClient();
825 PDBRestResponse resultList;
828 resultList = pdbRestCleint.executeRequest(pdbRequest);
829 } catch (Exception e)
831 errorWarning.append(e.getMessage());
835 validateSelections();
837 if (resultList.getSearchSummary() != null
838 && resultList.getSearchSummary().size() > 0)
840 isValidPBDEntry = true;
843 validateSelections();
847 public void tabRefresh()
849 if (selectedSequences != null)
851 Thread refreshThread = new Thread(new Runnable()
856 fetchStructuresMetaData();
857 filterResultSet(((FilterOption) cmb_filterOption
858 .getSelectedItem()).getValue());
861 refreshThread.start();