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.bin.Cache;
26 import jalview.datamodel.DBRefEntry;
27 import jalview.datamodel.PDBEntry;
28 import jalview.datamodel.SequenceI;
29 import jalview.io.AppletFormatAdapter;
30 import jalview.io.JalviewFileChooser;
31 import jalview.io.JalviewFileView;
32 import jalview.jbgui.GStructureChooser;
33 import jalview.jbgui.PDBDocFieldPreferences;
34 import jalview.structure.StructureSelectionManager;
35 import jalview.util.MessageManager;
36 import jalview.ws.dbsources.PDBRestClient;
37 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
38 import jalview.ws.uimodel.PDBRestRequest;
39 import jalview.ws.uimodel.PDBRestResponse;
40 import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
42 import java.awt.event.ItemEvent;
43 import java.util.ArrayList;
44 import java.util.Collection;
45 import java.util.HashSet;
46 import java.util.Hashtable;
47 import java.util.LinkedHashSet;
48 import java.util.List;
50 import javax.swing.JCheckBox;
51 import javax.swing.JComboBox;
52 import javax.swing.JLabel;
53 import javax.swing.JOptionPane;
54 import javax.swing.table.DefaultTableModel;
58 * Provides the behaviors for the Structure chooser Panel
63 @SuppressWarnings("serial")
64 public class StructureChooser extends GStructureChooser
66 private boolean structuresDiscovered = false;
68 private SequenceI selectedSequence;
70 private SequenceI[] selectedSequences;
72 private IProgressIndicator progressIndicator;
74 private Collection<PDBResponseSummary> discoveredStructuresSet;
76 private PDBRestRequest lastPdbRequest;
78 private PDBRestClient pdbRestCleint;
80 private String selectedPdbFileName;
82 private boolean isValidPBDEntry;
84 private static Hashtable<String, PDBEntry> cachedEntryMap;
86 public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
90 this.selectedSequence = selectedSeq;
91 this.selectedSequences = selectedSeqs;
92 this.progressIndicator = (ap == null) ? null : ap.alignFrame;
97 * Initializes parameters used by the Structure Chooser Panel
101 Thread discoverPDBStructuresThread = new Thread(new Runnable()
106 long startTime = System.currentTimeMillis();
107 updateProgressIndicator(MessageManager
108 .getString("status.loading_cached_pdb_entries"), startTime);
109 loadLocalCachedPDBEntries();
110 updateProgressIndicator(null, startTime);
111 updateProgressIndicator(MessageManager
112 .getString("status.searching_for_pdb_structures"),
114 fetchStructuresMetaData();
115 populateFilterComboBox();
116 updateProgressIndicator(null, startTime);
117 mainFrame.setVisible(true);
121 discoverPDBStructuresThread.start();
125 * Updates the progress indicator with the specified message
128 * displayed message for the operation
130 * unique handle for this indicator
132 public void updateProgressIndicator(String message, long id)
134 if (progressIndicator != null)
136 progressIndicator.setProgressBar(message, id);
141 * Retrieve meta-data for all the structure(s) for a given sequence(s) in a
144 public void fetchStructuresMetaData()
146 long startTime = System.currentTimeMillis();
147 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
148 .getStructureSummaryFields();
150 discoveredStructuresSet = new LinkedHashSet<PDBResponseSummary>();
151 HashSet<String> errors = new HashSet<String>();
152 for (SequenceI seq : selectedSequences)
154 PDBRestRequest pdbRequest = new PDBRestRequest();
155 pdbRequest.setAllowEmptySeq(false);
156 pdbRequest.setResponseSize(500);
157 pdbRequest.setFieldToSearchBy("(text:");
158 pdbRequest.setWantedFields(wantedFields);
159 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
160 pdbRequest.setAssociatedSequence(seq.getName());
161 pdbRestCleint = new PDBRestClient();
162 PDBRestResponse resultList;
165 resultList = pdbRestCleint.executeRequest(pdbRequest);
166 } catch (Exception e)
168 errors.add(e.getMessage());
171 lastPdbRequest = pdbRequest;
172 if (resultList.getSearchSummary() != null
173 && !resultList.getSearchSummary().isEmpty())
175 discoveredStructuresSet.addAll(resultList.getSearchSummary());
176 updateSequencePDBEntries(seq, resultList.getSearchSummary());
180 int noOfStructuresFound = 0;
181 String totalTime = (System.currentTimeMillis() - startTime)
183 if (discoveredStructuresSet != null
184 && !discoveredStructuresSet.isEmpty())
186 tbl_summary.setModel(PDBRestResponse.getTableModel(lastPdbRequest,
187 discoveredStructuresSet));
188 structuresDiscovered = true;
189 noOfStructuresFound = discoveredStructuresSet.size();
190 mainFrame.setTitle("Structure Chooser - " + noOfStructuresFound
191 + " Found (" + totalTime + ")");
196 .setTitle("Structure Chooser - Manual association");
197 if (errors.size() > 0)
199 StringBuilder errorMsg = new StringBuilder();
200 // "Operation was unsucessful due to the following: \n");
201 for (String error : errors)
203 errorMsg.append(error).append("\n");
205 JOptionPane.showMessageDialog(this, errorMsg.toString(),
206 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
211 public void loadLocalCachedPDBEntries()
213 DefaultTableModel tableModel = new DefaultTableModel();
214 tableModel.addColumn("Sequence");
215 tableModel.addColumn("PDB Id");
216 tableModel.addColumn("Chain");
217 tableModel.addColumn("Type");
218 tableModel.addColumn("File");
219 cachedEntryMap = new Hashtable<String, PDBEntry>();
220 for (SequenceI seq : selectedSequences)
222 if (seq.getDatasetSequence() != null
223 && seq.getDatasetSequence().getPDBId() != null)
225 for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
228 String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
230 String[] pdbEntryRowData = new String[]
231 { seq.getDisplayId(false), pdbEntry.getId(),
234 pdbEntry.getFile() };
235 if (pdbEntry.getFile() != null)
237 tableModel.addRow(pdbEntryRowData);
239 cachedEntryMap.put(pdbEntry.getId().toLowerCase(),
244 tbl_local_pdb.setModel(tableModel);
248 * Update the PDBEntry for a given sequence with values retrieved from
252 * the Sequence to update its DBRef entry
253 * @param responseSummaries
254 * a collection of PDBResponseSummary
256 public void updateSequencePDBEntries(SequenceI seq,
257 Collection<PDBResponseSummary> responseSummaries)
259 for (PDBResponseSummary response : responseSummaries)
261 String pdbIdStr = response.getPdbId();
262 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
263 if (pdbEntry == null)
265 pdbEntry = new PDBEntry();
266 pdbEntry.setId(pdbIdStr);
267 pdbEntry.setType(PDBEntry.Type.PDB);
269 seq.getDatasetSequence().addPDBId(pdbEntry);
274 * Builds a query string for a given sequences using its DBRef entries
277 * the sequences to build a query for
278 * @return the built query string
281 public static String buildQuery(SequenceI seq)
283 HashSet<String> seqRefs = new LinkedHashSet<String>();
284 String seqName = seq.getName();
285 String[] names = seqName.toLowerCase().split("\\|");
286 for (String name : names)
288 // System.out.println("Found name : " + name);
290 if (isValidSeqName(name))
296 if (seq.getPDBId() != null)
298 for (PDBEntry entry : seq.getPDBId())
300 seqRefs.add(entry.getId());
304 if (seq.getDBRef() != null && seq.getDBRef().length != 0)
307 for (DBRefEntry dbRef : seq.getDBRef())
309 seqRefs.add(getDBRefId(dbRef));
318 StringBuilder queryBuilder = new StringBuilder();
319 for (String seqRef : seqRefs)
321 queryBuilder.append("text:").append(seqRef).append(" OR ");
323 int endIndex = queryBuilder.lastIndexOf(" OR ");
324 String query = queryBuilder.toString().substring(5, endIndex);
329 * Ensures sequence ref names are not less than 3 characters and does not
330 * contain a database name
335 public static boolean isValidSeqName(String seqName)
337 String ignoreList = "pdb,uniprot";
338 if (seqName.length() < 3)
342 for (String ignoredEntry : ignoreList.split(","))
344 if (seqName.equalsIgnoreCase(ignoredEntry))
352 public static String getDBRefId(DBRefEntry dbRef)
354 String ref = dbRef.getAccessionId().replaceAll("GO:", "");
359 * Filters a given list of discovered structures based on supplied argument
361 * @param fieldToFilterBy
362 * the field to filter by
364 public void filterResultSet(final String fieldToFilterBy)
366 Thread filterThread = new Thread(new Runnable()
371 long startTime = System.currentTimeMillis();
372 lbl_loading.setVisible(true);
373 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
374 .getStructureSummaryFields();
375 Collection<PDBResponseSummary> filteredResponse = new HashSet<PDBResponseSummary>();
376 HashSet<String> errors = new HashSet<String>();
377 for (SequenceI seq : selectedSequences)
379 PDBRestRequest pdbRequest = new PDBRestRequest();
380 pdbRequest.setAllowEmptySeq(false);
381 pdbRequest.setResponseSize(1);
382 pdbRequest.setFieldToSearchBy("(text:");
383 pdbRequest.setFieldToSortBy(fieldToFilterBy,
384 !chk_invertFilter.isSelected());
385 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
386 pdbRequest.setWantedFields(wantedFields);
387 pdbRequest.setAssociatedSequence(seq.getName());
388 pdbRestCleint = new PDBRestClient();
389 PDBRestResponse resultList;
392 resultList = pdbRestCleint.executeRequest(pdbRequest);
393 } catch (Exception e)
395 errors.add(e.getMessage());
398 lastPdbRequest = pdbRequest;
399 if (resultList.getSearchSummary() != null
400 && !resultList.getSearchSummary().isEmpty())
402 filteredResponse.addAll(resultList.getSearchSummary());
406 String totalTime = (System.currentTimeMillis() - startTime)
408 if (!filteredResponse.isEmpty())
410 final int filterResponseCount = filteredResponse.size();
411 Collection<PDBResponseSummary> reorderedStructuresSet = new LinkedHashSet<PDBResponseSummary>();
412 reorderedStructuresSet.addAll(filteredResponse);
413 reorderedStructuresSet.addAll(discoveredStructuresSet);
414 tbl_summary.setModel(PDBRestResponse.getTableModel(
415 lastPdbRequest, reorderedStructuresSet));
417 // Update table selection model here
418 tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
420 mainFrame.setTitle("Structure Chooser - Filter time ("
425 mainFrame.setTitle("Structure Chooser - Filter time ("
427 if (errors.size() > 0)
429 StringBuilder errorMsg = new StringBuilder();
430 for (String error : errors)
432 errorMsg.append(error).append("\n");
434 JOptionPane.showMessageDialog(null, errorMsg.toString(),
435 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
439 lbl_loading.setVisible(false);
441 validateSelections();
444 filterThread.start();
449 * Handles action event for btn_pdbFromFile
451 public void pdbFromFile_actionPerformed()
453 JalviewFileChooser chooser = new JalviewFileChooser(
454 Cache.getProperty("LAST_DIRECTORY"));
455 chooser.setFileView(new JalviewFileView());
456 chooser.setDialogTitle(MessageManager.formatMessage(
457 "label.select_pdb_file_for", new String[]
458 { selectedSequence.getDisplayId(false) }));
459 chooser.setToolTipText(MessageManager.formatMessage(
460 "label.load_pdb_file_associate_with_sequence", new String[]
461 { selectedSequence.getDisplayId(false) }));
463 int value = chooser.showOpenDialog(null);
464 if (value == JalviewFileChooser.APPROVE_OPTION)
466 selectedPdbFileName = chooser.getSelectedFile().getPath();
467 Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
468 validateSelections();
473 * Populates the filter combo-box options dynamically depending on discovered
476 protected void populateFilterComboBox()
478 if (isStructuresDiscovered())
480 cmb_filterOption.addItem(new FilterOption("Best Quality",
481 PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
482 cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
483 PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
484 cmb_filterOption.addItem(new FilterOption("Highest Resolution",
485 PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
486 cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
487 PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
488 cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
489 PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
490 cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
491 PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
493 cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
495 cmb_filterOption.addItem(new FilterOption("From File", "-",
497 cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
502 * Updates the displayed view based on the selected filter option
504 protected void updateCurrentView()
506 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
508 layout_switchableViews.show(pnl_switchableViews,
509 selectedFilterOpt.getView());
510 String filterTitle = mainFrame.getTitle();
511 mainFrame.setTitle(frameTitle);
512 chk_invertFilter.setVisible(false);
513 if (selectedFilterOpt.getView() == VIEWS_FILTER)
515 mainFrame.setTitle(filterTitle);
516 chk_invertFilter.setVisible(true);
517 filterResultSet(selectedFilterOpt.getValue());
519 else if (selectedFilterOpt.getView() == VIEWS_ENTER_ID
520 || selectedFilterOpt.getView() == VIEWS_FROM_FILE)
522 mainFrame.setTitle(filterTitle);
523 idInputAssSeqPanel.loadCmbAssSeq();
524 fileChooserAssSeqPanel.loadCmbAssSeq();
526 validateSelections();
530 * Validates user selection and activates the view button if all parameters
533 public void validateSelections()
535 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
537 btn_view.setEnabled(false);
538 String currentView = selectedFilterOpt.getView();
539 if (currentView == VIEWS_FILTER)
541 if (tbl_summary.getSelectedRows().length > 0)
543 btn_view.setEnabled(true);
546 else if (currentView == VIEWS_LOCAL_PDB)
548 if (tbl_local_pdb.getSelectedRows().length > 0)
550 btn_view.setEnabled(true);
553 else if (currentView == VIEWS_ENTER_ID)
555 validateAssociationEnterPdb();
557 else if (currentView == VIEWS_FROM_FILE)
559 validateAssociationFromFile();
564 * Validates inputs from the Manual PDB entry panel
566 public void validateAssociationEnterPdb()
568 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
569 .getCmb_assSeq().getSelectedItem();
570 lbl_pdbManualFetchStatus.setIcon(errorImage);
571 lbl_pdbManualFetchStatus.setToolTipText("");
572 if (txt_search.getText().length() > 0)
574 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
575 true, "No PDB entry found for \'" + txt_search.getText()
579 if (errorWarning.length() > 0)
581 lbl_pdbManualFetchStatus.setIcon(warningImage);
582 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
583 true, errorWarning.toString()));
586 if (selectedSequences.length == 1
587 || !assSeqOpt.getName().equalsIgnoreCase(
588 "-Select Associated Seq-"))
590 txt_search.setEnabled(true);
593 btn_view.setEnabled(true);
594 lbl_pdbManualFetchStatus.setToolTipText("");
595 lbl_pdbManualFetchStatus.setIcon(goodImage);
600 txt_search.setEnabled(false);
601 lbl_pdbManualFetchStatus.setIcon(errorImage);
606 * Validates inputs for the manual PDB file selection options
608 public void validateAssociationFromFile()
610 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
611 .getCmb_assSeq().getSelectedItem();
612 lbl_fromFileStatus.setIcon(errorImage);
613 if (selectedSequences.length == 1
614 || (assSeqOpt != null
615 && !assSeqOpt.getName().equalsIgnoreCase(
616 "-Select Associated Seq-")))
618 btn_pdbFromFile.setEnabled(true);
619 if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
621 btn_view.setEnabled(true);
622 lbl_fromFileStatus.setIcon(goodImage);
627 btn_pdbFromFile.setEnabled(false);
628 lbl_fromFileStatus.setIcon(errorImage);
633 public void cmbAssSeqStateChanged()
635 validateSelections();
639 * Handles the state change event for the 'filter' combo-box and 'invert'
643 protected void stateChanged(ItemEvent e)
645 if (e.getSource() instanceof JCheckBox)
651 if (e.getStateChange() == ItemEvent.SELECTED)
660 * Handles action event for btn_ok
663 public void ok_ActionPerformed()
665 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
667 String currentView = selectedFilterOpt.getView();
668 if (currentView == VIEWS_FILTER)
670 int pdbIdCol = PDBRestClient.getPDBIdColumIndex(
671 lastPdbRequest.getWantedFields(), true);
672 int[] selectedRows = tbl_summary.getSelectedRows();
673 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
675 for (int summaryRow : selectedRows)
677 String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
680 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
681 if (pdbEntry == null)
683 pdbEntry = new PDBEntry();
684 pdbEntry.setId(pdbIdStr);
685 pdbEntry.setType(PDBEntry.Type.PDB);
687 pdbEntriesToView[count++] = pdbEntry;
689 launchStructureViewer(ap.getStructureSelectionManager(),
690 pdbEntriesToView, ap, selectedSequences);
692 else if(currentView == VIEWS_LOCAL_PDB){
693 int[] selectedRows = tbl_local_pdb.getSelectedRows();
694 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
696 for (int row : selectedRows)
698 String entryKey = tbl_local_pdb.getValueAt(row, 1).toString()
700 pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
702 launchStructureViewer(ap.getStructureSelectionManager(),
703 pdbEntriesToView, ap, selectedSequences);
705 else if (currentView == VIEWS_ENTER_ID)
707 SequenceI userSelectedSeq = ((AssociateSeqOptions) idInputAssSeqPanel
708 .getCmb_assSeq().getSelectedItem()).getSequence();
709 if (userSelectedSeq != null)
711 selectedSequence = userSelectedSeq;
714 String pdbIdStr = txt_search.getText();
715 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
716 if (pdbEntry == null)
718 pdbEntry = new PDBEntry();
719 pdbEntry.setId(txt_search.getText());
720 pdbEntry.setType(PDBEntry.Type.PDB);
723 selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
724 PDBEntry[] pdbEntriesToView = new PDBEntry[]
726 launchStructureViewer(ap.getStructureSelectionManager(),
727 pdbEntriesToView, ap, new SequenceI[]
728 { selectedSequence });
730 else if (currentView == VIEWS_FROM_FILE)
732 SequenceI userSelectedSeq = ((AssociateSeqOptions) fileChooserAssSeqPanel
733 .getCmb_assSeq().getSelectedItem()).getSequence();
734 if (userSelectedSeq != null)
736 selectedSequence = userSelectedSeq;
738 PDBEntry fileEntry = new AssociatePdbFileWithSeq()
739 .associatePdbWithSeq(
740 selectedPdbFileName, AppletFormatAdapter.FILE,
741 selectedSequence, true, Desktop.instance);
743 launchStructureViewer(ap.getStructureSelectionManager(),
745 { fileEntry }, ap, new SequenceI[]
746 { selectedSequence });
751 private void launchStructureViewer(StructureSelectionManager ssm,
752 PDBEntry[] pdbEntriesToView, AlignmentPanel alignPanel,
753 SequenceI[] sequences)
755 StructureViewer sViewer = new StructureViewer(ssm);
756 if (pdbEntriesToView.length > 1)
758 sViewer.viewStructures(pdbEntriesToView, alignPanel.av.collateForPDB(pdbEntriesToView),
763 sViewer.viewStructures(pdbEntriesToView[0], sequences,
769 * Populates the combo-box used in associating manually fetched structures to
770 * a unique sequence when more than one sequence selection is made.
772 public void populateCmbAssociateSeqOptions(
773 JComboBox<AssociateSeqOptions> cmb_assSeq, JLabel lbl_associateSeq)
775 cmb_assSeq.removeAllItems();
776 cmb_assSeq.addItem(new AssociateSeqOptions("-Select Associated Seq-",
778 // cmb_assSeq.addItem(new AssociateSeqOptions("Auto Detect", null));
779 lbl_associateSeq.setVisible(false);
780 if (selectedSequences.length > 1)
782 for (SequenceI seq : selectedSequences)
784 cmb_assSeq.addItem(new AssociateSeqOptions(seq));
789 String seqName = selectedSequence.getDisplayId(false);
790 seqName = seqName.length() <= 40 ? seqName : seqName.substring(0, 39);
791 lbl_associateSeq.setText(seqName);
792 lbl_associateSeq.setVisible(true);
793 cmb_assSeq.setVisible(false);
797 public boolean isStructuresDiscovered()
799 return structuresDiscovered;
802 public void setStructuresDiscovered(boolean structuresDiscovered)
804 this.structuresDiscovered = structuresDiscovered;
807 public Collection<PDBResponseSummary> getDiscoveredStructuresSet()
809 return discoveredStructuresSet;
813 protected void txt_search_ActionPerformed()
815 errorWarning.setLength(0);
816 isValidPBDEntry = false;
817 if (txt_search.getText().length() > 0)
819 List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
820 wantedFields.add(PDBDocField.PDB_ID);
821 PDBRestRequest pdbRequest = new PDBRestRequest();
822 pdbRequest.setAllowEmptySeq(false);
823 pdbRequest.setResponseSize(1);
824 pdbRequest.setFieldToSearchBy("(pdb_id:");
825 pdbRequest.setWantedFields(wantedFields);
826 pdbRequest.setSearchTerm(txt_search.getText() + ")");
827 pdbRequest.setAssociatedSequence(selectedSequence.getName());
828 pdbRestCleint = new PDBRestClient();
829 PDBRestResponse resultList;
832 resultList = pdbRestCleint.executeRequest(pdbRequest);
833 } catch (Exception e)
835 errorWarning.append(e.getMessage());
839 validateSelections();
841 if (resultList.getSearchSummary() != null
842 && resultList.getSearchSummary().size() > 0)
844 isValidPBDEntry = true;
847 validateSelections();
851 public void tabRefresh()
853 if (selectedSequences != null)
855 Thread refreshThread = new Thread(new Runnable()
860 fetchStructuresMetaData();
861 filterResultSet(((FilterOption) cmb_filterOption
862 .getSelectedItem()).getValue());
865 refreshThread.start();