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 unsuccessful 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 if (isValidSeqName(entry.getId()))
298 seqRefs.add(entry.getId());
303 if (seq.getDBRef() != null && seq.getDBRef().length != 0)
306 for (DBRefEntry dbRef : seq.getDBRef())
308 if (isValidSeqName(getDBRefId(dbRef)))
310 seqRefs.add(getDBRefId(dbRef));
320 StringBuilder queryBuilder = new StringBuilder();
321 for (String seqRef : seqRefs)
323 queryBuilder.append("text:").append(seqRef).append(" OR ");
325 int endIndex = queryBuilder.lastIndexOf(" OR ");
326 String query = queryBuilder.toString().substring(5, endIndex);
331 * Ensures sequence ref names are not less than 3 characters and does not
332 * contain a database name
337 public static boolean isValidSeqName(String seqName)
339 System.out.println("seqName : " + seqName);
340 String ignoreList = "pdb,uniprot,swiss-prot";
341 if (seqName.length() < 3)
345 if (seqName.contains(":"))
349 seqName = seqName.toLowerCase();
350 for (String ignoredEntry : ignoreList.split(","))
352 if (seqName.contains(ignoredEntry))
360 public static String getDBRefId(DBRefEntry dbRef)
362 String ref = dbRef.getAccessionId().replaceAll("GO:", "");
367 * Filters a given list of discovered structures based on supplied argument
369 * @param fieldToFilterBy
370 * the field to filter by
372 public void filterResultSet(final String fieldToFilterBy)
374 Thread filterThread = new Thread(new Runnable()
379 long startTime = System.currentTimeMillis();
380 lbl_loading.setVisible(true);
381 Collection<PDBDocField> wantedFields = PDBDocFieldPreferences
382 .getStructureSummaryFields();
383 Collection<PDBResponseSummary> filteredResponse = new HashSet<PDBResponseSummary>();
384 HashSet<String> errors = new HashSet<String>();
385 for (SequenceI seq : selectedSequences)
387 PDBRestRequest pdbRequest = new PDBRestRequest();
388 pdbRequest.setAllowEmptySeq(false);
389 pdbRequest.setResponseSize(1);
390 pdbRequest.setFieldToSearchBy("(text:");
391 pdbRequest.setFieldToSortBy(fieldToFilterBy,
392 !chk_invertFilter.isSelected());
393 pdbRequest.setSearchTerm(buildQuery(seq) + ")");
394 pdbRequest.setWantedFields(wantedFields);
395 pdbRequest.setAssociatedSequence(seq.getName());
396 pdbRestCleint = new PDBRestClient();
397 PDBRestResponse resultList;
400 resultList = pdbRestCleint.executeRequest(pdbRequest);
401 } catch (Exception e)
403 errors.add(e.getMessage());
406 lastPdbRequest = pdbRequest;
407 if (resultList.getSearchSummary() != null
408 && !resultList.getSearchSummary().isEmpty())
410 filteredResponse.addAll(resultList.getSearchSummary());
414 String totalTime = (System.currentTimeMillis() - startTime)
416 if (!filteredResponse.isEmpty())
418 final int filterResponseCount = filteredResponse.size();
419 Collection<PDBResponseSummary> reorderedStructuresSet = new LinkedHashSet<PDBResponseSummary>();
420 reorderedStructuresSet.addAll(filteredResponse);
421 reorderedStructuresSet.addAll(discoveredStructuresSet);
422 tbl_summary.setModel(PDBRestResponse.getTableModel(
423 lastPdbRequest, reorderedStructuresSet));
425 // Update table selection model here
426 tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
428 mainFrame.setTitle("Structure Chooser - Filter time ("
433 mainFrame.setTitle("Structure Chooser - Filter time ("
435 if (errors.size() > 0)
437 StringBuilder errorMsg = new StringBuilder();
438 for (String error : errors)
440 errorMsg.append(error).append("\n");
442 JOptionPane.showMessageDialog(null, errorMsg.toString(),
443 "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
447 lbl_loading.setVisible(false);
449 validateSelections();
452 filterThread.start();
457 * Handles action event for btn_pdbFromFile
459 public void pdbFromFile_actionPerformed()
461 jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
462 jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
463 chooser.setFileView(new jalview.io.JalviewFileView());
464 chooser.setDialogTitle(MessageManager.formatMessage(
465 "label.select_pdb_file_for", new String[]
466 { selectedSequence.getDisplayId(false) }));
467 chooser.setToolTipText(MessageManager.formatMessage(
468 "label.load_pdb_file_associate_with_sequence", new String[]
469 { selectedSequence.getDisplayId(false) }));
471 int value = chooser.showOpenDialog(null);
472 if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
474 selectedPdbFileName = chooser.getSelectedFile().getPath();
475 jalview.bin.Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
476 validateSelections();
481 * Populates the filter combo-box options dynamically depending on discovered
484 protected void populateFilterComboBox()
486 if (isStructuresDiscovered())
488 cmb_filterOption.addItem(new FilterOption("Best Quality",
489 PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
490 cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
491 PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
492 cmb_filterOption.addItem(new FilterOption("Highest Resolution",
493 PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
494 cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
495 PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
496 cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
497 PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
498 cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
499 PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
501 cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
503 cmb_filterOption.addItem(new FilterOption("From File", "-",
505 cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
510 * Updates the displayed view based on the selected filter option
512 protected void updateCurrentView()
514 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
516 layout_switchableViews.show(pnl_switchableViews,
517 selectedFilterOpt.getView());
518 String filterTitle = mainFrame.getTitle();
519 mainFrame.setTitle(frameTitle);
520 chk_invertFilter.setVisible(false);
521 if (selectedFilterOpt.getView() == VIEWS_FILTER)
523 mainFrame.setTitle(filterTitle);
524 chk_invertFilter.setVisible(true);
525 filterResultSet(selectedFilterOpt.getValue());
527 else if (selectedFilterOpt.getView() == VIEWS_ENTER_ID
528 || selectedFilterOpt.getView() == VIEWS_FROM_FILE)
530 mainFrame.setTitle(filterTitle);
531 idInputAssSeqPanel.loadCmbAssSeq();
532 fileChooserAssSeqPanel.loadCmbAssSeq();
534 validateSelections();
538 * Validates user selection and activates the view button if all parameters
541 public void validateSelections()
543 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
545 btn_view.setEnabled(false);
546 String currentView = selectedFilterOpt.getView();
547 if (currentView == VIEWS_FILTER)
549 if (tbl_summary.getSelectedRows().length > 0)
551 btn_view.setEnabled(true);
554 else if (currentView == VIEWS_LOCAL_PDB)
556 if (tbl_local_pdb.getSelectedRows().length > 0)
558 btn_view.setEnabled(true);
561 else if (currentView == VIEWS_ENTER_ID)
563 validateAssociationEnterPdb();
565 else if (currentView == VIEWS_FROM_FILE)
567 validateAssociationFromFile();
572 * Validates inputs from the Manual PDB entry panel
574 public void validateAssociationEnterPdb()
576 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
577 .getCmb_assSeq().getSelectedItem();
578 lbl_pdbManualFetchStatus.setIcon(errorImage);
579 lbl_pdbManualFetchStatus.setToolTipText("");
580 if (txt_search.getText().length() > 0)
582 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
583 true, "No PDB entry found for \'" + txt_search.getText()
587 if (errorWarning.length() > 0)
589 lbl_pdbManualFetchStatus.setIcon(warningImage);
590 lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
591 true, errorWarning.toString()));
594 if (selectedSequences.length == 1
595 || !assSeqOpt.getName().equalsIgnoreCase(
596 "-Select Associated Seq-"))
598 txt_search.setEnabled(true);
601 btn_view.setEnabled(true);
602 lbl_pdbManualFetchStatus.setToolTipText("");
603 lbl_pdbManualFetchStatus.setIcon(goodImage);
608 txt_search.setEnabled(false);
609 lbl_pdbManualFetchStatus.setIcon(errorImage);
614 * Validates inputs for the manual PDB file selection options
616 public void validateAssociationFromFile()
618 AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
619 .getCmb_assSeq().getSelectedItem();
620 lbl_fromFileStatus.setIcon(errorImage);
621 if (selectedSequences.length == 1
622 || (assSeqOpt != null
623 && !assSeqOpt.getName().equalsIgnoreCase(
624 "-Select Associated Seq-")))
626 btn_pdbFromFile.setEnabled(true);
627 if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
629 btn_view.setEnabled(true);
630 lbl_fromFileStatus.setIcon(goodImage);
635 btn_pdbFromFile.setEnabled(false);
636 lbl_fromFileStatus.setIcon(errorImage);
641 public void cmbAssSeqStateChanged()
643 validateSelections();
647 * Handles the state change event for the 'filter' combo-box and 'invert'
651 protected void stateChanged(ItemEvent e)
653 if (e.getSource() instanceof JCheckBox)
659 if (e.getStateChange() == ItemEvent.SELECTED)
668 * Handles action event for btn_ok
671 public void ok_ActionPerformed()
673 FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
675 String currentView = selectedFilterOpt.getView();
676 if (currentView == VIEWS_FILTER)
678 int pdbIdCol = PDBRestClient.getPDBIdColumIndex(
679 lastPdbRequest.getWantedFields(), true);
680 int[] selectedRows = tbl_summary.getSelectedRows();
681 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
683 for (int summaryRow : selectedRows)
685 String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
688 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
689 if (pdbEntry == null)
691 pdbEntry = new PDBEntry();
692 pdbEntry.setId(pdbIdStr);
693 pdbEntry.setType(PDBEntry.Type.PDB);
695 pdbEntriesToView[count++] = pdbEntry;
697 launchStructureViewer(ap.getStructureSelectionManager(),
698 pdbEntriesToView, ap, selectedSequences);
700 else if(currentView == VIEWS_LOCAL_PDB){
701 int[] selectedRows = tbl_local_pdb.getSelectedRows();
702 PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
704 for (int row : selectedRows)
706 String entryKey = tbl_local_pdb.getValueAt(row, 1).toString()
708 pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
710 launchStructureViewer(ap.getStructureSelectionManager(),
711 pdbEntriesToView, ap, selectedSequences);
713 else if (currentView == VIEWS_ENTER_ID)
715 SequenceI userSelectedSeq = ((AssociateSeqOptions) idInputAssSeqPanel
716 .getCmb_assSeq().getSelectedItem()).getSequence();
717 if (userSelectedSeq != null)
719 selectedSequence = userSelectedSeq;
722 String pdbIdStr = txt_search.getText();
723 PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
724 if (pdbEntry == null)
726 pdbEntry = new PDBEntry();
727 pdbEntry.setId(txt_search.getText());
728 pdbEntry.setType(PDBEntry.Type.PDB);
731 selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
732 PDBEntry[] pdbEntriesToView = new PDBEntry[]
734 launchStructureViewer(ap.getStructureSelectionManager(),
735 pdbEntriesToView, ap, new SequenceI[]
736 { selectedSequence });
738 else if (currentView == VIEWS_FROM_FILE)
740 SequenceI userSelectedSeq = ((AssociateSeqOptions) fileChooserAssSeqPanel
741 .getCmb_assSeq().getSelectedItem()).getSequence();
742 if (userSelectedSeq != null)
744 selectedSequence = userSelectedSeq;
746 PDBEntry fileEntry = new AssociatePdbFileWithSeq()
747 .associatePdbWithSeq(
748 selectedPdbFileName, jalview.io.AppletFormatAdapter.FILE,
749 selectedSequence, true, Desktop.instance);
751 launchStructureViewer(ap.getStructureSelectionManager(),
753 { fileEntry }, ap, new SequenceI[]
754 { selectedSequence });
759 private void launchStructureViewer(StructureSelectionManager ssm,
760 PDBEntry[] pdbEntriesToView, AlignmentPanel alignPanel,
761 SequenceI[] sequences)
763 StructureViewer sViewer = new StructureViewer(ssm);
764 if (pdbEntriesToView.length > 1)
766 sViewer.viewStructures(pdbEntriesToView, alignPanel.av.collateForPDB(pdbEntriesToView),
771 sViewer.viewStructures(pdbEntriesToView[0], sequences,
777 * Populates the combo-box used in associating manually fetched structures to
778 * a unique sequence when more than one sequence selection is made.
780 public void populateCmbAssociateSeqOptions(
781 JComboBox<AssociateSeqOptions> cmb_assSeq, JLabel lbl_associateSeq)
783 cmb_assSeq.removeAllItems();
784 cmb_assSeq.addItem(new AssociateSeqOptions("-Select Associated Seq-",
786 // cmb_assSeq.addItem(new AssociateSeqOptions("Auto Detect", null));
787 lbl_associateSeq.setVisible(false);
788 if (selectedSequences.length > 1)
790 for (SequenceI seq : selectedSequences)
792 cmb_assSeq.addItem(new AssociateSeqOptions(seq));
797 String seqName = selectedSequence.getDisplayId(false);
798 seqName = seqName.length() <= 40 ? seqName : seqName.substring(0, 39);
799 lbl_associateSeq.setText(seqName);
800 lbl_associateSeq.setVisible(true);
801 cmb_assSeq.setVisible(false);
805 public boolean isStructuresDiscovered()
807 return structuresDiscovered;
810 public void setStructuresDiscovered(boolean structuresDiscovered)
812 this.structuresDiscovered = structuresDiscovered;
815 public Collection<PDBResponseSummary> getDiscoveredStructuresSet()
817 return discoveredStructuresSet;
821 protected void txt_search_ActionPerformed()
823 errorWarning.setLength(0);
824 isValidPBDEntry = false;
825 if (txt_search.getText().length() > 0)
827 List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
828 wantedFields.add(PDBDocField.PDB_ID);
829 PDBRestRequest pdbRequest = new PDBRestRequest();
830 pdbRequest.setAllowEmptySeq(false);
831 pdbRequest.setResponseSize(1);
832 pdbRequest.setFieldToSearchBy("(pdb_id:");
833 pdbRequest.setWantedFields(wantedFields);
834 pdbRequest.setSearchTerm(txt_search.getText() + ")");
835 pdbRequest.setAssociatedSequence(selectedSequence.getName());
836 pdbRestCleint = new PDBRestClient();
837 PDBRestResponse resultList;
840 resultList = pdbRestCleint.executeRequest(pdbRequest);
841 } catch (Exception e)
843 errorWarning.append(e.getMessage());
847 validateSelections();
849 if (resultList.getSearchSummary() != null
850 && resultList.getSearchSummary().size() > 0)
852 isValidPBDEntry = true;
855 validateSelections();
859 public void tabRefresh()
861 if (selectedSequences != null)
863 Thread refreshThread = new Thread(new Runnable()
868 fetchStructuresMetaData();
869 filterResultSet(((FilterOption) cmb_filterOption
870 .getSelectedItem()).getValue());
873 refreshThread.start();