fixed sequence associated annotation reading bug where only first annotation is assoc...
authorjprocter <Jim Procter>
Wed, 24 Sep 2008 13:30:52 +0000 (13:30 +0000)
committerjprocter <Jim Procter>
Wed, 24 Sep 2008 13:30:52 +0000 (13:30 +0000)
src/jalview/io/AnnotationFile.java

index 1bc5eff..d9fd871 100755 (executable)
@@ -554,15 +554,17 @@ public class AnnotationFile
         if (refSeq != null)\r
         {\r
           annotation.belowAlignment = false;\r
+          // make a copy of refSeq so we can find other matches in the alignment\r
+          SequenceI referedSeq = refSeq;\r
           do\r
           {\r
             // copy before we do any mapping business.\r
             // TODO: verify that undo/redo with 1:many sequence associated\r
             // annotations can be undone correctly\r
             AlignmentAnnotation ann = new AlignmentAnnotation(annotation);\r
-            annotation.createSequenceMapping(refSeq, refSeqIndex, false);\r
+            annotation.createSequenceMapping(referedSeq, refSeqIndex, false);\r
             annotation.adjustForAlignment();\r
-            refSeq.addAlignmentAnnotation(annotation);\r
+            referedSeq.addAlignmentAnnotation(annotation);\r
             al.addAnnotation(annotation);\r
             al.setAnnotationIndex(annotation,\r
                     al.getAlignmentAnnotation().length\r
@@ -571,7 +573,7 @@ public class AnnotationFile
             annotation = ann;\r
 \r
           } while (refSeqId != null\r
-                  && (refSeq = al.findName(refSeq, refSeqId, true)) != null);\r
+                  && (referedSeq = al.findName(referedSeq, refSeqId, true)) != null);\r
         }\r
         else\r
         {\r