From: amwaterhouse Date: Fri, 3 Feb 2006 17:44:33 +0000 (+0000) Subject: Retrieves PFAM alignments X-Git-Tag: Root_VamJalview_2_07b+~175 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a87f4c6fd568ccf29aaf3af0ad528da442ea921d;p=jalview.git Retrieves PFAM alignments --- diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index 0884d44..6d49d12 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -44,6 +44,7 @@ public class SequenceFetcher database.addItem("EMBL"); database.addItem("EMBLCDS"); database.addItem("PDB"); + database.addItem("PFAM"); try { @@ -64,8 +65,7 @@ public class SequenceFetcher private String getFrameTitle() { - return ( (alignFrame == null) ? "New " : "Additional ") + - "Sequence Fetcher (WSDBfetch@EBI)"; + return ( (alignFrame == null) ? "New " : "Additional ") + "Sequence Fetcher"; } private void jbInit() @@ -142,7 +142,6 @@ public class SequenceFetcher public void ok_actionPerformed(ActionEvent e) { - frame.setTitle("Sequence Fetcher (WSDBfetch@EBI) - Fetching Sequence..."); database.setEnabled(false); textfield.setEnabled(false); ok.setEnabled(false); @@ -158,7 +157,6 @@ public class SequenceFetcher textfield.setEnabled(true); ok.setEnabled(true); close.setEnabled(true); - frame.setTitle(getFrameTitle()); } public void run() @@ -214,13 +212,27 @@ public class SequenceFetcher if (result.length()>0) parseResult(result.toString()); } + else if( database.getSelectedItem().equals("PFAM")) + { + try{ + result.append(new FastaFile( + "http://www.sanger.ac.uk/cgi-bin/Pfam/getalignment.pl?format=fal&acc=" + + textfield.getText().toUpperCase(), "URL").print() + ); + + if(result.length()>0) + parseResult( result.toString() ); + + }catch(java.io.IOException ex) + { result = null; } + } if (result == null || result.length() == 0) showErrorMessage("Error retrieving " + textfield.getText() + " from " + database.getSelectedItem()); - else - textfield.setText(""); + resetDialog(); + return; } void getUniprotFile(String id) @@ -433,9 +445,11 @@ public class SequenceFetcher void showErrorMessage(String error) { + resetDialog(); JOptionPane.showInternalMessageDialog(Desktop.desktop, error, "Error Retrieving Data", JOptionPane.WARNING_MESSAGE); + return; } }