From: Jim Procter Date: Fri, 30 Sep 2016 16:44:32 +0000 (+0100) Subject: JAL-2210 some DBRef xref/ref correspondences may add sequence but have no mapping... X-Git-Tag: Release_2_10_0~20^2~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=56a55873956da91d4301cbab320c69873f2329ab;p=jalview.git JAL-2210 some DBRef xref/ref correspondences may add sequence but have no mapping (e.g. ENSG->Uniprot), so always check if mappings have been added even if xref’ed sequence has already been added to set to be shown to user. --- diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index a729334..4a7a41b 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -296,20 +296,28 @@ public class CrossRef if (!rseqs.contains(matchInDataset)) { rseqs.add(matchInDataset); - // need to try harder to only add unique mappings - if (xref.getMap().getMap().isTripletMap() - && dataset.getMapping(seq, matchInDataset) == null - && cf.getMappingBetween(seq, matchInDataset) == null) + } + // even if rseqs contained matchInDataset - check mappings between + // these seqs are added + // need to try harder to only add unique mappings + if (xref.getMap().getMap().isTripletMap() + && dataset.getMapping(seq, matchInDataset) == null + && cf.getMappingBetween(seq, matchInDataset) == null) + { + // materialise a mapping for highlighting between these + // sequences + if (fromDna) { - // materialise a mapping for highlighting between these sequences - if (fromDna) - { - cf.addMap(dss, matchInDataset, xref.getMap().getMap(), xref.getMap().getMappedFromId()); - } else { - cf.addMap(matchInDataset, dss, xref.getMap().getMap().getInverse(), xref.getMap().getMappedFromId()); - } + cf.addMap(dss, matchInDataset, xref.getMap().getMap(), + xref.getMap().getMappedFromId()); + } + else + { + cf.addMap(matchInDataset, dss, xref.getMap().getMap() + .getInverse(), xref.getMap().getMappedFromId()); } } + refIterator.remove(); continue; }