From 70ad0f1ae40759c435ead9d732983aeb091dfd0e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 11 Apr 2016 16:37:04 +0100 Subject: [PATCH] JAL-2051 fetch Ensembl Gene accessions one at a time --- src/jalview/ext/ensembl/EnsemblGene.java | 17 +++++++++-------- src/jalview/gui/SequenceFetcher.java | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) 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()) { -- 1.7.10.2