From: gmungoc Date: Mon, 11 Apr 2016 15:37:04 +0000 (+0100) Subject: JAL-2051 fetch Ensembl Gene accessions one at a time X-Git-Tag: Release_2_10_0~263^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=70ad0f1ae40759c435ead9d732983aeb091dfd0e;p=jalview.git JAL-2051 fetch Ensembl Gene accessions one at a time --- diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java index 0bc6a74..84b5dcf 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -101,23 +101,18 @@ public class EnsemblGene extends EnsemblSeqProxy * * * @param query - * one or more identifiers separated by a space - * @return an alignment containing one or more genes, and possibly - * transcripts, or null + * a single gene or transcript identifier or gene name + * @return an alignment containing a gene, and possibly transcripts, or null */ @Override public AlignmentI getSequenceRecords(String query) throws Exception { - // todo: tidy up handling of one or multiple accession ids - String[] queries = query.split(getAccessionSeparator()); - /* * if given a transcript id, look up its gene parent */ if (isTranscriptIdentifier(query)) { - // we are assuming all transcripts have the same gene parent here - query = new EnsemblLookup(getDomain()).getParent(queries[0]); + query = new EnsemblLookup(getDomain()).getParent(query); if (query == null) { return null; @@ -556,4 +551,10 @@ public class EnsemblGene extends EnsemblSeqProxy }; } + @Override + public int getMaximumQueryCount() + { + return 1; + } + } diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index b6ee041..a5f218e 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -554,7 +554,7 @@ public class SequenceFetcher extends JPanel implements Runnable proxy.getDbName() }), Thread.currentThread() .hashCode()); isAliSource = proxy.isAlignmentSource(); - if (proxy.getAccessionSeparator() == null) + if (proxy.getMaximumQueryCount() == 1) { while (en.hasNext()) {