From 574045b24991af25bbb25526fbb9abd3b92c3fac Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 24 Sep 2008 13:30:52 +0000 Subject: [PATCH] fixed sequence associated annotation reading bug where only first annotation is associated with sequence when more than one follow a SEQUENCE_REF --- src/jalview/io/AnnotationFile.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 { -- 1.7.10.2