From: gmungoc Date: Wed, 25 Oct 2017 14:37:53 +0000 (+0100) Subject: JAL-2743 fall back to parsing description if chromosome lookup fails; X-Git-Tag: Release_2_11_0~183 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=329b71c12ee91c57d83df128e6447d6ef0583b17;p=jalview.git JAL-2743 fall back to parsing description if chromosome lookup fails; code formatting --- diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java index 11322c8..cdcfa96 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -166,25 +166,25 @@ public class EnsemblGene extends EnsemblSeqProxy /** * Calls the /lookup/id REST service, parses the response for gene - * coordinates, and if successful, adds these to the sequence + * coordinates, and if successful, adds these to the sequence. If this fails, + * fall back on trying to parse the sequence description in case it is in + * Ensembl-gene format e.g. chromosome:GRCh38:17:45051610:45109016:1. * * @param seq * @param geneId */ void findGeneLoci(SequenceI seq, String geneId) { - /* - * if sequence description is in gene loci format, parse this - * - but try remote lookup anyway as 'better' if available - */ - parseChromosomeLocations(seq); - GeneLociI geneLoci = new EnsemblLookup(getDomain()).getGeneLoci(geneId); if (geneLoci != null) { seq.setGeneLoci(geneLoci.getSpeciesId(), geneLoci.getAssemblyId(), geneLoci.getChromosomeId(), geneLoci.getMap()); } + else + { + parseChromosomeLocations(seq); + } } /** diff --git a/src/jalview/io/vcf/VCFLoader.java b/src/jalview/io/vcf/VCFLoader.java index af7bb0b..85bf7ef 100644 --- a/src/jalview/io/vcf/VCFLoader.java +++ b/src/jalview/io/vcf/VCFLoader.java @@ -895,8 +895,7 @@ public class VCFLoader */ EnsemblMap mapper = new EnsemblMap(); int[] mapping = mapper.getAssemblyMapping(species, chromosome, fromRef, - toRef, - queryRange); + toRef, queryRange); if (mapping == null) {