From: jprocter Date: Wed, 24 Sep 2008 13:29:01 +0000 (+0000) Subject: fixed sequence associated annotation reading bug where only first annotation is assoc... X-Git-Tag: Jalview_2_4_0b2~49 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8a2ec6e9cc058bd223ad1cc7969b9b58bc1f15a6;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 {