JAL-2154 make sure codon mappings between sequences discovered via database cross...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 4 Aug 2016 19:59:46 +0000 (20:59 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 4 Aug 2016 19:59:46 +0000 (20:59 +0100)
src/jalview/analysis/CrossRef.java

index b4d75f9..1edc9e5 100644 (file)
@@ -277,6 +277,19 @@ 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)
+                {
+                  // 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());
+                  }
+                }
               }
               refIterator.remove();
               continue;