From dba956e3d9adfed3fbfb813c35bbe0eb59bed7d2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 Oct 2014 09:56:53 +0100 Subject: [PATCH] JAL-674 patch logic to test whether old and new sequence reference for annotation have a common dataset sequence --- src/jalview/datamodel/AlignmentAnnotation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 92a4f6d..679681c 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -949,10 +949,14 @@ public class AlignmentAnnotation { if (sequenceRef != null) { + boolean rIsDs=sequenceRef.getDatasetSequence()==null,tIsDs=sequenceI.getDatasetSequence()==null; if (sequenceRef != sequenceI - && !sequenceRef.equals(sequenceI) - && sequenceRef.getDatasetSequence() != sequenceI + && (rIsDs && !tIsDs && sequenceRef != sequenceI .getDatasetSequence()) + && (!rIsDs && tIsDs && sequenceRef.getDatasetSequence() != sequenceI) + && (!rIsDs && !tIsDs && sequenceRef.getDatasetSequence() != sequenceI + .getDatasetSequence()) + && !sequenceRef.equals(sequenceI)) { // if sequenceRef isn't intersecting with sequenceI // throw away old mapping and reconstruct. -- 1.7.10.2