From 8a2ec6e9cc058bd223ad1cc7969b9b58bc1f15a6 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 24 Sep 2008 13:29:01 +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