*
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
-->
-<head><title>Sequence Fetcher</title></head>
+<head>
+<title>Sequence Fetcher</title>
+</head>
<body>
<p><strong>Sequence Fetcher</strong></p>
-<p>Jalview can retrieve sequences from certain databases using either the
-WSDBFetch service provided by the European Bioinformatics Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em> command (configured in <a href="dassettings.html">DAS settings</a>).</p>
-<img src="seqfetcher.gif" align="center" alt="The Jalview Sequence Fetcher Dialog Box">
-<p>The Sequence Fetcher dialog box can be opened via the "File"
- menu on the main desktop in order to retrieve sequences as a new
- alignment, or opened via the "File" menu of an existing alignment
- to import additional sequences. Please note, there will be a short delay when the sequence fetcher is first opened,
- whilst Jalview compiles the list of available sequence datasources from the
- currently defined DAS server registry.</strong>
+<p>Jalview can retrieve sequences from certain databases using
+either the WSDBFetch service provided by the European Bioinformatics
+Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em>
+command (configured in <a href="dassettings.html">DAS settings</a>).</p>
+<img src="seqfetcher.gif" align="center"
+ alt="The Jalview Sequence Fetcher Dialog Box">
+<p>The Sequence Fetcher dialog box can be opened via the
+"File" menu on the main desktop in order to retrieve sequences
+as a new alignment, or opened via the "File" menu of an
+existing alignment to import additional sequences. Please note, there
+will be a short delay when the sequence fetcher is first opened, whilst
+Jalview compiles the list of available sequence datasources from the
+currently defined DAS server registry.</strong></p>
+<p>First, select the database you want to retrieve sequences from.
+Then, enter one or more accession ids (as a semi-colon separated list),
+or press the "Example" button to paste the example accession
+for the currently selected database into the retrieval box. Finally,
+press "OK" to initiate the retrieval.</p>
+<p><em>Fetching Individual PDB Chains</em><br>
+If you are retrieving sequences from the PDB, you can retrieve specific
+chains by appending a colon and the chain id to the PDB id. For example
+:<br>
+<pre> 1GAQ:A</pre>
+<br>
+When retrieving from DAS sequence sources, coordinate range arguments
+can be passed to the server using the standard DAS sequence command
+format (
+<strong>:<start>,<end></strong>
+)
+</p>
+<p><em>Retrieving parts of large sequence records</em><br>
+Some sequence sources allow a range query to be appended to the sequence
+ID - e.g. 'Mito:1,85779'. If you know a source understands this type of
+query format, then you should untick the checkbox for 'replace commas
+with semi-colons' so the range query can be passed to the server
+(otherwise the query will be split up into two 'Mito:1' and '85779'). In
+some cases, a source that supports range queries usually include a range
+qualification in its example query. In this case, Jalview will
+automatically disable the 'replace commas with semi-colons' option.<br>
+<em>Support for range queries was added in Jalview 2.6</em></p>
+<p>If you use the WSDBFetch sequence fetcher services (EMBL,
+Uniprot, PDB and PFAM) in work for publication, please cite:</p>
+<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S.,
+Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez
+R. <br>
+SOAP-based services provided by the European Bioinformatics Institute.<br>
+Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
+<br>
</p>
-<p>First, select the database you want to retrieve sequences from. Then, enter
- one or more accession ids (as a semi-colon separated list), or press the
- "Example" button to paste the example accession for the currently selected database into the retrieval box.
- Finally, press "OK" to initiate the retrieval.</p>
-<p>
- If you are retrieving sequences from the PDB, you can retrieve
- specific chains by appending a colon and the chain id to the PDB
- id. For example :<br><pre> 1GAQ:A</pre><br>When retrieving from DAS sequence sources,
- coordinate range arguments can be passed to the server using the standard DAS
- sequence command format (<strong>:<start>,<end></strong>)</p>
-<p>If you use the WSDBFetch sequence fetcher services (EMBL, Uniprot, PDB and PFAM)
- in work for publication, please cite:</p>
-<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar
- S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R. <br>
- SOAP-based services provided by the European Bioinformatics Institute.<br>
- Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
- <br>
- </p>
</body>
</html>
private static jalview.ws.SequenceFetcher sfetch = null;
private static String dasRegistry = null;
- private static boolean _initingFetcher=false;
- private static Thread initingThread=null;
+
+ private static boolean _initingFetcher = false;
+
+ private static Thread initingThread = null;
+
/**
* Blocking method that initialises and returns the shared instance of the
* SequenceFetcher client
public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
final IProgressIndicator guiWindow)
{
- if (_initingFetcher && initingThread!=null && initingThread.isAlive())
+ if (_initingFetcher && initingThread != null && initingThread.isAlive())
{
if (guiWindow != null)
{
- guiWindow.setProgressBar("Waiting for Sequence Database Fetchers to initialise",
+ guiWindow.setProgressBar(
+ "Waiting for Sequence Database Fetchers to initialise",
Thread.currentThread().hashCode());
}
- // initting happening on another thread - so wait around to see if it finishes.
- while (_initingFetcher && initingThread!=null && initingThread.isAlive())
+ // initting happening on another thread - so wait around to see if it
+ // finishes.
+ while (_initingFetcher && initingThread != null
+ && initingThread.isAlive())
{
- try {Thread.sleep(10);} catch (Exception e){};
+ try
+ {
+ Thread.sleep(10);
+ } catch (Exception e)
+ {
+ }
+ ;
}
if (guiWindow != null)
{
- guiWindow.setProgressBar("Waiting for Sequence Database Fetchers to initialise",
+ guiWindow.setProgressBar(
+ "Waiting for Sequence Database Fetchers to initialise",
Thread.currentThread().hashCode());
}
}
if (sfetch == null
|| dasRegistry != DasSourceBrowser.getDasRegistryURL())
{
- _initingFetcher=true;
- initingThread=Thread.currentThread();
+ _initingFetcher = true;
+ initingThread = Thread.currentThread();
/**
* give a visual indication that sequence fetcher construction is occuring
*/
initingThread.hashCode());
}
sfetch = sf;
- _initingFetcher=false;
- initingThread=null;
+ _initingFetcher = false;
+ initingThread = null;
}
return sfetch;
}
frame.setContentPane(this);
if (new jalview.util.Platform().isAMac())
{
- Desktop.addInternalFrame(frame, getFrameTitle(), 400, 180);
+ Desktop.addInternalFrame(frame, getFrameTitle(), 400, 240);
}
else
{
- Desktop.addInternalFrame(frame, getFrameTitle(), 400, 140);
+ Desktop.addInternalFrame(frame, getFrameTitle(), 400, 180);
}
}
dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
- jLabel1
- .setText("Separate multiple accession ids with semi colon \";\"");
+ jLabel1.setText("Separate multiple accession ids with semi colon \";\"");
+
+ replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
+ replacePunctuation
+ .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
+ replacePunctuation.setText("Replace commas with semi-colons");
ok.setText("OK");
ok.addActionListener(new ActionListener()
{
{
db = sfetch.getSourceProxy((String) sources.get(database
.getSelectedItem()));
- dbeg.setText("Example query: " + db.getTestQuery());
+ String eq = db.getTestQuery();
+ dbeg.setText("Example query: " + eq);
+ replacePunctuation.setEnabled(!(eq != null && eq.indexOf(",") > -1));
} catch (Exception ex)
{
dbeg.setText("");
+ replacePunctuation.setEnabled(true);
}
jPanel2.repaint();
}
dbeg.setText("");
jPanel2.add(database, java.awt.BorderLayout.NORTH);
jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
- jPanel2.add(jLabel1, java.awt.BorderLayout.SOUTH);
+ JPanel jPanel2a = new JPanel(new BorderLayout());
+ jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
+ jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
+ jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
// jPanel2.setPreferredSize(new Dimension())
jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
this.add(jPanel1, java.awt.BorderLayout.SOUTH);
JLabel jLabel1 = new JLabel();
+ JCheckBox replacePunctuation = new JCheckBox();
+
JButton ok = new JButton();
JButton clear = new JButton();
{
error += "Please select the source database\n";
}
- // TODO: make this transformation optional and configurable
- com.stevesoft.pat.Regex empty = new com.stevesoft.pat.Regex(
- "(\\s|[,; ])+", ";"); // \\s+", "");
+ // TODO: make this transformation more configurable
+ com.stevesoft.pat.Regex empty;
+ if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
+ {
+ empty = new com.stevesoft.pat.Regex(
+ // replace commas and spaces with a semicolon
+ "(\\s|[,; ])+", ";");
+ }
+ else
+ {
+ // just turn spaces and semicolons into single semicolons
+ empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
+ }
textArea.setText(empty.replaceAll(textArea.getText()));
// see if there's anthing to search with
if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
Enumeration en = new StringTokenizer(textArea.getText(), ";");
try
{
- guiWindow.setProgressBar("Fetching Sequences from "
- + database.getSelectedItem(), Thread.currentThread()
- .hashCode());
+ guiWindow.setProgressBar(
+ "Fetching Sequences from " + database.getSelectedItem(),
+ Thread.currentThread().hashCode());
DbSourceProxy proxy = sfetch.getSourceProxy((String) sources
.get(source));
if (proxy.getAccessionSeparator() == null)
indres = proxy.getSequenceRecords(item);
} catch (OutOfMemoryError oome)
{
- new OOMWarning(
- "fetching " + item + " from "
- + database.getSelectedItem(),oome,
- this);
+ new OOMWarning("fetching " + item + " from "
+ + database.getSelectedItem(), oome, this);
}
if (indres != null)
{
aresult = proxy.getSequenceRecords(multiacc.toString());
} catch (OutOfMemoryError oome)
{
- new OOMWarning(
- "fetching " + multiacc + " from "
- + database.getSelectedItem(),oome,
- this);
+ new OOMWarning("fetching " + multiacc + " from "
+ + database.getSelectedItem(), oome, this);
}
-
-
+
}
} catch (Exception e)