From: jprocter Date: Wed, 24 Sep 2008 13:30:52 +0000 (+0000) Subject: fixed sequence associated annotation reading bug where only first annotation is assoc... X-Git-Tag: Release_2_5~439 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=574045b24991af25bbb25526fbb9abd3b92c3fac;p=jalview.git fixed sequence associated annotation reading bug where only first annotation is associated with sequence when more than one follow a SEQUENCE_REF --- diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 1bc5eff..d9fd871 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -554,15 +554,17 @@ public class AnnotationFile if (refSeq != null) { annotation.belowAlignment = false; + // make a copy of refSeq so we can find other matches in the alignment + SequenceI referedSeq = refSeq; do { // copy before we do any mapping business. // TODO: verify that undo/redo with 1:many sequence associated // annotations can be undone correctly AlignmentAnnotation ann = new AlignmentAnnotation(annotation); - annotation.createSequenceMapping(refSeq, refSeqIndex, false); + annotation.createSequenceMapping(referedSeq, refSeqIndex, false); annotation.adjustForAlignment(); - refSeq.addAlignmentAnnotation(annotation); + referedSeq.addAlignmentAnnotation(annotation); al.addAnnotation(annotation); al.setAnnotationIndex(annotation, al.getAlignmentAnnotation().length @@ -571,7 +573,7 @@ public class AnnotationFile annotation = ann; } while (refSeqId != null - && (refSeq = al.findName(refSeq, refSeqId, true)) != null); + && (referedSeq = al.findName(referedSeq, refSeqId, true)) != null); } else {