2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
23 import java.awt.event.*;
26 import javax.swing.tree.DefaultMutableTreeNode;
27 import javax.swing.tree.MutableTreeNode;
28 import javax.swing.tree.TreeModel;
30 import jalview.datamodel.*;
32 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
33 import jalview.ws.seqfetcher.DbSourceProxy;
35 import java.awt.BorderLayout;
37 public class SequenceFetcher extends JPanel implements Runnable
39 // ASequenceFetcher sfetch;
42 IProgressIndicator guiWindow;
44 AlignFrame alignFrame;
48 final String noDbSelected = "-- Select Database --";
50 private static jalview.ws.SequenceFetcher sfetch = null;
52 private static long lastDasSourceRegistry = -3;
54 private static DasSourceRegistryI dasRegistry = null;
56 private static boolean _initingFetcher = false;
58 private static Thread initingThread = null;
61 * Blocking method that initialises and returns the shared instance of the
62 * SequenceFetcher client
65 * - where the initialisation delay message should be shown
66 * @return the singleton instance of the sequence fetcher client
68 public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
69 final IProgressIndicator guiWindow)
71 if (_initingFetcher && initingThread != null && initingThread.isAlive())
73 if (guiWindow != null)
75 guiWindow.setProgressBar(
76 "Waiting for Sequence Database Fetchers to initialise",
77 Thread.currentThread().hashCode());
79 // initting happening on another thread - so wait around to see if it
81 while (_initingFetcher && initingThread != null
82 && initingThread.isAlive())
92 if (guiWindow != null)
94 guiWindow.setProgressBar(
95 "Waiting for Sequence Database Fetchers to initialise",
96 Thread.currentThread().hashCode());
100 || dasRegistry != jalview.bin.Cache.getDasSourceRegistry()
101 || lastDasSourceRegistry != (jalview.bin.Cache
102 .getDasSourceRegistry().getDasRegistryURL() + jalview.bin.Cache
103 .getDasSourceRegistry().getLocalSourceString())
106 _initingFetcher = true;
107 initingThread = Thread.currentThread();
109 * give a visual indication that sequence fetcher construction is occuring
111 if (guiWindow != null)
113 guiWindow.setProgressBar("Initialising Sequence Database Fetchers",
114 Thread.currentThread().hashCode());
116 dasRegistry = jalview.bin.Cache.getDasSourceRegistry();
117 dasRegistry.refreshSources();
119 jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
120 if (guiWindow != null)
122 guiWindow.setProgressBar("Initialising Sequence Database Fetchers",
123 Thread.currentThread().hashCode());
125 lastDasSourceRegistry = (dasRegistry.getDasRegistryURL() + dasRegistry
126 .getLocalSourceString()).hashCode();
128 _initingFetcher = false;
129 initingThread = null;
134 public SequenceFetcher(IProgressIndicator guiIndic)
136 final IProgressIndicator guiWindow = guiIndic;
137 final SequenceFetcher us = this;
138 // launch initialiser thread
139 Thread sf = new Thread(new Runnable()
144 if (getSequenceFetcherSingleton(guiWindow) != null)
146 us.initGui(guiWindow);
150 javax.swing.SwingUtilities.invokeLater(new Runnable()
155 .showInternalMessageDialog(
157 "Could not create the sequence fetcher client. Check error logs for details.",
158 "Couldn't create SequenceFetcher",
159 JOptionPane.ERROR_MESSAGE);
163 // raise warning dialog
170 private class DatabaseAuthority extends DefaultMutableTreeNode
175 private class DatabaseSource extends DefaultMutableTreeNode
181 * called by thread spawned by constructor
185 private void initGui(IProgressIndicator guiWindow)
187 this.guiWindow = guiWindow;
188 if (guiWindow instanceof AlignFrame)
190 alignFrame = (AlignFrame) guiWindow;
192 database = new JDatabaseTree(sfetch);
196 } catch (Exception ex)
198 ex.printStackTrace();
201 frame = new JInternalFrame();
202 frame.setContentPane(this);
203 if (new jalview.util.Platform().isAMac())
205 Desktop.addInternalFrame(frame, getFrameTitle(), 400, 240);
209 Desktop.addInternalFrame(frame, getFrameTitle(), 400, 180);
213 private String getFrameTitle()
215 return ((alignFrame == null) ? "New " : "Additional ")
216 + "Sequence Fetcher";
219 private void jbInit() throws Exception
221 this.setLayout(borderLayout2);
223 database.setFont(JvSwingUtils.getLabelFont());
224 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
225 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
226 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
227 jLabel1.setText("Separate multiple accession ids with semi colon \";\"");
229 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
231 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
232 replacePunctuation.setText("Replace commas with semi-colons");
234 ok.addActionListener(new ActionListener()
236 public void actionPerformed(ActionEvent e)
238 ok_actionPerformed();
241 clear.setText("Clear");
242 clear.addActionListener(new ActionListener()
244 public void actionPerformed(ActionEvent e)
246 clear_actionPerformed();
250 example.setText("Example");
251 example.addActionListener(new ActionListener()
253 public void actionPerformed(ActionEvent e)
255 example_actionPerformed();
258 close.setText("Close");
259 close.addActionListener(new ActionListener()
261 public void actionPerformed(ActionEvent e)
263 close_actionPerformed(e);
266 textArea.setFont(JvSwingUtils.getLabelFont());
267 textArea.setLineWrap(true);
268 textArea.addKeyListener(new KeyAdapter()
270 public void keyPressed(KeyEvent e)
272 if (e.getKeyCode() == KeyEvent.VK_ENTER)
273 ok_actionPerformed();
276 jPanel3.setLayout(borderLayout1);
277 borderLayout1.setVgap(5);
279 jPanel1.add(example);
282 jPanel3.add(jPanel2, java.awt.BorderLayout.CENTER);
283 jPanel2.setLayout(borderLayout3);
284 databaseButt = database.getDatabaseSelectorButton();
285 databaseButt.setFont(JvSwingUtils.getLabelFont());
286 database.addActionListener(new ActionListener()
289 public void actionPerformed(ActionEvent e)
291 DbSourceProxy db = null;
294 databaseButt.setText(database.getSelectedItem()
295 + (database.getSelectedSources().size() > 1 ? " (and "
296 + database.getSelectedSources().size()
298 String eq = database.getExampleQueries();
299 dbeg.setText("Example query: " + eq);
300 replacePunctuation.setEnabled(!(eq != null && eq.indexOf(",") > -1));
301 } catch (Exception ex)
304 replacePunctuation.setEnabled(true);
310 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
311 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
312 JPanel jPanel2a = new JPanel(new BorderLayout());
313 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
314 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
315 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
316 // jPanel2.setPreferredSize(new Dimension())
317 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
318 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
319 this.add(jPanel3, java.awt.BorderLayout.CENTER);
320 this.add(jPanel2, java.awt.BorderLayout.NORTH);
321 jScrollPane1.getViewport().add(textArea);
325 protected void example_actionPerformed()
327 DbSourceProxy db = null;
330 textArea.setText(database.getExampleQueries());
331 } catch (Exception ex)
337 protected void clear_actionPerformed()
339 textArea.setText("");
343 JLabel dbeg = new JLabel();
345 JDatabaseTree database;
347 JButton databaseButt;
349 JLabel jLabel1 = new JLabel();
351 JCheckBox replacePunctuation = new JCheckBox();
353 JButton ok = new JButton();
355 JButton clear = new JButton();
357 JButton example = new JButton();
359 JButton close = new JButton();
361 JPanel jPanel1 = new JPanel();
363 JTextArea textArea = new JTextArea();
365 JScrollPane jScrollPane1 = new JScrollPane();
367 JPanel jPanel2 = new JPanel();
369 JPanel jPanel3 = new JPanel();
371 JPanel jPanel4 = new JPanel();
373 BorderLayout borderLayout1 = new BorderLayout();
375 BorderLayout borderLayout2 = new BorderLayout();
377 BorderLayout borderLayout3 = new BorderLayout();
379 public void close_actionPerformed(ActionEvent e)
383 frame.setClosed(true);
384 } catch (Exception ex)
389 public void ok_actionPerformed()
391 database.setEnabled(false);
392 textArea.setEnabled(false);
393 ok.setEnabled(false);
394 close.setEnabled(false);
396 Thread worker = new Thread(this);
400 private void resetDialog()
402 database.setEnabled(true);
403 textArea.setEnabled(true);
405 close.setEnabled(true);
411 if (!database.hasSelection())
413 error += "Please select the source database\n";
415 // TODO: make this transformation more configurable
416 com.stevesoft.pat.Regex empty;
417 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
419 empty = new com.stevesoft.pat.Regex(
420 // replace commas and spaces with a semicolon
421 "(\\s|[,; ])+", ";");
425 // just turn spaces and semicolons into single semicolons
426 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
428 textArea.setText(empty.replaceAll(textArea.getText()));
429 // see if there's anthing to search with
430 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
433 error += "Please enter a (semi-colon separated list of) database id(s)";
435 if (error.length() > 0)
437 showErrorMessage(error);
441 ArrayList<String> aresultq = new ArrayList<String>();
442 ArrayList<AlignmentI> aresult = new ArrayList<AlignmentI>();
443 DbSourceProxy proxy = database.getSelectedSources().get(0);
444 Enumeration en = new StringTokenizer(textArea.getText(), ";");
445 boolean isAliSource = false;
448 guiWindow.setProgressBar(
449 "Fetching Sequences from " + proxy.getDbName(), Thread
450 .currentThread().hashCode());
451 isAliSource = proxy.isA(DBRefSource.ALIGNMENTDB);
452 if (proxy.getAccessionSeparator() == null)
454 while (en.hasMoreElements())
456 String item = (String) en.nextElement();
463 // give the server a chance to breathe
465 } catch (Exception e)
472 AlignmentI indres = null;
475 indres = proxy.getSequenceRecords(item);
476 } catch (OutOfMemoryError oome)
478 new OOMWarning("fetching " + item + " from "
479 + proxy.getDbName(), oome, this);
486 } catch (Exception e)
488 jalview.bin.Cache.log.info("Error retrieving " + item
489 + " from " + proxy.getDbName(), e);
495 StringBuffer multiacc = new StringBuffer();
496 while (en.hasMoreElements())
498 multiacc.append(en.nextElement());
499 if (en.hasMoreElements())
501 multiacc.append(proxy.getAccessionSeparator());
506 aresultq.add(multiacc.toString());
507 aresult.add(proxy.getSequenceRecords(multiacc.toString()));
508 } catch (OutOfMemoryError oome)
510 new OOMWarning("fetching " + multiacc + " from "
511 + database.getSelectedItem(), oome, this);
516 } catch (Exception e)
518 showErrorMessage("Error retrieving " + textArea.getText() + " from "
519 + database.getSelectedItem());
520 // error +="Couldn't retrieve sequences from "+database.getSelectedItem();
521 System.err.println("Retrieval failed for source ='"
522 + database.getSelectedItem() + "' and query\n'"
523 + textArea.getText() + "'\n");
525 } catch (OutOfMemoryError e)
527 // resets dialog box - so we don't use OOMwarning here.
528 showErrorMessage("Out of Memory when retrieving "
531 + database.getSelectedItem()
532 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
536 showErrorMessage("Serious Error retrieving " + textArea.getText()
537 + " from " + database.getSelectedItem());
540 if (aresult != null && aresult.size() > 0)
542 AlignmentI ar = null;
545 // new window for each result
546 while (aresult.size() > 0)
548 parseResult(aresult.remove(0), aresultq.remove(0) + " "
549 + getDefaultRetrievalTitle(), null);
554 // concatenate all results in one window
555 while (aresult.size() > 0)
559 ar = aresult.remove(0);
563 ar.append(aresult.remove(0));
567 parseResult(ar, null, null);
570 // only remove visual delay after we finished parsing.
571 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
576 * result = new StringBuffer(); if
577 * (database.getSelectedItem().equals("Uniprot")) {
578 * getUniprotFile(textArea.getText()); } else if
579 * (database.getSelectedItem().equals("EMBL") ||
580 * database.getSelectedItem().equals("EMBLCDS")) { String DBRefSource =
581 * database.getSelectedItem().equals("EMBLCDS") ?
582 * jalview.datamodel.DBRefSource.EMBLCDS : jalview.datamodel.DBRefSource.EMBL;
584 * StringTokenizer st = new StringTokenizer(textArea.getText(), ";");
585 * SequenceI[] seqs = null; while(st.hasMoreTokens()) { EBIFetchClient dbFetch
586 * = new EBIFetchClient(); String qry =
587 * database.getSelectedItem().toString().toLowerCase( ) + ":" +
588 * st.nextToken(); File reply = dbFetch.fetchDataAsFile( qry, "emblxml",null);
590 * jalview.datamodel.xdb.embl.EmblFile efile=null; if (reply != null &&
591 * reply.exists()) { efile =
592 * jalview.datamodel.xdb.embl.EmblFile.getEmblFile(reply); } if (efile!=null)
593 * { for (Iterator i=efile.getEntries().iterator(); i.hasNext(); ) { EmblEntry
594 * entry = (EmblEntry) i.next(); SequenceI[] seqparts =
595 * entry.getSequences(false,true, DBRefSource); if (seqparts!=null) {
596 * SequenceI[] newseqs = null; int si=0; if (seqs==null) { newseqs = new
597 * SequenceI[seqparts.length]; } else { newseqs = new
598 * SequenceI[seqs.length+seqparts.length];
600 * for (;si<seqs.length; si++) { newseqs[si] = seqs[si]; seqs[si] = null; } }
601 * for (int j=0;j<seqparts.length; si++, j++) { newseqs[si] =
602 * seqparts[j].deriveSequence(); // place DBReferences on dataset and refer }
603 * seqs=newseqs; } } } else { result.append("# no response for "+qry); } } if
604 * (seqs!=null && seqs.length>0) { if (parseResult(new Alignment(seqs), null,
605 * null)!=null) { result.append("# Successfully parsed the
606 * "+database.getSelectedItem()+" Queries into an Alignment"); } } } else if
607 * (database.getSelectedItem().equals("PDB")) { StringTokenizer qset = new
608 * StringTokenizer(textArea.getText(), ";"); String query; SequenceI[] seqs =
609 * null; while (qset.hasMoreTokens() && ((query = qset.nextToken())!=null)) {
610 * SequenceI[] seqparts = getPDBFile(query.toUpperCase()); if (seqparts !=
611 * null) { if (seqs == null) { seqs = seqparts; } else { SequenceI[] newseqs =
612 * new SequenceI[seqs.length+seqparts.length]; int i=0; for (; i <
613 * seqs.length; i++) { newseqs[i] = seqs[i]; seqs[i] = null; } for (int
614 * j=0;j<seqparts.length; i++, j++) { newseqs[i] = seqparts[j]; }
615 * seqs=newseqs; } result.append("# Success for "+query.toUpperCase()+"\n"); }
616 * } if (seqs != null && seqs.length > 0) { if (parseResult(new
617 * Alignment(seqs), null, null)!=null) { result.append( "# Successfully parsed
618 * the PDB File Queries into an
619 * Alignment"); } } } else if( database.getSelectedItem().equals("PFAM")) {
620 * try { result.append(new FastaFile(
621 * "http://www.sanger.ac.uk/cgi-bin/Pfam/getalignment.pl?format=fal&acc=" +
622 * textArea.getText().toUpperCase(), "URL").print() );
624 * if(result.length()>0) { parseResult( result.toString(),
625 * textArea.getText().toUpperCase() ); } } catch (java.io.IOException ex) {
628 * if (result == null || result.length() == 0) { showErrorMessage("Error
629 * retrieving " + textArea.getText() + " from " + database.getSelectedItem());
632 * resetDialog(); return; }
634 * void getUniprotFile(String id) { EBIFetchClient ebi = new EBIFetchClient();
635 * File file = ebi.fetchDataAsFile("uniprot:" + id, "xml", null);
637 * DBRefFetcher dbref = new DBRefFetcher(); Vector entries =
638 * dbref.getUniprotEntries(file);
640 * if (entries != null) { //First, make the new sequences Enumeration en =
641 * entries.elements(); while (en.hasMoreElements()) { UniprotEntry entry =
642 * (UniprotEntry) en.nextElement();
644 * StringBuffer name = new StringBuffer(">UniProt/Swiss-Prot"); Enumeration
645 * en2 = entry.getAccession().elements(); while (en2.hasMoreElements()) {
646 * name.append("|"); name.append(en2.nextElement()); } en2 =
647 * entry.getName().elements(); while (en2.hasMoreElements()) {
648 * name.append("|"); name.append(en2.nextElement()); }
650 * if (entry.getProtein() != null) { name.append(" " +
651 * entry.getProtein().getName().elementAt(0)); }
653 * result.append(name + "\n" + entry.getUniprotSequence().getContent() +
656 * //Then read in the features and apply them to the dataset Alignment al =
657 * parseResult(result.toString(), null); for (int i = 0; i < entries.size();
658 * i++) { UniprotEntry entry = (UniprotEntry) entries.elementAt(i);
659 * Enumeration e = entry.getDbReference().elements(); Vector onlyPdbEntries =
660 * new Vector(); while (e.hasMoreElements()) { PDBEntry pdb = (PDBEntry)
661 * e.nextElement(); if (!pdb.getType().equals("PDB")) { continue; }
663 * onlyPdbEntries.addElement(pdb); }
665 * Enumeration en2 = entry.getAccession().elements(); while
666 * (en2.hasMoreElements()) {
667 * al.getSequenceAt(i).getDatasetSequence().addDBRef(new DBRefEntry(
668 * DBRefSource.UNIPROT, "0", en2.nextElement().toString())); }
673 * al.getSequenceAt(i).getDatasetSequence().setPDBId(onlyPdbEntries); if
674 * (entry.getFeature() != null) { e = entry.getFeature().elements(); while
675 * (e.hasMoreElements()) { SequenceFeature sf = (SequenceFeature)
676 * e.nextElement(); sf.setFeatureGroup("Uniprot");
677 * al.getSequenceAt(i).getDatasetSequence().addSequenceFeature( sf ); } } } }
680 * SequenceI[] getPDBFile(String id) { Vector result = new Vector(); String
681 * chain = null; if (id.indexOf(":") > -1) { chain =
682 * id.substring(id.indexOf(":") + 1); id = id.substring(0, id.indexOf(":")); }
684 * EBIFetchClient ebi = new EBIFetchClient(); String file =
685 * ebi.fetchDataAsFile("pdb:" + id, "pdb", "raw"). getAbsolutePath(); if (file
686 * == null) { return null; } try { PDBfile pdbfile = new PDBfile(file,
687 * jalview.io.AppletFormatAdapter.FILE); for (int i = 0; i <
688 * pdbfile.chains.size(); i++) { if (chain == null || ( (PDBChain)
689 * pdbfile.chains.elementAt(i)).id. toUpperCase().equals(chain)) { PDBChain
690 * pdbchain = (PDBChain) pdbfile.chains.elementAt(i); // Get the Chain's
691 * Sequence - who's dataset includes any special features added from the PDB
692 * file SequenceI sq = pdbchain.sequence; // Specially formatted name for the
693 * PDB chain sequences retrieved from the PDB
694 * sq.setName("PDB|"+id+"|"+sq.getName()); // Might need to add more metadata
695 * to the PDBEntry object // like below /* PDBEntry entry = new PDBEntry(); //
696 * Construct the PDBEntry entry.setId(id); if (entry.getProperty() == null)
697 * entry.setProperty(new Hashtable()); entry.getProperty().put("chains",
698 * pdbchain.id + "=" + sq.getStart() + "-" + sq.getEnd());
699 * sq.getDatasetSequence().addPDBId(entry); // Add PDB DB Refs // We make a
700 * DBRefEtntry because we have obtained the PDB file from a verifiable source
701 * // JBPNote - PDB DBRefEntry should also carry the chain and mapping
702 * information DBRefEntry dbentry = new
703 * DBRefEntry(jalview.datamodel.DBRefSource.PDB, "0", id + pdbchain.id);
704 * sq.addDBRef(dbentry); // and add seuqence to the retrieved set
705 * result.addElement(sq.deriveSequence()); } }
707 * if (result.size() < 1) { throw new Exception("WsDBFetch for PDB id resulted
708 * in zero result size"); } } catch (Exception ex) // Problem parsing PDB file
709 * { jalview.bin.Cache.log.warn("Exception when retrieving " +
710 * textArea.getText() + " from " + database.getSelectedItem(), ex); return
714 * SequenceI[] results = new SequenceI[result.size()]; for (int i = 0, j =
715 * result.size(); i < j; i++) { results[i] = (SequenceI) result.elementAt(i);
716 * result.setElementAt(null,i); } return results; }
718 AlignmentI parseResult(String result, String title)
720 String format = new IdentifyFile().Identify(result, "Paste");
721 Alignment sequences = null;
722 if (FormatAdapter.isValidFormat(format))
727 sequences = new FormatAdapter().readFile(result.toString(),
729 } catch (Exception ex)
733 if (sequences != null)
735 return parseResult(sequences, title, format);
740 showErrorMessage("Error retrieving " + textArea.getText() + " from "
741 + database.getSelectedItem());
749 * @return a standard title for any results retrieved using the currently
750 * selected source and settings
752 public String getDefaultRetrievalTitle()
754 return "Retrieved from " + database.getSelectedItem();
757 AlignmentI parseResult(AlignmentI al, String title,
758 String currentFileFormat)
761 if (al != null && al.getHeight() > 0)
763 if (alignFrame == null)
765 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
766 AlignFrame.DEFAULT_HEIGHT);
767 if (currentFileFormat != null)
769 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
771 // NON-FormatAdapter Sourced
777 title = getDefaultRetrievalTitle();
779 SequenceFeature[] sfs = null;
780 for (Enumeration sq = al.getSequences().elements(); sq
783 if ((sfs = ((SequenceI) sq.nextElement()).getDatasetSequence()
784 .getSequenceFeatures()) != null)
788 af.setShowSeqFeatures(true);
794 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
795 AlignFrame.DEFAULT_HEIGHT);
797 af.statusBar.setText("Successfully pasted alignment file");
801 af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN",
803 } catch (Exception ex)
809 for (int i = 0; i < al.getHeight(); i++)
811 alignFrame.viewport.getAlignment().addSequence(
812 al.getSequenceAt(i)); // this
819 alignFrame.viewport.setEndSeq(alignFrame.viewport.getAlignment()
821 alignFrame.viewport.getAlignment().getWidth();
822 alignFrame.viewport.firePropertyChange("alignment", null,
823 alignFrame.viewport.getAlignment().getSequences());
829 void showErrorMessage(final String error)
832 javax.swing.SwingUtilities.invokeLater(new Runnable()
836 JOptionPane.showInternalMessageDialog(Desktop.desktop, error,
837 "Error Retrieving Data", JOptionPane.WARNING_MESSAGE);