From: Jim Procter Date: Wed, 15 Oct 2014 08:56:53 +0000 (+0100) Subject: JAL-674 patch logic to test whether old and new sequence reference for annotation... X-Git-Tag: Jalview_2_9~169^2~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dba956e3d9adfed3fbfb813c35bbe0eb59bed7d2;p=jalview.git JAL-674 patch logic to test whether old and new sequence reference for annotation have a common dataset sequence --- 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.